pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: sad <sad@bankir.ru>
To: pgsql-sql@postgresql.org
Subject: Re: auto_increment
Date: Mon, 22 Sep 2003 09:15:04 +0400
Message-ID: <200309220915.04899.sad@bankir.ru> (raw)
In-Reply-To: <1064038995.5359.70.camel@linda.lfix.co.uk>
References: <008501c37f35$832e26e0$1f00a8c0@middinkcomp>
	<1064038995.5359.70.camel@linda.lfix.co.uk>

On Saturday 20 September 2003 10:23, you wrote:
> On Sat, 2003-09-20 at 06:10, Muhyiddin A.M Hayat wrote:
> > How to Create auto_increment field in PostreSQL.
> > Can I create them using Trigger.
>
> Use the SERIAL datatype.  See also the functions nextval(), currval()
> and setval().

I believe it is better to EXPLICITLY declare a SEQUENCE and 
set the default value nextval() to the field.




view thread (27+ messages)  latest in thread

Message-ID: <200309220915.04899.sad@bankir.ru>
Permalink:  ../200309220915.04899.sad@bankir.ru/
Also on:    postgresql.org/message-id/200309220915.04899.sad@bankir.ru

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: sad@bankir.ru
  Subject: Re: auto_increment
  In-Reply-To: <200309220915.04899.sad@bankir.ru>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox