Fix underqualified cast-target type names in pg_dump and psql queries.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 Oct 2017 17:40:23 +0000 (13:40 -0400)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 31 Oct 2017 17:40:23 +0000 (13:40 -0400)
commit080351466c5a669bf35a323bdec9e296330a5dbb
tree7cc76b74204ea0df8365e212cac738dc0b601dd1
parentee4673ac071f8352c41cc673299b7ec695f079ff
Fix underqualified cast-target type names in pg_dump and psql queries.

Queries running with some non-pg_catalog schema frontmost in their search
path need to be careful to schema-qualify type names that should be sought
in pg_catalog.  Vitaly Burovoy reported an oversight of this sort in
pg_dump's dumpSequence, and grepping detected another one in psql's
describeOneTableDetails, both introduced by sequence-related changes in
v10.  In pg_dump, we can fix things by removing the cast altogether, since
it doesn't really matter what data types are reported for these query
result columns.  Likewise in psql, the query seemed to be working unduly
hard to get a result that's guaranteed to be exactly 'bigint'.

I also changed a couple of occurrences of "::char" similarly.  These are
not bugs, since "char" is a typename keyword and not subject to search_path
rules, but it seems better to use uniform style.

Vitaly Burovoy and Tom Lane

Discussion: https://postgr.es/m/CAKOSWN=ds66zLw2SqkLTM8wbXFgDbc_OdkmT3dJfPT2mE5kipA@mail.gmail.com
src/bin/pg_dump/pg_dump.c
src/bin/psql/describe.c