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

From: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
To: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
Cc: Heikki Linnakangas <hlinnaka(at)iki(dot)fi>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, bz(at)mailinator(dot)com, PostgreSQL Bugs List <pgsql-bugs(at)postgresql(dot)org>
Subject: Re: BUG #13442: ISBN doesn't always roundtrip with text
Date: 2015-07-27 21:04:33
Message-ID: alpine.DEB.2.10.1507272252090.3538@sto
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2015-07-27 21:37:01 Re: BUG #13442: ISBN doesn't always roundtrip with text
Previous Message Andres Freund 2015-07-27 19:46:57 Re: Segfault in pg_stat_activity