pg.ddx.io pgsql-admin@postgresql.org mailing list archive
help / color / mirror / Atom feedstandard IDENTITY support (Was: Re: SERIAL type not autoincremented)
2+ messages / 2 participants
[nested] [flat]
* standard IDENTITY support (Was: Re: SERIAL type not autoincremented)
@ 2004-07-04 23:42 Markus Bertheau <twanger@bluetwanger.de>
0 siblings, 1 reply; 2+ messages in thread
From: Markus Bertheau @ 2004-07-04 23:42 UTC (permalink / raw)
To: teknet@poczta.onet.pl; +Cc: pgsql-admin
В Птн, 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?
Thanks.
--
Markus Bertheau <twanger@bluetwanger.de>
^ permalink raw reply [nested|flat] 2+ messages in thread
* Re: standard IDENTITY support (Was: Re: SERIAL type not autoincremented)
@ 2004-07-06 05:04 Bruno Wolff III <bruno@wolff.to>
parent: Markus Bertheau <twanger@bluetwanger.de>
0 siblings, 0 replies; 2+ messages in thread
From: Bruno Wolff III @ 2004-07-06 05:04 UTC (permalink / raw)
To: Markus Bertheau <twanger@bluetwanger.de>; +Cc: teknet@poczta.onet.pl; pgsql-admin
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.
^ permalink raw reply [nested|flat] 2+ messages in thread
end of thread, other threads:[~2004-07-06 05:04 UTC | newest]
Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-07-04 23:42 standard IDENTITY support (Was: Re: SERIAL type not autoincremented) Markus Bertheau <twanger@bluetwanger.de>
2004-07-06 05:04 ` Bruno Wolff III <bruno@wolff.to>
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