Re: Moving sequences to another schema - Mailing list pgsql-hackers

From Michael Glaesemann
Subject Re: Moving sequences to another schema
Date
Msg-id 932563F9-E00D-4423-988A-6BE95FB50131@myrealbox.com
Whole thread Raw
In response to Re: Moving sequences to another schema  (Bernd Helmle <mailings@oopsware.de>)
List 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




pgsql-hackers by date:

Previous
From: Stephen Frost
Date:
Subject: Re: [PATCHES] Users/Groups -> Roles
Next
From: Rod Taylor
Date:
Subject: WAL oddities (8.0.3)