Re: ALTER TABLE schema SCHEMA TO new_schema?

Поиск
Список
Период
Сортировка
От Joe Conway
Тема Re: ALTER TABLE schema SCHEMA TO new_schema?
Дата
Msg-id 3DEB9836.2090806@joeconway.com
обсуждение исходный текст
Ответ на Re: ALTER TABLE schema SCHEMA TO new_schema?  (Fernando Nasser <fnasser@redhat.com>)
Список pgsql-hackers
Fernando Nasser wrote:
> Why not just leave the sequence and types in the original schema and 
> make sure the table refers to them _there_?  We just need to make sure 
> we have schema qualified references to the sequences and types.

Well, the type entry for the relation *is* related to just one table, so I'd 
be inclined to move it also. But leaving the sequence alone might be the best 
thing to do. Although, I think sequences created via SERIAL are dropped with 
their referencing table now, aren't they?

test=# create table myserial(id serial);
NOTICE:  CREATE TABLE will create implicit sequence 'myserial_id_seq' for 
SERIAL column 'myserial.id'
CREATE TABLE
test=# \ds myserial_id_seq               List of relations Schema |      Name       |   Type   |  Owner
--------+-----------------+----------+---------- public | myserial_id_seq | sequence | postgres
(1 row)

test=# drop table myserial;
DROP TABLE
test=# \ds myserial_id_seq
No matching relations found.

Maybe that's an argument that they ought to also move to the new schema when 
the dependency exists.

> Indexes, triggers (and constraints), toast tables etc. are related to 
> just one table so they can migrate together, I think.

I agree.

Joe




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

Предыдущее
От: Nicolai Tufar
Дата:
Сообщение: Patch to make Turks happy.
Следующее
От: Szima Gábor
Дата:
Сообщение: numeric to text (7.3)