From: PG Doc comments form <noreply@postgresql.org>
To: pgsql-docs@lists.postgresql.org
Cc: mjf@pearson.co.uk
Subject: Update to equivalent SQL in 8.1.4. Serial Types
Date: Wed, 20 Feb 2019 12:47:04 +0000
Message-ID: <155066682428.1372.11257078279583524116@wrigleys.postgresql.org> (raw)
The following documentation comment has been logged on the website:
Page: https://www.postgresql.org/docs/11/datatype-numeric.html
Description:
In 8.1.4. Serial Types it says that
CREATE TABLE tablename (
colname SERIAL
);
is equivalent to
CREATE SEQUENCE tablename_colname_seq;
CREATE TABLE tablename (
colname integer NOT NULL DEFAULT nextval('tablename_colname_seq')
);
ALTER SEQUENCE tablename_colname_seq OWNED BY tablename.colname;
Since Postgres 10, the datatype of the automatically-created sequence
matches the datatype of the serial column. But the default type for
CREATE SEQUENCE remains as bigint. So the second block should start with
the line
CREATE SEQUENCE tablename_colname_seq AS INTEGER;
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 using the --to and --cc options:
reply via email
To: pgsql-docs@postgresql.org
Cc: noreply@postgresql.org, pgsql-docs@lists.postgresql.org, mjf@pearson.co.uk
Subject: Re: Update to equivalent SQL in 8.1.4. Serial Types
In-Reply-To: <155066682428.1372.11257078279583524116@wrigleys.postgresql.org>
* 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