Re: Changing a varchar(7) domain into text directly in pg_type - Mailing list pgsql-general

From Tom Lane
Subject Re: Changing a varchar(7) domain into text directly in pg_type
Date
Msg-id 1452427.1748442061@sss.pgh.pa.us
Whole thread Raw
In response to Re: Changing a varchar(7) domain into text directly in pg_type  (Richard Zetterberg <richard.zetterberg@googlemail.com>)
List pgsql-general
Richard Zetterberg <richard.zetterberg@googlemail.com> writes:
> In my head, this change would be instant and postgres would carry on like
> nothing happened and that the domain always had the type `text`. Is this a
> fools errand? Or could it actually make sense in this situation?

Yeah, I think you can probably get away with this (especially since
you've already tested the effects in a throwaway database, IIUC).

The main thing people tend to forget when doing this sort of manual
catalog surgery is updating pg_depend and/or pg_shdepend.  But here
there's nothing to do.  Since both varchar and text are undroppable
built-in types, we don't bother to make dependencies on them.  And
you're not changing the domain's schema or owner, so its other
dependencies don't need to change.

            regards, tom lane



pgsql-general by date:

Previous
From: Ron Johnson
Date:
Subject: Re: Changing a varchar(7) domain into text directly in pg_type
Next
From: Richard Zetterberg
Date:
Subject: Re: Changing a varchar(7) domain into text directly in pg_type