Auto increment field when updating? - Mailing list pgsql-sql

From Robin Keech
Subject Auto increment field when updating?
Date
Msg-id 31262893C5E5D2119C4900105A30B3A112D593@roadrunner.dialogue.net
Whole thread Raw
Responses Re: [SQL] Auto increment field when updating?  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: [SQL] Auto increment field when updating?  (Peter Vazsonyi <neko@kredit.sth.szif.hu>)
List pgsql-sql
Hi,  hope you can help.  This may be a really stupid question, but here
goes....

I have a table called 'log'.  This keeps track of an ongoing process.
The process writes records to the 'log' table using a unique id.  If the
id does not exist then the process inserts, else it updates the existing
row.  Only some fields are written to each time the row is updated.
There is one field called 'count' that ONLY needs to increment every
time that particular row AND the field 'count' are updated.

I know that I can select the information, increment it and update it
back again, but is there any way of setting up the database to do this
automatically?  I am using PostgreSQL 6.5.

Thanks


pgsql-sql by date:

Previous
From: "Moray McConnachie"
Date:
Subject: Re: [SQL] How to set up a simple relational database
Next
From: sszabo@bigpanda.com
Date:
Subject: Re: pgsql-sql-digest V1 #499