diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index 4a38d2afeb..db97df13c4 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1098,7 +1098,7 @@ testdb=> specified, only those servers whose name matches the pattern are listed. If the form \des+ is used, a full description of each server is shown, including the - server's ACL, type, version, and options. + server's ACL, type, version, options, and description. @@ -1112,7 +1112,8 @@ testdb=> If pattern is specified, only entries whose table name or schema name matches the pattern are listed. If the form \det+ - is used, generic options are also displayed. + is used, generic options and the foreign table description + are also displayed. @@ -1150,8 +1151,8 @@ testdb=> If pattern is specified, only those foreign-data wrappers whose name matches the pattern are listed. If the form \dew+ - is used, the ACL and options of the foreign-data wrapper are - also shown. + is used, the ACL, options, and description of the foreign-data + wrapper are also shown. diff --git a/src/bin/psql/describe.c b/src/bin/psql/describe.c index 5587721ea8..f08f917501 100644 --- a/src/bin/psql/describe.c +++ b/src/bin/psql/describe.c @@ -3680,16 +3680,16 @@ listForeignDataWrappers(const char *pattern, bool verbose) initPQExpBuffer(&buf); printfPQExpBuffer(&buf, - "SELECT fdwname AS \"%s\",\n" - " pg_catalog.pg_get_userbyid(fdwowner) AS \"%s\",\n", + "SELECT fdw.fdwname AS \"%s\",\n" + " pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n", gettext_noop("Name"), gettext_noop("Owner")); if (pset.sversion >= 90100) appendPQExpBuffer(&buf, - " fdwhandler::pg_catalog.regproc AS \"%s\",\n", + " fdw.fdwhandler::pg_catalog.regproc AS \"%s\",\n", gettext_noop("Handler")); appendPQExpBuffer(&buf, - " fdwvalidator::pg_catalog.regproc AS \"%s\"", + " fdw.fdwvalidator::pg_catalog.regproc AS \"%s\"", gettext_noop("Validator")); if (verbose) @@ -3699,9 +3699,20 @@ listForeignDataWrappers(const char *pattern, bool verbose) appendPQExpBuffer(&buf, ",\n fdwoptions AS \"%s\"", gettext_noop("Options")); + + if (pset.sversion >= 90100) + appendPQExpBuffer(&buf, + ",\n d.description AS \"%s\" ", + gettext_noop("Description")); } - appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_foreign_data_wrapper\n"); + appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_foreign_data_wrapper fdw\n"); + + if (verbose && pset.sversion >= 90100) + appendPQExpBuffer(&buf, + "LEFT JOIN pg_catalog.pg_description d\n" + " ON d.classoid = fdw.tableoid " + "AND d.objoid = fdw.oid AND d.objsubid = 0\n"); processSQLNamePattern(pset.db, &buf, pattern, false, false, NULL, "fdwname", NULL, NULL); @@ -3759,16 +3770,24 @@ listForeignServers(const char *pattern, bool verbose) ",\n" " s.srvtype AS \"%s\",\n" " s.srvversion AS \"%s\",\n" - " s.srvoptions AS \"%s\"", + " s.srvoptions AS \"%s\",\n" + " d.description AS \"%s\"", gettext_noop("Type"), gettext_noop("Version"), - gettext_noop("Options")); + gettext_noop("Options"), + gettext_noop("Description")); } appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_foreign_server s\n" " JOIN pg_catalog.pg_foreign_data_wrapper f ON f.oid=s.srvfdw\n"); + if (verbose) + appendPQExpBuffer(&buf, + "LEFT JOIN pg_description d\n " + "ON d.classoid = s.tableoid AND d.objoid = s.oid " + "AND d.objsubid = 0\n"); + processSQLNamePattern(pset.db, &buf, pattern, false, false, NULL, "s.srvname", NULL, NULL); @@ -3872,18 +3891,26 @@ listForeignTables(const char *pattern, bool verbose) if (verbose) appendPQExpBuffer(&buf, - ",\n ft.ftoptions AS \"%s\"", - gettext_noop("Options")); + ",\n ft.ftoptions AS \"%s\",\n" + " d.description AS \"%s\"", + gettext_noop("Options"), + gettext_noop("Description")); - appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_foreign_table ft,"); - appendPQExpBuffer(&buf, "\n pg_catalog.pg_class c,"); - appendPQExpBuffer(&buf, "\n pg_catalog.pg_namespace n,"); - appendPQExpBuffer(&buf, "\n pg_catalog.pg_foreign_server s\n"); - appendPQExpBuffer(&buf, "\nWHERE c.oid = ft.ftrelid"); - appendPQExpBuffer(&buf, "\nAND s.oid = ft.ftserver\n"); - appendPQExpBuffer(&buf, "\nAND n.oid = c.relnamespace\n"); + appendPQExpBuffer(&buf, + "\nFROM pg_catalog.pg_foreign_table ft\n" + " INNER JOIN pg_catalog.pg_class c" + " ON c.oid = ft.ftrelid\n" + " INNER JOIN pg_catalog.pg_namespace n" + " ON n.oid = c.relnamespace\n" + " INNER JOIN pg_catalog.pg_foreign_server s" + " ON s.oid = ft.ftserver\n"); + if (verbose) + appendPQExpBuffer(&buf, + " LEFT JOIN pg_catalog.pg_description d\n" + " ON d.classoid = c.tableoid AND " + "d.objoid = c.oid AND d.objsubid = 0\n"); - processSQLNamePattern(pset.db, &buf, pattern, true, false, + processSQLNamePattern(pset.db, &buf, pattern, false, false, NULL, "n.nspname", "c.relname", NULL); appendPQExpBuffer(&buf, "ORDER BY 1, 2;"); diff --git a/src/test/regress/expected/foreign_data.out b/src/test/regress/expected/foreign_data.out index 45292b5fde..ef13f2729f 100644 --- a/src/test/regress/expected/foreign_data.out +++ b/src/test/regress/expected/foreign_data.out @@ -52,12 +52,12 @@ ERROR: foreign-data wrapper "foo" already exists DROP FOREIGN DATA WRAPPER foo; CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1'); \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+------------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | {testing=1} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+-------------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | {testing=1} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) DROP FOREIGN DATA WRAPPER foo; @@ -65,12 +65,12 @@ CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1', testing '2'); -- ERROR ERROR: option "testing" provided more than once CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1', another '2'); \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+----------------------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | {testing=1,another=2} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+-----------------------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | {testing=1,another=2} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) DROP FOREIGN DATA WRAPPER foo; @@ -81,12 +81,12 @@ HINT: Must be superuser to create a foreign-data wrapper. RESET ROLE; CREATE FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator; \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+--------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | postgresql_fdw_validator | | - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+---------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | postgresql_fdw_validator | | | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) -- ALTER FOREIGN DATA WRAPPER @@ -98,12 +98,12 @@ ALTER FOREIGN DATA WRAPPER foo VALIDATOR bar; -- ERROR ERROR: function bar(text[], oid) does not exist ALTER FOREIGN DATA WRAPPER foo NO VALIDATOR; \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+--------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+---------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '1', b '2'); @@ -113,34 +113,34 @@ ALTER FOREIGN DATA WRAPPER foo OPTIONS (DROP c); -- ERROR ERROR: option "c" not found ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD x '1', DROP x); \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+----------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | {a=1,b=2} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+-----------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | {a=1,b=2} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) ALTER FOREIGN DATA WRAPPER foo OPTIONS (DROP a, SET b '3', ADD c '4'); \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+----------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | {b=3,c=4} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+-----------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | {b=3,c=4} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '2'); ALTER FOREIGN DATA WRAPPER foo OPTIONS (b '4'); -- ERROR ERROR: option "b" provided more than once \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+--------------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | {b=3,c=4,a=2} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+---------------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | {b=3,c=4,a=2} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) SET ROLE regress_test_role; @@ -150,12 +150,12 @@ HINT: Must be superuser to alter a foreign-data wrapper. SET ROLE regress_test_role_super; ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD d '5'); \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+------------------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | {b=3,c=4,a=2,d=5} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+-------------------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | {b=3,c=4,a=2,d=5} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) ALTER FOREIGN DATA WRAPPER foo OWNER TO regress_test_role; -- ERROR @@ -169,12 +169,12 @@ ERROR: permission denied to alter foreign-data wrapper "foo" HINT: Must be superuser to alter a foreign-data wrapper. RESET ROLE; \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------------+---------+--------------------------+-------------------+------------------- - dummy | foreign_data_user | - | - | | - foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------------+---------+--------------------------+-------------------+-------------------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) -- DROP FOREIGN DATA WRAPPER @@ -183,12 +183,12 @@ ERROR: foreign-data wrapper "nonexistent" does not exist DROP FOREIGN DATA WRAPPER IF EXISTS nonexistent; NOTICE: foreign-data wrapper "nonexistent" does not exist, skipping \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------------+---------+--------------------------+-------------------+------------------- - dummy | foreign_data_user | - | - | | - foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5} - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------------+---------+--------------------------+-------------------+-------------------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5} | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) DROP ROLE regress_test_role_super; -- ERROR @@ -203,11 +203,11 @@ ALTER ROLE regress_test_role_super SUPERUSER; DROP FOREIGN DATA WRAPPER foo; DROP ROLE regress_test_role_super; \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+--------- - dummy | foreign_data_user | - | - | | - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+---------+------------- + dummy | foreign_data_user | - | - | | | useless + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (2 rows) CREATE FOREIGN DATA WRAPPER foo; @@ -215,19 +215,19 @@ CREATE SERVER s1 FOREIGN DATA WRAPPER foo; COMMENT ON SERVER s1 IS 'foreign server'; CREATE USER MAPPING FOR current_user SERVER s1; \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+--------- - dummy | foreign_data_user | - | - | | - foo | foreign_data_user | - | - | | - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+---------+------------- + dummy | foreign_data_user | - | - | | | useless + foo | foreign_data_user | - | - | | | + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (3 rows) \des+ - List of foreign servers - Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options -------+-------------------+----------------------+-------------------+------+---------+--------- - s1 | foreign_data_user | foo | | | | + List of foreign servers + Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description +------+-------------------+----------------------+-------------------+------+---------+---------+---------------- + s1 | foreign_data_user | foo | | | | | foreign server (1 row) \deu+ @@ -252,17 +252,17 @@ NOTICE: drop cascades to 2 other objects DETAIL: drop cascades to server s1 drop cascades to user mapping for foreign_data_user \dew+ - List of foreign-data wrappers - Name | Owner | Handler | Validator | Access privileges | Options -------------+-------------------+---------+--------------------------+-------------------+--------- - dummy | foreign_data_user | - | - | | - postgresql | foreign_data_user | - | postgresql_fdw_validator | | + List of foreign-data wrappers + Name | Owner | Handler | Validator | Access privileges | Options | Description +------------+-------------------+---------+--------------------------+-------------------+---------+------------- + dummy | foreign_data_user | - | - | | | useless + postgresql | foreign_data_user | - | postgresql_fdw_validator | | | (2 rows) \des+ - List of foreign servers - Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options -------+-------+----------------------+-------------------+------+---------+--------- + List of foreign servers + Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description +------+-------+----------------------+-------------------+------+---------+---------+------------- (0 rows) \deu+ @@ -289,17 +289,17 @@ ERROR: invalid option "foo" HINT: Valid options in this context are: authtype, service, connect_timeout, dbname, host, hostaddr, port, tty, options, requiressl, sslmode, gsslib CREATE SERVER s8 FOREIGN DATA WRAPPER postgresql OPTIONS (host 'localhost', dbname 's8db'); \des+ - List of foreign servers - Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options -------+-------------------+----------------------+-------------------+--------+---------+------------------------------ - s1 | foreign_data_user | foo | | | | - s2 | foreign_data_user | foo | | | | {host=a,dbname=b} - s3 | foreign_data_user | foo | | oracle | | - s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} - s5 | foreign_data_user | foo | | | 15.0 | - s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} - s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} - s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} + List of foreign servers + Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description +------+-------------------+----------------------+-------------------+--------+---------+------------------------------+------------- + s1 | foreign_data_user | foo | | | | | + s2 | foreign_data_user | foo | | | | {host=a,dbname=b} | + s3 | foreign_data_user | foo | | oracle | | | + s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} | + s5 | foreign_data_user | foo | | | 15.0 | | + s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} | + s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} | + s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} | (8 rows) SET ROLE regress_test_role; @@ -311,18 +311,18 @@ SET ROLE regress_test_role; CREATE SERVER t1 FOREIGN DATA WRAPPER foo; RESET ROLE; \des+ - List of foreign servers - Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options -------+-------------------+----------------------+-------------------+--------+---------+------------------------------ - s1 | foreign_data_user | foo | | | | - s2 | foreign_data_user | foo | | | | {host=a,dbname=b} - s3 | foreign_data_user | foo | | oracle | | - s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} - s5 | foreign_data_user | foo | | | 15.0 | - s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} - s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} - s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} - t1 | regress_test_role | foo | | | | + List of foreign servers + Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description +------+-------------------+----------------------+-------------------+--------+---------+------------------------------+------------- + s1 | foreign_data_user | foo | | | | | + s2 | foreign_data_user | foo | | | | {host=a,dbname=b} | + s3 | foreign_data_user | foo | | oracle | | | + s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} | + s5 | foreign_data_user | foo | | | 15.0 | | + s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} | + s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} | + s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} | + t1 | regress_test_role | foo | | | | | (9 rows) REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM regress_test_role; @@ -335,19 +335,19 @@ GRANT regress_test_indirect TO regress_test_role; SET ROLE regress_test_role; CREATE SERVER t2 FOREIGN DATA WRAPPER foo; \des+ - List of foreign servers - Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options -------+-------------------+----------------------+-------------------+--------+---------+------------------------------ - s1 | foreign_data_user | foo | | | | - s2 | foreign_data_user | foo | | | | {host=a,dbname=b} - s3 | foreign_data_user | foo | | oracle | | - s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} - s5 | foreign_data_user | foo | | | 15.0 | - s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} - s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} - s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} - t1 | regress_test_role | foo | | | | - t2 | regress_test_role | foo | | | | + List of foreign servers + Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description +------+-------------------+----------------------+-------------------+--------+---------+------------------------------+------------- + s1 | foreign_data_user | foo | | | | | + s2 | foreign_data_user | foo | | | | {host=a,dbname=b} | + s3 | foreign_data_user | foo | | oracle | | | + s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} | + s5 | foreign_data_user | foo | | | 15.0 | | + s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} | + s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} | + s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} | + t1 | regress_test_role | foo | | | | | + t2 | regress_test_role | foo | | | | | (10 rows) RESET ROLE; @@ -365,21 +365,21 @@ ALTER SERVER s3 OPTIONS (tnsname 'orcl', port '1521'); GRANT USAGE ON FOREIGN SERVER s1 TO regress_test_role; GRANT USAGE ON FOREIGN SERVER s6 TO regress_test_role2 WITH GRANT OPTION; \des+ - List of foreign servers - Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options -------+-------------------+----------------------+-----------------------------------------+--------+---------+------------------------------ - s1 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 1.0 | {servername=s1} - | | | regress_test_role=U/foreign_data_user | | | - s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b} - s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521} - s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} - s5 | foreign_data_user | foo | | | 15.0 | - s6 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 16.0 | {host=a,dbname=b} - | | | regress_test_role2=U*/foreign_data_user | | | - s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} - s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} - t1 | regress_test_role | foo | | | | - t2 | regress_test_role | foo | | | | + List of foreign servers + Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description +------+-------------------+----------------------+-----------------------------------------+--------+---------+------------------------------+------------- + s1 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 1.0 | {servername=s1} | + | | | regress_test_role=U/foreign_data_user | | | | + s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b} | + s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521} | + s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} | + s5 | foreign_data_user | foo | | | 15.0 | | + s6 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 16.0 | {host=a,dbname=b} | + | | | regress_test_role2=U*/foreign_data_user | | | | + s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} | + s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} | + t1 | regress_test_role | foo | | | | | + t2 | regress_test_role | foo | | | | | (10 rows) SET ROLE regress_test_role; @@ -416,21 +416,21 @@ ERROR: role "regress_test_indirect" cannot be dropped because some objects depe DETAIL: owner of server s1 privileges for foreign-data wrapper foo \des+ - List of foreign servers - Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options -------+-----------------------+----------------------+-----------------------------------------+--------+---------+--------------------------------- - s1 | regress_test_indirect | foo | foreign_data_user=U/foreign_data_user +| | 1.1 | {servername=s1} - | | | regress_test_role=U/foreign_data_user | | | - s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b} - s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521} - s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} - s5 | foreign_data_user | foo | | | 15.0 | - s6 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 16.0 | {host=a,dbname=b} - | | | regress_test_role2=U*/foreign_data_user | | | - s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} - s8 | foreign_data_user | postgresql | | | | {dbname=db1,connect_timeout=30} - t1 | regress_test_role | foo | | | | - t2 | regress_test_role | foo | | | | + List of foreign servers + Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description +------+-----------------------+----------------------+-----------------------------------------+--------+---------+---------------------------------+------------- + s1 | regress_test_indirect | foo | foreign_data_user=U/foreign_data_user +| | 1.1 | {servername=s1} | + | | | regress_test_role=U/foreign_data_user | | | | + s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b} | + s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521} | + s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} | + s5 | foreign_data_user | foo | | | 15.0 | | + s6 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 16.0 | {host=a,dbname=b} | + | | | regress_test_role2=U*/foreign_data_user | | | | + s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} | + s8 | foreign_data_user | postgresql | | | | {dbname=db1,connect_timeout=30} | + t1 | regress_test_role | foo | | | | | + t2 | regress_test_role | foo | | | | | (10 rows) -- DROP SERVER @@ -663,10 +663,10 @@ Server: sc Has OIDs: no \det+ - List of foreign tables - Schema | Table | Server | Options ---------+-------+--------+---------------------------- - public | ft1 | sc | {"delimiter=,","quote=\""} + List of foreign tables + Schema | Table | Server | Options | Description +--------+-------+--------+----------------------------+------------- + public | ft1 | sc | {"delimiter=,","quote=\""} | ft1 (1 row) CREATE INDEX id_ft1_c2 ON ft1 (c2); -- ERROR