Create (function, procedure) and trigger to increment a counter - Mailing list pgsql-general

From Chris Barnes
Subject Create (function, procedure) and trigger to increment a counter
Date
Msg-id BLU149-W316D7A71AC7A2E19B17CF5D4210@phx.gbl
Whole thread Raw
List pgsql-general
I have a table usage, I would like to create a (function or procedure) called by the trigger to increment column counter after an update.

Can someone lend me a hand with the process behind creating this function,procedure and trigger.



               Table "public.usage"
    Column     |         Type          | Modifiers
---------------+-----------------------+-----------
 instrument    | character varying(13) |
 date          | date                  |
 counter       | integer               |




Internet Explorer 8 makes surfing easier. Get it now!

pgsql-general by date:

Previous
From: Florian Weimer
Date:
Subject: Re: Working around spurious unique constraint errors due to SERIALIZABLE bug
Next
From: Yuriy Rusinov
Date:
Subject: Re: Please help