From: | Michael Glaesemann <grzm(at)myrealbox(dot)com> |
---|---|
To: | Bernd Helmle <mailings(at)oopsware(dot)de> |
Cc: | PostgreSQL-Hackers <pgsql-hackers(at)postgresql(dot)org> |
Subject: | Re: Moving sequences to another schema |
Date: | 2005-06-30 16:01:27 |
Message-ID: | 932563F9-E00D-4423-988A-6BE95FB50131@myrealbox.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
On Jun 30, 2005, at 8:13 PM, Bernd Helmle wrote:
> I currently recognized that a SERIAL column doesn't only create an
> implicit sequence, it creates an implicit composite type with the
> same name, too. I think this is the same for CREATE SEQUENCE?
Sequences are just special types of tables. All tables have a
corresponding composite type, so sequences do as well.
CREATE TABLE foo (foo_id serial); is a shorthand for
CREATE SEQUENCE foo_foo_id_seq;
CREATE TABLE foo (foo_id integer default nextval
('foo_foo_id_seq'::text));
Using SERIAL implies CREATE SEQUENCE.
Does this help?
Michael Glaesemann
grzm myrealbox com
From | Date | Subject | |
---|---|---|---|
Next Message | Rod Taylor | 2005-06-30 16:10:43 | WAL oddities (8.0.3) |
Previous Message | Stephen Frost | 2005-06-30 15:49:59 | Re: [PATCHES] Users/Groups -> Roles |