Unqualified pg_catalog casts in pg_dump

Started by Daniel Gustafssonabout 6 years ago4 messageshackers
Jump to latest
#1Daniel Gustafsson
daniel@yesql.se

When looking at something different, I happened to notice that pg_dump is a bit
inconsistent in how it qualifies casts to pg_catalog entities like regclass and
oid. Most casts are qualified, but not all. Even though it functionally is
the same, being consistent is a good thing IMO and I can't see a reason not to,
so the attached patch adds qualifications (the unqualified regclass cast in the
TAP test left on purpose).

cheers ./daniel

Attachments:

pg_dump_casts.patchapplication/octet-stream; name=pg_dump_casts.patch; x-unix-mode=0644Download+50-51
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Daniel Gustafsson (#1)
Re: Unqualified pg_catalog casts in pg_dump

Daniel Gustafsson <daniel@yesql.se> writes:

When looking at something different, I happened to notice that pg_dump is a bit
inconsistent in how it qualifies casts to pg_catalog entities like regclass and
oid. Most casts are qualified, but not all. Even though it functionally is
the same, being consistent is a good thing IMO and I can't see a reason not to,
so the attached patch adds qualifications (the unqualified regclass cast in the
TAP test left on purpose).

While this used to be important before we made pg_dump force a minimal
search_path, I'm not sure that there's any point in being picky about
it anymore. (psql's describe.c is a different story though.)

regards, tom lane

#3Daniel Gustafsson
daniel@yesql.se
In reply to: Tom Lane (#2)
Re: Unqualified pg_catalog casts in pg_dump

On 23 Mar 2020, at 17:54, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Daniel Gustafsson <daniel@yesql.se> writes:

When looking at something different, I happened to notice that pg_dump is a bit
inconsistent in how it qualifies casts to pg_catalog entities like regclass and
oid. Most casts are qualified, but not all. Even though it functionally is
the same, being consistent is a good thing IMO and I can't see a reason not to,
so the attached patch adds qualifications (the unqualified regclass cast in the
TAP test left on purpose).

While this used to be important before we made pg_dump force a minimal
search_path, I'm not sure that there's any point in being picky about
it anymore. (psql's describe.c is a different story though.)

Correct, there is no functional importance with this. IMO the value is in
readability and grep-ability.

cheers ./daniel

#4Michael Paquier
michael@paquier.xyz
In reply to: Daniel Gustafsson (#3)
Re: Unqualified pg_catalog casts in pg_dump

On Mon, Mar 23, 2020 at 05:57:37PM +0100, Daniel Gustafsson wrote:

Correct, there is no functional importance with this. IMO the value is in
readability and grep-ability.

This may cause extra conflicts when back-patching.
--
Michael