postgres.git / summary / log / commit / refs

commit    ed5f57218f4f4a6de0ae3bd56c6ec63b751fdcdb
Author:   Tom Lane <tgl@sss.pgh.pa.us>
Date:     Fri Jan 29 09:28:03 2016 +0000

    Fix incorrect pattern-match processing in psql's \det command.
    
    listForeignTables' invocation of processSQLNamePattern did not match up
    with the other ones that handle potentially-schema-qualified names; it
    failed to make use of pg_table_is_visible() and also passed the name
    arguments in the wrong order.  Bug seems to have been aboriginal in commit
    0d692a0dc9f0e532.  It accidentally sort of worked as long as you didn't
    inquire too closely into the behavior, although the silliness was later
    exposed by inconsistencies in the test queries added by 59efda3e50ca4de6
    (which I probably should have questioned at the time, but didn't).
    
    Per bug #13899 from Reece Hart.  Patch by Reece Hart and Tom Lane.
    Back-patch to all affected branches.


src/bin/psql/describe.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index a38113ac104..7caa518ea9d 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3804,7 +3804,8 @@ listForeignTables(const char *pattern, bool verbose) appendPQExpBuffer(&buf, "\nAND n.oid = c.relnamespace\n"); processSQLNamePattern(pset.db, &buf, pattern, true, false, - NULL, "n.nspname", "c.relname", NULL); + "n.nspname", "c.relname", NULL, + "pg_catalog.pg_table_is_visible(c.oid)"); appendPQExpBuffer(&buf, "ORDER BY 1, 2;"); [parent: b043df093a35]