From: | Achilleus Mantzios <achill(at)matrix(dot)gatewaynet(dot)com> |
---|---|
To: | juerg(dot)rietmann(at)pup(dot)ch |
Cc: | pgsql-sql(at)postgresql(dot)org |
Subject: | Re: how to use nextval() |
Date: | 2002-07-05 12:37:22 |
Message-ID: | Pine.LNX.4.44.0207051534120.12331-100000@matrix.gatewaynet.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-sql |
On Fri, 5 Jul 2002 juerg(dot)rietmann(at)pup(dot)ch wrote:
> Hello there
>
> I have an idea how to solve my problem on copy a record to a new one in the
> same table. To do so I need the next value for the primary key.
>
> Using :
>
> select nextval('pk_auftrag') as nextkey from auftrag;
>
> I get an error like : Relation pk_auftrag does not exist !
Do a \d to find out the name of your sequence.
Most probably it will be named as
"auftrag_<your auftrag table primary key>_seq".
Let it be "auftrag_id_seq".
Your command is
SELECT nextval('"auftrag_id_seq"'::text);
>
> Thanks for any help ... jr
>
> __________________________________________________
>
> PFISTER + PARTNER, SYSTEM - ENGINEERING AG
> Juerg Rietmann
> Grundstrasse 22a
> 6343 Rotkreuz
> Switzerland
>
> internet : www.pup.ch
> phone : +4141 790 4040
> fax : +4141 790 2545
> mobile : +4179 211 0315
> __________________________________________________
>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Don't 'kill -9' the postmaster
>
>
--
Achilleus Mantzios
S/W Engineer
IT dept
Dynacom Tankers Mngmt
tel: +30-10-8981112
fax: +30-10-8981877
email: achill(at)matrix(dot)gatewaynet(dot)com
mantzios(at)softlab(dot)ece(dot)ntua(dot)gr
From | Date | Subject | |
---|---|---|---|
Next Message | Manfred Koizar | 2002-07-05 12:40:10 | Re: sql statement how to do ? |
Previous Message | Stephane Schildknecht | 2002-07-05 12:28:21 | Re: how to use nextval() |