Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit56251f3

Browse files
committed
Fix incorrect pattern-match processing in psql's \det command.
listForeignTables' invocation of processSQLNamePattern did not match upwith the other ones that handle potentially-schema-qualified names; itfailed to make use of pg_table_is_visible() and also passed the namearguments in the wrong order. Bug seems to have been aboriginal in commit0d692a0. It accidentally sort of worked as long as you didn'tinquire too closely into the behavior, although the silliness was laterexposed by inconsistencies in the test queries added by59efda3(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 parentcb89a3a commit56251f3

File tree

3 files changed

+12
-11
lines changed

3 files changed

+12
-11
lines changed

‎contrib/postgres_fdw/expected/postgres_fdw.out

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -3463,7 +3463,7 @@ CREATE TABLE import_source."x 5" (c1 float8);
34633463
ALTER TABLE import_source."x 5" DROP COLUMN c1;
34643464
CREATE SCHEMA import_dest1;
34653465
IMPORT FOREIGN SCHEMA import_source FROM SERVER loopback INTO import_dest1;
3466-
\det+ import_dest1
3466+
\det+ import_dest1.*
34673467
List of foreign tables
34683468
Schema | Table | Server | FDW Options | Description
34693469
--------------+-------+----------+-------------------------------------------------+-------------
@@ -3519,7 +3519,7 @@ FDW Options: (schema_name 'import_source', table_name 'x 5')
35193519
CREATE SCHEMA import_dest2;
35203520
IMPORT FOREIGN SCHEMA import_source FROM SERVER loopback INTO import_dest2
35213521
OPTIONS (import_default 'true');
3522-
\det+ import_dest2
3522+
\det+ import_dest2.*
35233523
List of foreign tables
35243524
Schema | Table | Server | FDW Options | Description
35253525
--------------+-------+----------+-------------------------------------------------+-------------
@@ -3574,7 +3574,7 @@ FDW Options: (schema_name 'import_source', table_name 'x 5')
35743574
CREATE SCHEMA import_dest3;
35753575
IMPORT FOREIGN SCHEMA import_source FROM SERVER loopback INTO import_dest3
35763576
OPTIONS (import_collate 'false', import_not_null 'false');
3577-
\det+ import_dest3
3577+
\det+ import_dest3.*
35783578
List of foreign tables
35793579
Schema | Table | Server | FDW Options | Description
35803580
--------------+-------+----------+-------------------------------------------------+-------------
@@ -3630,7 +3630,7 @@ FDW Options: (schema_name 'import_source', table_name 'x 5')
36303630
CREATE SCHEMA import_dest4;
36313631
IMPORT FOREIGN SCHEMA import_source LIMIT TO (t1, nonesuch)
36323632
FROM SERVER loopback INTO import_dest4;
3633-
\det+ import_dest4
3633+
\det+ import_dest4.*
36343634
List of foreign tables
36353635
Schema | Table | Server | FDW Options | Description
36363636
--------------+-------+----------+------------------------------------------------+-------------
@@ -3639,7 +3639,7 @@ IMPORT FOREIGN SCHEMA import_source LIMIT TO (t1, nonesuch)
36393639

36403640
IMPORT FOREIGN SCHEMA import_source EXCEPT (t1, "x 4", nonesuch)
36413641
FROM SERVER loopback INTO import_dest4;
3642-
\det+ import_dest4
3642+
\det+ import_dest4.*
36433643
List of foreign tables
36443644
Schema | Table | Server | FDW Options | Description
36453645
--------------+-------+----------+-------------------------------------------------+-------------

‎contrib/postgres_fdw/sql/postgres_fdw.sql

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -798,29 +798,29 @@ ALTER TABLE import_source."x 5" DROP COLUMN c1;
798798

799799
CREATESCHEMAimport_dest1;
800800
IMPORT FOREIGN SCHEMA import_sourceFROM SERVER loopback INTO import_dest1;
801-
\det+ import_dest1
801+
\det+ import_dest1.*
802802
\d import_dest1.*
803803

804804
-- Options
805805
CREATESCHEMAimport_dest2;
806806
IMPORT FOREIGN SCHEMA import_sourceFROM SERVER loopback INTO import_dest2
807807
OPTIONS (import_default'true');
808-
\det+ import_dest2
808+
\det+ import_dest2.*
809809
\d import_dest2.*
810810
CREATESCHEMAimport_dest3;
811811
IMPORT FOREIGN SCHEMA import_sourceFROM SERVER loopback INTO import_dest3
812812
OPTIONS (import_collate'false', import_not_null'false');
813-
\det+ import_dest3
813+
\det+ import_dest3.*
814814
\d import_dest3.*
815815

816816
-- Check LIMIT TO and EXCEPT
817817
CREATESCHEMAimport_dest4;
818818
IMPORT FOREIGN SCHEMA import_sourceLIMIT TO (t1, nonesuch)
819819
FROM SERVER loopback INTO import_dest4;
820-
\det+ import_dest4
820+
\det+ import_dest4.*
821821
IMPORT FOREIGN SCHEMA import_source EXCEPT (t1,"x 4", nonesuch)
822822
FROM SERVER loopback INTO import_dest4;
823-
\det+ import_dest4
823+
\det+ import_dest4.*
824824

825825
-- Assorted error cases
826826
IMPORT FOREIGN SCHEMA import_sourceFROM SERVER loopback INTO import_dest4;

‎src/bin/psql/describe.c

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

44144414
processSQLNamePattern(pset.db,&buf,pattern, false, false,
4415-
NULL,"n.nspname","c.relname",NULL);
4415+
"n.nspname","c.relname",NULL,
4416+
"pg_catalog.pg_table_is_visible(c.oid)");
44164417

44174418
appendPQExpBufferStr(&buf,"ORDER BY 1, 2;");
44184419

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp