Re: Implicit sequence with start value?

From: Raymond O'Donnell <rod(at)iol(dot)ie>
To: Clemens Eisserer <linuxhippy(at)gmail(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Implicit sequence with start value?
Date: 2009-07-26 17:28:46
Message-ID: 4A6C924E.70407@iol.ie
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-jdbc

On 26/07/2009 18:20, Clemens Eisserer wrote:
> What still puzzles me is how to get the sequence value applied.
> MySQL's auto_increment simply ignores whatever value is supplied to
> it, however postgres seems to insert the value instead of the next
> sequence value, if one is supplied:

That's because type SERIAL sets the column's *default* value to call
nextval() - so if you supply an explicit value, it will use that instead.

Ray.

------------------------------------------------------------------
Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland
rod(at)iol(dot)ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2009-07-26 17:34:24 Re: Implicit sequence with start value?
Previous Message Clemens Eisserer 2009-07-26 17:20:41 Re: Implicit sequence with start value?

Browse pgsql-jdbc by date

  From Date Subject
Next Message Scott Marlowe 2009-07-26 17:34:24 Re: Implicit sequence with start value?
Previous Message Clemens Eisserer 2009-07-26 17:20:41 Re: Implicit sequence with start value?