public inbox for [email protected]  
help / color / mirror / Atom feed
Re: Changing a varchar(7) domain into text directly in pg_type
2+ messages / 2 participants
[nested] [flat]

* Re: Changing a varchar(7) domain into text directly in pg_type
@ 2025-05-28 14:21  Tom Lane <[email protected]>
  0 siblings, 1 reply; 2+ messages in thread

From: Tom Lane @ 2025-05-28 14:21 UTC (permalink / raw)
  To: Richard Zetterberg <[email protected]>; +Cc: Adrian Klaver <[email protected]>; [email protected]

Richard Zetterberg <[email protected]> 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






^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: Changing a varchar(7) domain into text directly in pg_type
@ 2025-05-30 07:17  Richard Zetterberg <[email protected]>
  parent: Tom Lane <[email protected]>
  0 siblings, 0 replies; 2+ messages in thread

From: Richard Zetterberg @ 2025-05-30 07:17 UTC (permalink / raw)
  To: Tom Lane <[email protected]>; [email protected]; +Cc: [email protected]

Ron, thanks for the feedback and for teaching me a new word (bog-standard).

Tom, thanks for the feedback and extra info about pg_depend. I've tested
simple queries on all of the tables and it seems to be fine. Hopefully
nothing will turn up when we start running the more advanced queries.
Either way, it will be easy to revert to previous backup, since the
database is only used for analysis on static data.


^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2025-05-30 07:17 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2025-05-28 14:21 Re: Changing a varchar(7) domain into text directly in pg_type Tom Lane <[email protected]>
2025-05-30 07:17 ` Richard Zetterberg <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox