Skip site navigation (1) Skip section navigation (2)

Update and trigger

From: "Medi Montaseri" <montaseri(at)gmail(dot)com>
To: pgsql-sql(at)postgresql(dot)org
Subject: Update and trigger
Date: 2008-06-11 01:45:51
Message-ID: 8078a1730806101845x620d9f72p204d3cf94c0eb612@mail.gmail.com (view raw or flat)
Thread:
Lists: pgsql-sql
Hi,

I need to increament a counter such as myTable.Counter of type integer
everytime myTable.status a boolean column is updated. Can you help me
complete this...

create trigger counter_trigger after update on myTable.counter
execute procedure 'BEGIN statement; statement; statement END'

Q1- how do I narrow the event to "update on a column not a row"
Q2- can I just provide an inline procedure for the execute

Thanks
Medi

Responses

pgsql-sql by date

Next:From: A. KretschmerDate: 2008-06-11 05:21:07
Subject: Re: Update and trigger
Previous:From: Medi MontaseriDate: 2008-06-10 20:11:23
Subject: Re: Conceptual Design Question

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group