Sequence - Mailing list pgsql-general

From Alex Cheshev
Subject Sequence
Date
Msg-id 48895C7F.1080503@gmail.com
Whole thread Raw
Responses Re: Sequence
Re: Sequence
List pgsql-general
Hello.
A table has two primary keys: CREATE TABLE example ( pk1 integer, pk2
integer, PRIMARY KEY (pk1, pk2) ). To add a new record I use command:
INSERT INTO example (pk1, pk2) VALUES (0, 0). Before adding the new
record I have to find out the last value of pk2. How can I use something
like this: INSERT INTO example (pk1, pk2) VALUES (0, nextval('pk2'))?
If a table just has one primary key I can use sequence (CREATE
SEQUENCE). What about two primary keys?

pgsql-general by date:

Previous
From: Chris
Date:
Subject: Re: php + postgresql
Next
From: "A. Kretschmer"
Date:
Subject: Re: Sequence