Re: missing schema qualifications in psql

Lists: pgsql-hackers
From: Peter Eisentraut <peter_e(at)gmx(dot)net>
To: pgsql-hackers(at)postgresql(dot)org
Subject: missing schema qualifications in psql
Date: 2010-04-01 10:15:21
Message-ID: 1270116921.17667.4.camel@fsopti579.F-Secure.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

While psql is careful to schema-qualify all references to built-in
objects (pg_catalog.*), it completely neglects to do this for built-in
operators, which can lead to surprising misbehaviors when users have
created custom operators. Here is a patch to address that. It will
need a bit of testing.

pg_dump has similar problems, probably other components as well.

Attachment Content-Type Size
schema-qual.diff text/x-patch 69.5 KB

From: "Greg Sabino Mullane" <greg(at)turnstep(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Re: missing schema qualifications in psql
Date: 2010-04-01 13:43:15
Message-ID: 2d674ff92ac8a8ab6cc21e835fe0095c@biglumber.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


-----BEGIN PGP SIGNED MESSAGE-----
Hash: RIPEMD160

> While psql is careful to schema-qualify all references to built-in
> objects (pg_catalog.*), it completely neglects to do this for built-in
> operators, which can lead to surprising misbehaviors when users have
> created custom operators. Here is a patch to address that. It will
> need a bit of testing.

Er...wouldn't this only be a problem if someone creates custom operators
*and* forces pg_catalog to the end of the search_path? Wouldn't an easier
solution be to prepend pg_catalog to the search_path when doing backslash
commands?

- --
Greg Sabino Mullane greg(at)turnstep(dot)com
PGP Key: 0x14964AC8 201004010941
http://biglumber.com/x/web?pk=2529DF6AB8F79407E94445B4BC9B906714964AC8
-----BEGIN PGP SIGNATURE-----

iEYEAREDAAYFAku0oqQACgkQvJuQZxSWSsiJmACghUKR/i+uyJ2n+beuAid4w432
s0oAnArOf1npuMF/7QJ87ZVmSYMlJTRp
=/+yd
-----END PGP SIGNATURE-----


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Peter Eisentraut <peter_e(at)gmx(dot)net>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: missing schema qualifications in psql
Date: 2010-04-01 13:59:38
Message-ID: 15211.1270130378@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
> While psql is careful to schema-qualify all references to built-in
> objects (pg_catalog.*), it completely neglects to do this for built-in
> operators,

That's intentional because of the utter lack of readability that
results if you try to use OPERATOR() everywhere ...

regards, tom lane


From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Peter Eisentraut <peter_e(at)gmx(dot)net>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: missing schema qualifications in psql
Date: 2010-04-01 15:19:26
Message-ID: m2x603c8f071004010819pb96c4274rcfb8ac126d04defd@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Thu, Apr 1, 2010 at 9:59 AM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> Peter Eisentraut <peter_e(at)gmx(dot)net> writes:
>> While psql is careful to schema-qualify all references to built-in
>> objects (pg_catalog.*), it completely neglects to do this for built-in
>> operators,
>
> That's intentional because of the utter lack of readability that
> results if you try to use OPERATOR() everywhere ...

I was mulling over in my head the possibility that the date on which
this patch was posted was deliberate...

...Robert