pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Justin Clift <justin@postgresql.org>
To: Poul L. Christiansen <poulc@cs.auc.dk>
Cc: cbell <cbell@lighthouseasp.com>
Cc: pgsql-sql@postgresql.org
Subject: Re: Range of Serial values
Date: Tue, 17 Apr 2001 01:42:01 +1000
Message-ID: <3ADB12C9.D07A3D7B@postgresql.org> (raw)
References: <3ADB0FEF.12951EE1@lighthouseasp.com>
	<3ADB1894.21BF68A2@cs.auc.dk>

Hi,

I believe you could also create the sequence, then update it with
setval('<sequence name>', <number>);

Regards and best wishes,

Justin Clift

"Poul L. Christiansen" wrote:
> 
> Yes, there is.
> 
> When you create a serial column a sequence is created, which does the
> counting.
> 
> You can create a serial column, drop the associated sequence and create
> a new one with the command:
> "CREATE SEQUENCE seqname START 1000".
> 
> See also "\h CREATE SEQUENCE".
> 
> HTH,
> Poul L. Christansen
> 
> cbell wrote:
> >
> > Hello everyone,
> >
> > when creating a serial column, is there a way to specify which number it
> > will start counting from?  For example, if you wanted all Serial ID's to
> > start at 1000 and count up from there, with no numbers below that.
> >
> > Thanks,
> > Chris.
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 5: Have you checked our extensive FAQ?
> >
> > http://www.postgresql.org/users-lounge/docs/faq.html
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org

-- 
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
     - Indira Gandhi



view thread (4+ messages)  latest in thread

Message-ID: <3ADB12C9.D07A3D7B@postgresql.org>
Permalink:  ../3ADB12C9.D07A3D7B@postgresql.org/
Also on:    postgresql.org/message-id/3ADB12C9.D07A3D7B@postgresql.org

 · 

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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-sql@postgresql.org
  Cc: justin@postgresql.org, poulc@cs.auc.dk, cbell@lighthouseasp.com
  Subject: Re: Range of Serial values
  In-Reply-To: <3ADB12C9.D07A3D7B@postgresql.org>
  References: <3ADB0FEF.12951EE1@lighthouseasp.com> <3ADB1894.21BF68A2@cs.auc.dk> <3ADB12C9.D07A3D7B@postgresql.org>

* 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