Auto increment/sequence on multiple columns?

From: nboutelier(at)hotmail(dot)com (Nick)
To: pgsql-general(at)postgresql(dot)org
Subject: Auto increment/sequence on multiple columns?
Date: 2004-09-11 00:32:54
Message-ID: ce0d844c.0409101632.4d648dd8@posting.google.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Is it possible to have a sequence across two columns. For example

table1
+---+---+
| a | b |
+---+---+
| 1 | 1 |
| 1 | 2 |
| 1 | 3 |
| 2 | 1 |
| 2 | 2 |
| 2 | 3 |
| 3 | 1 |
| 3 | 2 |
| 3 | 3 |
+---+---+

Would I have to create a new sequence for every unique 'a' column?
That seems pretty tedious. -Nick

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bruno Wolff III 2004-09-11 01:32:54 Re: Obtaining the Julian Day from a date
Previous Message Bruce Momjian 2004-09-10 23:57:22 Re: 8.0.0beta2: gcc: unrecognized option `-pthreads'