Re: How would I make a table of autonumbers/sequences?

From: missive(at)frontiernet(dot)net (Lee Harr)
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: How would I make a table of autonumbers/sequences?
Date: 2001-08-17 22:36:20
Message-ID: 9lk693$koo$2@node21.cwnet.roc.gblx.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 17 Aug 2001 06:58:38 -0700, Joseph Castille <joseph(dot)castille(at)wcom(dot)com> wrote:
> I want to make a field in a table contain numbers that increment each
> time a record is updated. How would I go about doing this?
>
>
> Example:
>
> Table1
> CustID balance
> A12 255.32
> B20 132.20
>
> Table2
> CustID transactions
> A12 7
> B20 33
>
>
> Every time something is inserted or updated in table1 I want to
> increment that customer's number of transactions in table2. How would
> I go about doing this?
>

This sounds like a good place for a trigger.

Did you ask this on the pgsql-general list yet?
You will probably have better luck there.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-08-17 22:48:13 Changelog and 7.1.3 release
Previous Message Trond Eivind =?iso-8859-1?q?Glomsr=F8d?= 2001-08-17 19:54:58 Re: PostgreSQL v7.1.3 bundled and uploaded to central FTP Server