Re: Serial and Index

From: Miroslav Šulc <miroslav(dot)sulc(at)startnet(dot)cz>
To: Sam Adams <samadams(at)myfastmail(dot)com>
Cc: pgsql-sql(at)postgresql(dot)org
Subject: Re: Serial and Index
Date: 2005-02-27 17:31:19
Message-ID: 422203E7.7010109@startnet.cz
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Documentation at
http://www.postgresql.org/docs/8.0/interactive/datatype.html#DATATYPE-SERIAL
says:

"In most cases you would also want to attach a UNIQUE or PRIMARY KEY
constraint to prevent duplicate values from being inserted by accident,
but this is not automatic."

and

"*Note: * Prior to PostgreSQL 7.3, serial implied UNIQUE. This is no
longer automatic. If you wish a serial column to be in a unique
constraint or a primary key, it must now be specified, same as with any
other data type."

Miroslav Šulc, CEO
StartNet s.r.o.
----------------------------------------------------
Vrchlického 161/5, Praha 5, 150 00, Česká republika
----------------------------------------------------
ICQ: 60144073
web: www.startnet.cz, www.novavystavba.cz
----------------------------------------------------
mobil: +420 603 711 413
telefon: +420 257 225 602
----------------------------------------------------

Sam Adams wrote:

>I read at http://jamesthornton.com/postgres/FAQ/faq-english.html#4.15.1
>that when a serial is created then an index is created on the column.
>However I can't seem to find this anywhere in the PoistgreSQL manual. Is
>this true? Thanks.
>
>-Sam
>
>---------------------------(end of broadcast)---------------------------
>TIP 7: don't forget to increase your free space map settings
>
>

Attachment Content-Type Size
miroslav.sulc.vcf text/x-vcard 400 bytes

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Mike Rylander 2005-02-27 17:43:23 Re: Serial and Index
Previous Message Ragnar Hafstað 2005-02-27 17:12:09 Re: Serial and Index