Thread: Triggering a function on table overwrite
Hi
Normally when I need to run a function during an insert I make it a trigger function of that table.
However, in this case, I need to overwrite the table with which the trigger is attached.
I would appreciate any suggestions on how to do this.
Bob
Hi Bob, I guess with "overwrite the table" you mean to fill some columns with your values in trigger... If that is the case, in docs is example: http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html Kind Regards, Misa Sent from my Windows Phone ------------------------------ From: Bob Pawley Sent: 06/02/2012 06:57 To: Postgresql Subject: [GENERAL] Triggering a function on table overwrite Hi Normally when I need to run a function during an insert I make it a trigger function of that table. However, in this case, I need to overwrite the table with which the trigger is attached. I would appreciate any suggestions on how to do this. Bob
Misa Simic, 06.02.2012 10:35: > Hi Bob, > > I guess with "overwrite the table" you mean to fill some columns with your values in trigger... > > If that is the case, in docs is example: > > http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html > > Kind Regards, Please do not link to outdated documentation, use "current" instead of the version number: http://www.postgresql.org/docs/current/static/plpgsql-trigger.html
On Mon, Feb 6, 2012 at 8:42 PM, Thomas Kellerer <spam_eater@gmx.net> wrote: > Misa Simic, 06.02.2012 10:35: > >> Hi Bob, >> >> I guess with "overwrite the table" you mean to fill some columns with your >> values in trigger... >> >> If that is the case, in docs is example: >> >> http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html >> > > Please do not link to outdated documentation, use "current" instead of the > version number: > > http://www.postgresql.org/docs/current/static/plpgsql-trigger.html It seems that Googling for documentation often brings up old versions. Would it be difficult to have all those pages have a little banner up the top saying something like "NOTE: This documentation pertains to a previous version of Postgres. Documentation for the latest version of Postgres can be found at http://blah/blah/current/blah.html"? Chris Angelico
+1
I could undertsand the need to point to current version... but my goal was just to give someone a hint for his problem... I have answered from bed, from my mobile phone... so it was shortcut - few taps copy/paste, and google pointed me to the link...
In case I needed to worry about "is it for current version" (Though I have no idea which version user is on)... I would probably no answer at all... too much effort for simple help...
2012/2/6 Chris Angelico <rosuav@gmail.com>
On Mon, Feb 6, 2012 at 8:42 PM, Thomas Kellerer <spam_eater@gmx.net> wrote:
> Misa Simic, 06.02.2012 10:35:
>
>> Hi Bob,
>>
>> I guess with "overwrite the table" you mean to fill some columns with your
>> values in trigger...
>>
>> If that is the case, in docs is example:
>>
>> http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html
>>
>> Please do not link to outdated documentation, use "current" instead of theIt seems that Googling for documentation often brings up old versions.
> version number:
>
> http://www.postgresql.org/docs/current/static/plpgsql-trigger.html
Would it be difficult to have all those pages have a little banner up
the top saying something like "NOTE: This documentation pertains to a
previous version of Postgres. Documentation for the latest version of
Postgres can be found at http://blah/blah/current/blah.html"?
Chris Angelico
--
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general
Hi Bob,
I guess with "overwrite the table" you mean to fill some columns with your values in trigger...
If that is the case, in docs is example:
http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html
Kind Regards,
Misa
Sent from my Windows Phone
I guess with "overwrite the table" you mean to fill some columns with your values in trigger...
If that is the case, in docs is example:
http://www.postgresql.org/docs/8.1/static/plpgsql-trigger.html
Kind Regards,
Misa
Sent from my Windows Phone
From: Bob Pawley
Sent: 06/02/2012 06:57
To: Postgresql
Subject: [GENERAL] Triggering a function on table overwrite
Hi
Normally when I need to run a function during an insert I make it a trigger function of that table.
However, in this case, I need to overwrite the table with which the trigger is attached.
I would appreciate any suggestions on how to do this.
Bob