From: Bruno Wolff III <bruno@wolff.to>
To: Markus Bertheau <twanger@bluetwanger.de>
Cc: teknet@poczta.onet.pl
Cc: pgsql-admin@postgresql.org
Subject: Re: standard IDENTITY support (Was: Re: SERIAL type not autoincremented)
Date: Tue, 6 Jul 2004 00:04:39 -0500
Message-ID: <20040706050439.GA13797@wolff.to> (raw)
In-Reply-To: <1088984555.2767.16.camel@teetnang>
References: <20040702172227Z4873738-14310+28550@kps5.test.onet.pl>
<1088984555.2767.16.camel@teetnang>
On Mon, Jul 05, 2004 at 01:42:35 +0200,
Markus Bertheau <twanger@bluetwanger.de> wrote:
> ?? ??????, 02.07.2004, ?? 19:22, teknet@poczta.onet.pl ??????????:
> > Hello
> > i have:
> > create table student(
> > id SERIAL NOT NULL,
> > name VARCHAR(35) NOT NULL,
> > primary key (id)
> > );
> >
> > and when i try to insert like this:
> > insert into student (name) values('me');
> > i receive error:
> > ERROR: duplicate key violates unique constraint "student_pkey"
>
> Is this scenario possible in standard SQL identity columns? From what I
> read here[1], a standard IDENTITY column can guarantee successful
> insertion of a unique key. Is there similar support planned for
> PostgreSQL?
I don't expect things are going to change. However it isn't a problem
if you always use DEFAULT to generate the value to be inserted and
that you use bigserial if you need more than 2 billion (2^31) values.
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-admin@postgresql.org
Cc: bruno@wolff.to, twanger@bluetwanger.de, teknet@poczta.onet.pl
Subject: Re: standard IDENTITY support (Was: Re: SERIAL type not autoincremented)
In-Reply-To: <20040706050439.GA13797@wolff.to>
References: <20040702172227Z4873738-14310+28550@kps5.test.onet.pl> <1088984555.2767.16.camel@teetnang> <20040706050439.GA13797@wolff.to>
* 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