X-Original-To: pgsql-sql-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [64.117.224.130]) by svr1.postgresql.org (Postfix) with ESMTP id 03C5CD1B587 for ; Sat, 20 Sep 2003 09:36:34 +0000 (GMT) Received: from svr1.postgresql.org ([64.117.224.193]) by localhost (neptune.hub.org [64.117.224.130]) (amavisd-new, port 10024) with ESMTP id 03997-07 for ; Sat, 20 Sep 2003 06:36:05 -0300 (ADT) Received: from smtp-1.indo.net.id (smtp-1.indo.net.id [202.159.32.91]) by svr1.postgresql.org (Postfix) with SMTP id 2E14BD1B582 for ; Sat, 20 Sep 2003 06:35:58 -0300 (ADT) Received: (qmail 28027 invoked from network); 20 Sep 2003 16:35:55 +0700 Received: from smtp.indo.net.id (202.159.32.81) by smtp-1.indo.net.id with SMTP; 20 Sep 2003 16:35:55 +0700 Received: (qmail 20968 invoked from network); 20 Sep 2003 09:33:46 -0000 Received: from unknown (HELO smtp) (202.159.51.117) by smtp.indo.net.id with SMTP; 20 Sep 2003 09:33:46 -0000 Received: FROM middinkcomp BY smtp ; Sat Sep 20 16:45:42 2003 +0700 Message-ID: <002201c37f54$29608e40$1f00a8c0@middinkcomp> From: "Muhyiddin A.M Hayat" To: References: <001d01c37f3e$983ed3a0$2363a8c0@ckeskin> Subject: Re: auto_increment Date: Sat, 20 Sep 2003 16:43:10 +0800 MIME-Version: 1.0 Content-Type: multipart/alternative; boundary="----=_NextPart_000_0017_01C37F96.4681F5D0" X-Priority: 3 X-MSMail-Priority: Normal X-Mailer: Microsoft Outlook Express 6.00.2800.1158 X-MimeOLE: Produced By Microsoft MimeOLE V6.00.2800.1165 X-Virus-Scanned: by amavisd-new at postgresql.org X-Spam-Status: No, hits=1.5 tagged_above=0.0 required=5.0 tests=HTML_80_90, HTML_FONT_COLOR_BLUE, RCVD_IN_OSIRUSOFT_COM, REFERENCES X-Spam-Level: * X-Archive-Number: 200309/217 X-Sequence-Number: 15195 This is a multi-part message in MIME format. ------=_NextPart_000_0017_01C37F96.4681F5D0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Ok, but if i do rollback, the auto_increment don't roolback. How to use nextval(), currval() and setval() functions. ----- Original Message -----=20 From: Cavit Keskin=20 To: 'Muhyiddin A.M Hayat'=20 Sent: Saturday, September 20, 2003 2:15 PM Subject: RE: [SQL] auto_increment Create table tablename( id serial, .... ); =20=20=20 Serial type is integer and autoincrement When you create this table creates automatic sequence tablename_id_seq Stored sequence last value; Try execSQL : select * from tablename_id_seq; =20=20=20 My english is very very little and bad =20=20=20 ------=_NextPart_000_0017_01C37F96.4681F5D0 Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable
Ok, but if i do rollback, the auto_increment don't roolback.
How to use nextval(), currval() and setval()=20 functions.
 <= /DIV>
----- O= riginal=20 Message -----
Fro= m:=20 Cavit Keskin= =20
Sent: Saturday, September 20, 2003= 2:15=20 PM
Subject: RE: [SQL] auto_increment<= /DIV>

Create<= /FONT> table tablename(

  id serial,

  =85=85..

);<= /SPAN>

 

Serial<= /FONT> type is integer and autoincrement

When you create  this= table creates automatic sequence tablename_id_seq

Stored<= /FONT> sequence last value;

Try execSQL : select * from tablename_id_seq;

 

My english is very very little and bad

 

------=_NextPart_000_0017_01C37F96.4681F5D0--