Re: update column based on postgis query on anther table

Поиск
Список
Период
Сортировка
От Gulcin Yildirim
Тема Re: update column based on postgis query on anther table
Дата
Msg-id F5092BB9-BC24-4B54-A7C3-1C16FD8C024A@gmail.com
обсуждение исходный текст
Ответ на Re: update column based on postgis query on anther table  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-sql

Sent from my iPhone
İ
On 16 Tem 2013, îat 08:24, Tom Lane <tgl@sss.pgh.pa.us> wrote:

> Stefan Sylla <stefansylla@gmx.de> writes:
>> Now I want to use a trigger function to automatically update the column
>> 'id_test1_poly' in tabel 'test1_point':
>
>> /**/
>> create or replace function test1_point_get_id_test1_poly() returns
>> trigger as $$
>>     begin
>>         new.id_test1_poly=test1_point_get_id_test1_poly(new.id);
>>     return new;
>>     end;
>> $$
>> language plpgsql volatile;
>> -- create trigger for function:
>> create trigger test1_point_get_id_test1_poly
>>   after insert or update on test1_point for each row execute procedure
>> test1_point_get_id_test1_poly();
>
> I think you need that to be a BEFORE insert or update trigger.  In
> an AFTER trigger, it's too late to affect the stored row.
>
>            regards, tom lane
>
>
> --
> Sent via pgsql-sql mailing list (pgsql-sql@postgresql.org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-sql



В списке pgsql-sql по дате отправления:

Предыдущее
От: Stefan Sylla
Дата:
Сообщение: Re: SOLVED: update column based on postgis query on anther table
Следующее
От: Carla Goncalves
Дата:
Сообщение: Listing table definitions by only one command