Re: Auto increment/sequence on multiple columns? - Mailing list pgsql-general

From Thomas F.O'Connell
Subject Re: Auto increment/sequence on multiple columns?
Date
Msg-id 28B0BAF0-03C5-11D9-8609-000D93AE0944@sitening.com
Whole thread Raw
In response to Auto increment/sequence on multiple columns?  (nboutelier@hotmail.com (Nick))
List 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


pgsql-general by date:

Previous
From: Thomas F.O'Connell
Date:
Subject: Re: Best practices for migrating a development database to a release database
Next
From: Anton Nikiforov
Date:
Subject: pg_shadow in a constraint