mirror of
https://github.com/postgres/postgres.git
synced 2025-06-23 14:01:44 +03:00
SERIAL no longer creates an index by default, as of 7.3.
This commit is contained in:
7
doc/FAQ
7
doc/FAQ
@ -1,7 +1,7 @@
|
|||||||
|
|
||||||
Frequently Asked Questions (FAQ) for PostgreSQL
|
Frequently Asked Questions (FAQ) for PostgreSQL
|
||||||
|
|
||||||
Last updated: Sat Nov 15 23:41:03 EST 2003
|
Last updated: Wed Nov 19 11:50:04 EST 2003
|
||||||
|
|
||||||
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
Current maintainer: Bruce Momjian (pgman@candle.pha.pa.us)
|
||||||
|
|
||||||
@ -879,8 +879,8 @@ BYTEA bytea variable-length byte array (null-byte safe)
|
|||||||
|
|
||||||
4.15.1) How do I create a serial/auto-incrementing field?
|
4.15.1) How do I create a serial/auto-incrementing field?
|
||||||
|
|
||||||
PostgreSQL supports a SERIAL data type. It auto-creates a sequence and
|
PostgreSQL supports a SERIAL data type. It auto-creates a sequence.
|
||||||
index on the column. For example, this:
|
For example, this:
|
||||||
CREATE TABLE person (
|
CREATE TABLE person (
|
||||||
id SERIAL,
|
id SERIAL,
|
||||||
name TEXT
|
name TEXT
|
||||||
@ -892,7 +892,6 @@ BYTEA bytea variable-length byte array (null-byte safe)
|
|||||||
id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
|
id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
|
||||||
name TEXT
|
name TEXT
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX person_id_key ON person ( id );
|
|
||||||
|
|
||||||
See the create_sequence manual page for more information about
|
See the create_sequence manual page for more information about
|
||||||
sequences. You can also use each row's OID field as a unique value.
|
sequences. You can also use each row's OID field as a unique value.
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
alink="#0000ff">
|
alink="#0000ff">
|
||||||
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
|
<H1>Frequently Asked Questions (FAQ) for PostgreSQL</H1>
|
||||||
|
|
||||||
<P>Last updated: Sat Nov 15 23:41:03 EST 2003</P>
|
<P>Last updated: Wed Nov 19 11:50:04 EST 2003</P>
|
||||||
|
|
||||||
<P>Current maintainer: Bruce Momjian (<A href=
|
<P>Current maintainer: Bruce Momjian (<A href=
|
||||||
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR>
|
"mailto:pgman@candle.pha.pa.us">pgman@candle.pha.pa.us</A>)<BR>
|
||||||
@ -1102,7 +1102,7 @@ BYTEA bytea variable-length byte array (null-byte safe)
|
|||||||
serial/auto-incrementing field?</H4>
|
serial/auto-incrementing field?</H4>
|
||||||
|
|
||||||
<P>PostgreSQL supports a <SMALL>SERIAL</SMALL> data type. It
|
<P>PostgreSQL supports a <SMALL>SERIAL</SMALL> data type. It
|
||||||
auto-creates a sequence and index on the column. For example,
|
auto-creates a sequence. For example,
|
||||||
this:</P>
|
this:</P>
|
||||||
<PRE>
|
<PRE>
|
||||||
CREATE TABLE person (
|
CREATE TABLE person (
|
||||||
@ -1118,7 +1118,6 @@ BYTEA bytea variable-length byte array (null-byte safe)
|
|||||||
id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
|
id INT4 NOT NULL DEFAULT nextval('person_id_seq'),
|
||||||
name TEXT
|
name TEXT
|
||||||
);
|
);
|
||||||
CREATE UNIQUE INDEX person_id_key ON person ( id );
|
|
||||||
</PRE>
|
</PRE>
|
||||||
|
|
||||||
See the <I>create_sequence</I> manual page for more information
|
See the <I>create_sequence</I> manual page for more information
|
||||||
|
Reference in New Issue
Block a user