Re: Using nextval(seq) in more than one column

From: Nis Jørgensen <nis(at)superlativ(dot)dk>
To: pgsql-novice(at)postgresql(dot)org
Subject: Re: Using nextval(seq) in more than one column
Date: 2007-10-10 15:28:07
Message-ID: feir2f$b0n$1@sea.gmane.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

Sean Davis skrev:
> I am trying to design some tables that have keys that look like:
>
> ASDF-####
>
> where #### should be derived from a sequence. However, I would like the
> primary key to be an integer for speed of indexing, etc. I don't see a
> way using standard DDL followed by inserts to have the #### be the same
> number as the integer primary key. Is that the case?

What do you mean by "key"? Normally this word indicates something you
use to look up data by. In that case you will probably want an index on
it. So your indexing will be slower, not faster.

Nis

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Greg Sabino Mullane 2007-10-10 16:01:47 Re: Using nextval(seq) in more than one column
Previous Message A. Kretschmer 2007-10-10 12:42:21 Re: Using nextval(seq) in more than one column