Re: ALTER TABLE ... TO ... to change related names

Поиск
Список
Период
Сортировка
От Jonathan Gardner
Тема Re: ALTER TABLE ... TO ... to change related names
Дата
Msg-id 200308301026.29038.jgardner@jonathangardner.net
обсуждение исходный текст
Ответ на Re: ALTER TABLE ... TO ... to change related names  (Andrew Dunstan <andrew@dunslane.net>)
Список pgsql-hackers
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On Saturday 30 August 2003 09:06, Andrew Dunstan wrote:
> There is no guarantee that a given sequence is used only for one column
> in one table, as I understand it. So renaming it could screw you up
> badly.
>
> If we made 'serial-ness' first class, and hid the sequence completely
> from view, this would make more sense.
>

I'm just trying to make the following novice mistake less confusing:

CREATE TABLE test (id SERIAL PRIMARY KEY);
ALTER TABLE test TO old_test;
CREATE TABLE test (id SERIAL PRIMARY KEY);
- -> ERROR: Already a sequence with that name, already an index with that name

I don't think that hiding the sequence completely from the user is a good
idea. They may want to manipulate the sequence later. I like Tom's idea of
just telling people that this is what happens, and if they get too intimate
with the system tables and the sequences and indexes that are automatically
created, it's their own fault.

- --
Jonathan Gardner
jgardner@jonathangardner.net
Live Free, Use Linux!
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.1 (GNU/Linux)

iD8DBQE/UN5CWgwF3QvpWNwRAgr5AKCfEfqU4NqWO60+tc6x6zkrqY9EgwCgwD4X
F3Sns/QFfneuijSG8fT85K4=
=l5nJ
-----END PGP SIGNATURE-----



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

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: massive quotes?
Следующее
От: Jonathan Gardner
Дата:
Сообщение: Re: ALTER TABLE ... TO ... to change related names