Skip to content

Commit db678ca

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 9bbfca8 commit db678ca

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/bin/psql/describe.c

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4143,7 +4143,8 @@ listForeignTables(const char *pattern, bool verbose)
41434143
"d.objoid = c.oid AND d.objsubid = 0\n");
41444144

41454145
processSQLNamePattern(pset.db, &buf, pattern, false, false,
4146-
NULL, "n.nspname", "c.relname", NULL);
4146+
"n.nspname", "c.relname", NULL,
4147+
"pg_catalog.pg_table_is_visible(c.oid)");
41474148

41484149
appendPQExpBuffer(&buf, "ORDER BY 1, 2;");
41494150

0 commit comments

Comments
 (0)