Re: Moving sequences to another schema

Поиск
Список
Период
Сортировка
От Michael Glaesemann
Тема Re: Moving sequences to another schema
Дата
Msg-id 932563F9-E00D-4423-988A-6BE95FB50131@myrealbox.com
обсуждение исходный текст
Ответ на Re: Moving sequences to another schema  (Bernd Helmle <mailings@oopsware.de>)
Список 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 по дате отправления:

Предыдущее
От: Stephen Frost
Дата:
Сообщение: Re: [PATCHES] Users/Groups -> Roles
Следующее
От: Rod Taylor
Дата:
Сообщение: WAL oddities (8.0.3)