alter table schema, default sequences stay the same

Поиск
Список
Период
Сортировка
От Sim Zacks
Тема alter table schema, default sequences stay the same
Дата
Msg-id 4C29E273.2000103@compulab.co.il
обсуждение исходный текст
Ответы Re: alter table schema, default sequences stay the same  ("A. Kretschmer" <andreas.kretschmer@schollglas.com>)
Re: alter table schema, default sequences stay the same  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-general
I am using 8.2.17

I added a new schema and moved tables into it using

ALTER TABLE tblname SET SCHEMA newschema;


This moves the sequences referred to by the table to the new schema as
is specified by the manual.

> Associated indexes, constraints, and sequences owned by table columns
> are moved as well.

I was very surprised to find that the default nextval functions still
refer to the sequence public.sequencename

I discovered this when I tried to insert and it told me the sequence
does not exist.


> id integer NOT NULL DEFAULT
> nextval(('public.tblname_id_seq'::text)::regclass)
Shouldn't this change automatically as well?
Is there an easy way to modify all the default values now?

Thanks
Sim

В списке pgsql-general по дате отправления:

Предыдущее
От: raghu ram
Дата:
Сообщение: Re: Prepared statement issue in Pgpool-II
Следующее
От: "A. Kretschmer"
Дата:
Сообщение: Re: alter table schema, default sequences stay the same