Skip to content

Commit 5849b6e

Browse files
committed
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 0d692a0. 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 59efda3 (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.
1 parent 280d05c commit 5849b6e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/psql/describe.c

+2-1
Original file line numberDiff line numberDiff line change
@@ -4243,7 +4243,8 @@ listForeignTables(const char *pattern, bool verbose)
42434243
"d.objoid = c.oid AND d.objsubid = 0\n");
42444244

42454245
processSQLNamePattern(pset.db, &buf, pattern, false, false,
4246-
NULL, "n.nspname", "c.relname", NULL);
4246+
"n.nspname", "c.relname", NULL,
4247+
"pg_catalog.pg_table_is_visible(c.oid)");
42474248

42484249
appendPQExpBufferStr(&buf, "ORDER BY 1, 2;");
42494250

0 commit comments

Comments
 (0)