From: Raymond O'Donnell <rod@iol.ie>
To: Clemens Eisserer <linuxhippy@gmail.com>
Cc: pgsql-general@postgresql.org
Subject: Re: Implicit sequence with start value?
Date: Sun, 26 Jul 2009 18:28:46 +0100
Message-ID: <4A6C924E.70407@iol.ie> (raw)
In-Reply-To: <194f62550907261020p569d3440s17f4edbfd88b0ba4@mail.gmail.com>
References: <194f62550907260910x5a286204g3280e4eb5e583cca@mail.gmail.com>
<27956.1248625117@sss.pgh.pa.us>
<194f62550907261020p569d3440s17f4edbfd88b0ba4@mail.gmail.com>
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@iol.ie
Galway Cathedral Recitals: http://www.galwaycathedral.org/recitals
------------------------------------------------------------------
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-jdbc@postgresql.org
Cc: rod@iol.ie, linuxhippy@gmail.com, pgsql-general@postgresql.org
Subject: Re: Implicit sequence with start value?
In-Reply-To: <4A6C924E.70407@iol.ie>
References: <194f62550907260910x5a286204g3280e4eb5e583cca@mail.gmail.com> <27956.1248625117@sss.pgh.pa.us> <194f62550907261020p569d3440s17f4edbfd88b0ba4@mail.gmail.com> <4A6C924E.70407@iol.ie>
* 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