Re: BUG #13442: ISBN doesn't always roundtrip with text

Поиск
Список
Период
Сортировка
От Fabien COELHO
Тема Re: BUG #13442: ISBN doesn't always roundtrip with text
Дата
Msg-id alpine.DEB.2.10.1507272252090.3538@sto
обсуждение исходный текст
Ответ на Re: BUG #13442: ISBN doesn't always roundtrip with text  (Alvaro Herrera <alvherre@2ndquadrant.com>)
Ответы Re: BUG #13442: ISBN doesn't always roundtrip with text  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-bugs
> If I understand this correctly, you need to ALTER EXTENSION .. DROP
> (which removes the type from the extension), then drop the type, create
> it fresh, then ALTER EXTENSION ADD to put it back.

After some testing with that, I have a conundrum: I would like the update
to *fail* if the user actually uses the isbn type so as not to harm data.

However, when the script is at:

   DROP TYPE isbn;

It fails, because the isbn_in & out functions depends on it.
If you try:

   DROP FUNCTION isbn_in(cstring);

It fails, because the isbn type depends on it. Sure.

The usual exit strategy is:

   DROP TYPE isbn CASCADE;

Which works fine... but as a side effect silently remove ISBN columns that
may exist in user table. I do not think it is a good idea for an extension
update script to do that to a librarian:-)

Bar any idea around this issue, I think that an extension upgrade script
is really unadvisable, and the user should do a dump data, drop extension,
create extension, restore data.

--
Fabien.

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: Segfault in pg_stat_activity
Следующее
От: Tom Lane
Дата:
Сообщение: Re: BUG #13442: ISBN doesn't always roundtrip with text