Re: Auto increment/sequence on multiple columns?

From: Thomas F(dot)O'Connell <tfo(at)sitening(dot)com>
To: nboutelier(at)hotmail(dot)com (Nick)
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Auto increment/sequence on multiple columns?
Date: 2004-09-11 07:35:31
Message-ID: 28B0BAF0-03C5-11D9-8609-000D93AE0944@sitening.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

How does this imply one sequence? Is it guaranteed that for each value
of a, the values of b will be equivalent to all (and only) values of a?

There's plenty of flexibility within postgres for ways to use sequences.

Regardless, I think you need to have (and present) a better idea of
what you're trying to do with your data, which itself might be tedious,
but good data design will save you countless headaches down the road.

-tfo

On Sep 10, 2004, at 7:32 PM, Nick wrote:

> 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Oliver Jowett 2004-09-11 07:40:44 Re: problems returning a resultset from a function
Previous Message Thomas F.O'Connell 2004-09-11 07:29:42 Re: Best practices for migrating a development database to a release database