Skip site navigation (1) Skip section navigation (2)

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 (view raw or flat)
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

pgsql-novice by date

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

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group