Re: Using nextval(seq) in more than one column - Mailing list pgsql-novice

From Nis Jørgensen
Subject Re: Using nextval(seq) in more than one column
Date
Msg-id feir2f$b0n$1@sea.gmane.org
Whole thread Raw
In response to Using nextval(seq) in more than one column  (Sean Davis <sdavis2@mail.nih.gov>)
List 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

pgsql-novice by date:

Previous
From: "Greg Sabino Mullane"
Date:
Subject: Re: Using nextval(seq) in more than one column
Next
From: Sean Davis
Date:
Subject: Re: Using nextval(seq) in more than one column