[prev in list] [next in list] [prev in thread] [next in thread]
List: postgresql-general
Subject: Re: [HACKERS] Moving sequences to another schema
From: Michael Glaesemann <grzm () myrealbox ! com>
Date: 2005-06-30 16:01:27
Message-ID: 932563F9-E00D-4423-988A-6BE95FB50131 () myrealbox ! com
[Download RAW message or body]
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
---------------------------(end of broadcast)---------------------------
TIP 6: Have you searched our list archives?
http://archives.postgresql.org
[prev in list] [next in list] [prev in thread] [next in thread]
Configure |
About |
News |
Add a list |
Sponsored by KoreLogic