mirror of https://github.com/postgres/postgres
Teach psql to display the comments on SQL/MED objects in verbose mode.
The relevant backslash commands already exist, so we're just adding an additional column. With this commit, all objects that have psql backslash commands and accept comments should now display those comments at least in verbose mode. Josh Kupershmidt, with doc additions by me.
This commit is contained in:
parent
c9ac00e6ec
commit
d82a9d2a60
|
@ -1098,7 +1098,7 @@ testdb=>
|
||||||
specified, only those servers whose name matches the pattern
|
specified, only those servers whose name matches the pattern
|
||||||
are listed. If the form <literal>\des+</literal> is used, a
|
are listed. If the form <literal>\des+</literal> is used, a
|
||||||
full description of each server is shown, including the
|
full description of each server is shown, including the
|
||||||
server's ACL, type, version, and options.
|
server's ACL, type, version, options, and description.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -1112,7 +1112,8 @@ testdb=>
|
||||||
If <replaceable class="parameter">pattern</replaceable> is
|
If <replaceable class="parameter">pattern</replaceable> is
|
||||||
specified, only entries whose table name or schema name matches
|
specified, only entries whose table name or schema name matches
|
||||||
the pattern are listed. If the form <literal>\det+</literal>
|
the pattern are listed. If the form <literal>\det+</literal>
|
||||||
is used, generic options are also displayed.
|
is used, generic options and the foreign table description
|
||||||
|
are also displayed.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -1150,8 +1151,8 @@ testdb=>
|
||||||
If <replaceable class="parameter">pattern</replaceable> is
|
If <replaceable class="parameter">pattern</replaceable> is
|
||||||
specified, only those foreign-data wrappers whose name matches
|
specified, only those foreign-data wrappers whose name matches
|
||||||
the pattern are listed. If the form <literal>\dew+</literal>
|
the pattern are listed. If the form <literal>\dew+</literal>
|
||||||
is used, the ACL and options of the foreign-data wrapper are
|
is used, the ACL, options, and description of the foreign-data
|
||||||
also shown.
|
wrapper are also shown.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
|
|
@ -3680,16 +3680,16 @@ listForeignDataWrappers(const char *pattern, bool verbose)
|
||||||
|
|
||||||
initPQExpBuffer(&buf);
|
initPQExpBuffer(&buf);
|
||||||
printfPQExpBuffer(&buf,
|
printfPQExpBuffer(&buf,
|
||||||
"SELECT fdwname AS \"%s\",\n"
|
"SELECT fdw.fdwname AS \"%s\",\n"
|
||||||
" pg_catalog.pg_get_userbyid(fdwowner) AS \"%s\",\n",
|
" pg_catalog.pg_get_userbyid(fdw.fdwowner) AS \"%s\",\n",
|
||||||
gettext_noop("Name"),
|
gettext_noop("Name"),
|
||||||
gettext_noop("Owner"));
|
gettext_noop("Owner"));
|
||||||
if (pset.sversion >= 90100)
|
if (pset.sversion >= 90100)
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBuffer(&buf,
|
||||||
" fdwhandler::pg_catalog.regproc AS \"%s\",\n",
|
" fdw.fdwhandler::pg_catalog.regproc AS \"%s\",\n",
|
||||||
gettext_noop("Handler"));
|
gettext_noop("Handler"));
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBuffer(&buf,
|
||||||
" fdwvalidator::pg_catalog.regproc AS \"%s\"",
|
" fdw.fdwvalidator::pg_catalog.regproc AS \"%s\"",
|
||||||
gettext_noop("Validator"));
|
gettext_noop("Validator"));
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
|
@ -3699,9 +3699,20 @@ listForeignDataWrappers(const char *pattern, bool verbose)
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBuffer(&buf,
|
||||||
",\n fdwoptions AS \"%s\"",
|
",\n fdwoptions AS \"%s\"",
|
||||||
gettext_noop("Options"));
|
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,
|
processSQLNamePattern(pset.db, &buf, pattern, false, false,
|
||||||
NULL, "fdwname", NULL, NULL);
|
NULL, "fdwname", NULL, NULL);
|
||||||
|
@ -3759,16 +3770,24 @@ listForeignServers(const char *pattern, bool verbose)
|
||||||
",\n"
|
",\n"
|
||||||
" s.srvtype AS \"%s\",\n"
|
" s.srvtype AS \"%s\",\n"
|
||||||
" s.srvversion 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("Type"),
|
||||||
gettext_noop("Version"),
|
gettext_noop("Version"),
|
||||||
gettext_noop("Options"));
|
gettext_noop("Options"),
|
||||||
|
gettext_noop("Description"));
|
||||||
}
|
}
|
||||||
|
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBuffer(&buf,
|
||||||
"\nFROM pg_catalog.pg_foreign_server s\n"
|
"\nFROM pg_catalog.pg_foreign_server s\n"
|
||||||
" JOIN pg_catalog.pg_foreign_data_wrapper f ON f.oid=s.srvfdw\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,
|
processSQLNamePattern(pset.db, &buf, pattern, false, false,
|
||||||
NULL, "s.srvname", NULL, NULL);
|
NULL, "s.srvname", NULL, NULL);
|
||||||
|
|
||||||
|
@ -3872,18 +3891,26 @@ listForeignTables(const char *pattern, bool verbose)
|
||||||
|
|
||||||
if (verbose)
|
if (verbose)
|
||||||
appendPQExpBuffer(&buf,
|
appendPQExpBuffer(&buf,
|
||||||
",\n ft.ftoptions AS \"%s\"",
|
",\n ft.ftoptions AS \"%s\",\n"
|
||||||
gettext_noop("Options"));
|
" d.description AS \"%s\"",
|
||||||
|
gettext_noop("Options"),
|
||||||
|
gettext_noop("Description"));
|
||||||
|
|
||||||
appendPQExpBuffer(&buf, "\nFROM pg_catalog.pg_foreign_table ft,");
|
appendPQExpBuffer(&buf,
|
||||||
appendPQExpBuffer(&buf, "\n pg_catalog.pg_class c,");
|
"\nFROM pg_catalog.pg_foreign_table ft\n"
|
||||||
appendPQExpBuffer(&buf, "\n pg_catalog.pg_namespace n,");
|
" INNER JOIN pg_catalog.pg_class c"
|
||||||
appendPQExpBuffer(&buf, "\n pg_catalog.pg_foreign_server s\n");
|
" ON c.oid = ft.ftrelid\n"
|
||||||
appendPQExpBuffer(&buf, "\nWHERE c.oid = ft.ftrelid");
|
" INNER JOIN pg_catalog.pg_namespace n"
|
||||||
appendPQExpBuffer(&buf, "\nAND s.oid = ft.ftserver\n");
|
" ON n.oid = c.relnamespace\n"
|
||||||
appendPQExpBuffer(&buf, "\nAND 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);
|
NULL, "n.nspname", "c.relname", NULL);
|
||||||
|
|
||||||
appendPQExpBuffer(&buf, "ORDER BY 1, 2;");
|
appendPQExpBuffer(&buf, "ORDER BY 1, 2;");
|
||||||
|
|
|
@ -52,12 +52,12 @@ ERROR: foreign-data wrapper "foo" already exists
|
||||||
DROP FOREIGN DATA WRAPPER foo;
|
DROP FOREIGN DATA WRAPPER foo;
|
||||||
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1');
|
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1');
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+-------------
|
------------+-------------------+---------+--------------------------+-------------------+-------------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | | {testing=1}
|
foo | foreign_data_user | - | - | | {testing=1} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
DROP FOREIGN DATA WRAPPER foo;
|
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
|
ERROR: option "testing" provided more than once
|
||||||
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1', another '2');
|
CREATE FOREIGN DATA WRAPPER foo OPTIONS (testing '1', another '2');
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+-----------------------
|
------------+-------------------+---------+--------------------------+-------------------+-----------------------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | | {testing=1,another=2}
|
foo | foreign_data_user | - | - | | {testing=1,another=2} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
DROP FOREIGN DATA WRAPPER foo;
|
DROP FOREIGN DATA WRAPPER foo;
|
||||||
|
@ -81,12 +81,12 @@ HINT: Must be superuser to create a foreign-data wrapper.
|
||||||
RESET ROLE;
|
RESET ROLE;
|
||||||
CREATE FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
|
CREATE FOREIGN DATA WRAPPER foo VALIDATOR postgresql_fdw_validator;
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+---------
|
------------+-------------------+---------+--------------------------+-------------------+---------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | postgresql_fdw_validator | |
|
foo | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
-- ALTER FOREIGN DATA WRAPPER
|
-- ALTER FOREIGN DATA WRAPPER
|
||||||
|
@ -98,12 +98,12 @@ ALTER FOREIGN DATA WRAPPER foo VALIDATOR bar; -- ERROR
|
||||||
ERROR: function bar(text[], oid) does not exist
|
ERROR: function bar(text[], oid) does not exist
|
||||||
ALTER FOREIGN DATA WRAPPER foo NO VALIDATOR;
|
ALTER FOREIGN DATA WRAPPER foo NO VALIDATOR;
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+---------
|
------------+-------------------+---------+--------------------------+-------------------+---------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | |
|
foo | foreign_data_user | - | - | | |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '1', b '2');
|
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
|
ERROR: option "c" not found
|
||||||
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD x '1', DROP x);
|
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD x '1', DROP x);
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+-----------
|
------------+-------------------+---------+--------------------------+-------------------+-----------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | | {a=1,b=2}
|
foo | foreign_data_user | - | - | | {a=1,b=2} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
ALTER FOREIGN DATA WRAPPER foo OPTIONS (DROP a, SET b '3', ADD c '4');
|
ALTER FOREIGN DATA WRAPPER foo OPTIONS (DROP a, SET b '3', ADD c '4');
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+-----------
|
------------+-------------------+---------+--------------------------+-------------------+-----------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | | {b=3,c=4}
|
foo | foreign_data_user | - | - | | {b=3,c=4} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '2');
|
ALTER FOREIGN DATA WRAPPER foo OPTIONS (a '2');
|
||||||
ALTER FOREIGN DATA WRAPPER foo OPTIONS (b '4'); -- ERROR
|
ALTER FOREIGN DATA WRAPPER foo OPTIONS (b '4'); -- ERROR
|
||||||
ERROR: option "b" provided more than once
|
ERROR: option "b" provided more than once
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+---------------
|
------------+-------------------+---------+--------------------------+-------------------+---------------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | | {b=3,c=4,a=2}
|
foo | foreign_data_user | - | - | | {b=3,c=4,a=2} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
SET ROLE regress_test_role;
|
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;
|
SET ROLE regress_test_role_super;
|
||||||
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD d '5');
|
ALTER FOREIGN DATA WRAPPER foo OPTIONS (ADD d '5');
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+-------------------
|
------------+-------------------+---------+--------------------------+-------------------+-------------------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | | {b=3,c=4,a=2,d=5}
|
foo | foreign_data_user | - | - | | {b=3,c=4,a=2,d=5} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
ALTER FOREIGN DATA WRAPPER foo OWNER TO regress_test_role; -- ERROR
|
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.
|
HINT: Must be superuser to alter a foreign-data wrapper.
|
||||||
RESET ROLE;
|
RESET ROLE;
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------------+---------+--------------------------+-------------------+-------------------
|
------------+-------------------------+---------+--------------------------+-------------------+-------------------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5}
|
foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
-- DROP FOREIGN DATA WRAPPER
|
-- DROP FOREIGN DATA WRAPPER
|
||||||
|
@ -183,12 +183,12 @@ ERROR: foreign-data wrapper "nonexistent" does not exist
|
||||||
DROP FOREIGN DATA WRAPPER IF EXISTS nonexistent;
|
DROP FOREIGN DATA WRAPPER IF EXISTS nonexistent;
|
||||||
NOTICE: foreign-data wrapper "nonexistent" does not exist, skipping
|
NOTICE: foreign-data wrapper "nonexistent" does not exist, skipping
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------------+---------+--------------------------+-------------------+-------------------
|
------------+-------------------------+---------+--------------------------+-------------------+-------------------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5}
|
foo | regress_test_role_super | - | - | | {b=3,c=4,a=2,d=5} |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
DROP ROLE regress_test_role_super; -- ERROR
|
DROP ROLE regress_test_role_super; -- ERROR
|
||||||
|
@ -203,11 +203,11 @@ ALTER ROLE regress_test_role_super SUPERUSER;
|
||||||
DROP FOREIGN DATA WRAPPER foo;
|
DROP FOREIGN DATA WRAPPER foo;
|
||||||
DROP ROLE regress_test_role_super;
|
DROP ROLE regress_test_role_super;
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+---------
|
------------+-------------------+---------+--------------------------+-------------------+---------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
CREATE FOREIGN DATA WRAPPER foo;
|
CREATE FOREIGN DATA WRAPPER foo;
|
||||||
|
@ -215,19 +215,19 @@ CREATE SERVER s1 FOREIGN DATA WRAPPER foo;
|
||||||
COMMENT ON SERVER s1 IS 'foreign server';
|
COMMENT ON SERVER s1 IS 'foreign server';
|
||||||
CREATE USER MAPPING FOR current_user SERVER s1;
|
CREATE USER MAPPING FOR current_user SERVER s1;
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+---------
|
------------+-------------------+---------+--------------------------+-------------------+---------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
foo | foreign_data_user | - | - | |
|
foo | foreign_data_user | - | - | | |
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(3 rows)
|
(3 rows)
|
||||||
|
|
||||||
\des+
|
\des+
|
||||||
List of foreign servers
|
List of foreign servers
|
||||||
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
|
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description
|
||||||
------+-------------------+----------------------+-------------------+------+---------+---------
|
------+-------------------+----------------------+-------------------+------+---------+---------+----------------
|
||||||
s1 | foreign_data_user | foo | | | |
|
s1 | foreign_data_user | foo | | | | | foreign server
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
\deu+
|
\deu+
|
||||||
|
@ -252,17 +252,17 @@ NOTICE: drop cascades to 2 other objects
|
||||||
DETAIL: drop cascades to server s1
|
DETAIL: drop cascades to server s1
|
||||||
drop cascades to user mapping for foreign_data_user
|
drop cascades to user mapping for foreign_data_user
|
||||||
\dew+
|
\dew+
|
||||||
List of foreign-data wrappers
|
List of foreign-data wrappers
|
||||||
Name | Owner | Handler | Validator | Access privileges | Options
|
Name | Owner | Handler | Validator | Access privileges | Options | Description
|
||||||
------------+-------------------+---------+--------------------------+-------------------+---------
|
------------+-------------------+---------+--------------------------+-------------------+---------+-------------
|
||||||
dummy | foreign_data_user | - | - | |
|
dummy | foreign_data_user | - | - | | | useless
|
||||||
postgresql | foreign_data_user | - | postgresql_fdw_validator | |
|
postgresql | foreign_data_user | - | postgresql_fdw_validator | | |
|
||||||
(2 rows)
|
(2 rows)
|
||||||
|
|
||||||
\des+
|
\des+
|
||||||
List of foreign servers
|
List of foreign servers
|
||||||
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
|
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description
|
||||||
------+-------+----------------------+-------------------+------+---------+---------
|
------+-------+----------------------+-------------------+------+---------+---------+-------------
|
||||||
(0 rows)
|
(0 rows)
|
||||||
|
|
||||||
\deu+
|
\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
|
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');
|
CREATE SERVER s8 FOREIGN DATA WRAPPER postgresql OPTIONS (host 'localhost', dbname 's8db');
|
||||||
\des+
|
\des+
|
||||||
List of foreign servers
|
List of foreign servers
|
||||||
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
|
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description
|
||||||
------+-------------------+----------------------+-------------------+--------+---------+------------------------------
|
------+-------------------+----------------------+-------------------+--------+---------+------------------------------+-------------
|
||||||
s1 | foreign_data_user | foo | | | |
|
s1 | foreign_data_user | foo | | | | |
|
||||||
s2 | foreign_data_user | foo | | | | {host=a,dbname=b}
|
s2 | foreign_data_user | foo | | | | {host=a,dbname=b} |
|
||||||
s3 | foreign_data_user | foo | | oracle | |
|
s3 | foreign_data_user | foo | | oracle | | |
|
||||||
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b}
|
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} |
|
||||||
s5 | foreign_data_user | foo | | | 15.0 |
|
s5 | foreign_data_user | foo | | | 15.0 | |
|
||||||
s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b}
|
s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} |
|
||||||
s7 | foreign_data_user | foo | | oracle | 17.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}
|
s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} |
|
||||||
(8 rows)
|
(8 rows)
|
||||||
|
|
||||||
SET ROLE regress_test_role;
|
SET ROLE regress_test_role;
|
||||||
|
@ -311,18 +311,18 @@ SET ROLE regress_test_role;
|
||||||
CREATE SERVER t1 FOREIGN DATA WRAPPER foo;
|
CREATE SERVER t1 FOREIGN DATA WRAPPER foo;
|
||||||
RESET ROLE;
|
RESET ROLE;
|
||||||
\des+
|
\des+
|
||||||
List of foreign servers
|
List of foreign servers
|
||||||
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
|
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description
|
||||||
------+-------------------+----------------------+-------------------+--------+---------+------------------------------
|
------+-------------------+----------------------+-------------------+--------+---------+------------------------------+-------------
|
||||||
s1 | foreign_data_user | foo | | | |
|
s1 | foreign_data_user | foo | | | | |
|
||||||
s2 | foreign_data_user | foo | | | | {host=a,dbname=b}
|
s2 | foreign_data_user | foo | | | | {host=a,dbname=b} |
|
||||||
s3 | foreign_data_user | foo | | oracle | |
|
s3 | foreign_data_user | foo | | oracle | | |
|
||||||
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b}
|
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} |
|
||||||
s5 | foreign_data_user | foo | | | 15.0 |
|
s5 | foreign_data_user | foo | | | 15.0 | |
|
||||||
s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b}
|
s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} |
|
||||||
s7 | foreign_data_user | foo | | oracle | 17.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}
|
s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} |
|
||||||
t1 | regress_test_role | foo | | | |
|
t1 | regress_test_role | foo | | | | |
|
||||||
(9 rows)
|
(9 rows)
|
||||||
|
|
||||||
REVOKE USAGE ON FOREIGN DATA WRAPPER foo FROM regress_test_role;
|
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;
|
SET ROLE regress_test_role;
|
||||||
CREATE SERVER t2 FOREIGN DATA WRAPPER foo;
|
CREATE SERVER t2 FOREIGN DATA WRAPPER foo;
|
||||||
\des+
|
\des+
|
||||||
List of foreign servers
|
List of foreign servers
|
||||||
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
|
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options | Description
|
||||||
------+-------------------+----------------------+-------------------+--------+---------+------------------------------
|
------+-------------------+----------------------+-------------------+--------+---------+------------------------------+-------------
|
||||||
s1 | foreign_data_user | foo | | | |
|
s1 | foreign_data_user | foo | | | | |
|
||||||
s2 | foreign_data_user | foo | | | | {host=a,dbname=b}
|
s2 | foreign_data_user | foo | | | | {host=a,dbname=b} |
|
||||||
s3 | foreign_data_user | foo | | oracle | |
|
s3 | foreign_data_user | foo | | oracle | | |
|
||||||
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b}
|
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} |
|
||||||
s5 | foreign_data_user | foo | | | 15.0 |
|
s5 | foreign_data_user | foo | | | 15.0 | |
|
||||||
s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b}
|
s6 | foreign_data_user | foo | | | 16.0 | {host=a,dbname=b} |
|
||||||
s7 | foreign_data_user | foo | | oracle | 17.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}
|
s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} |
|
||||||
t1 | regress_test_role | foo | | | |
|
t1 | regress_test_role | foo | | | | |
|
||||||
t2 | regress_test_role | foo | | | |
|
t2 | regress_test_role | foo | | | | |
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
RESET ROLE;
|
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 s1 TO regress_test_role;
|
||||||
GRANT USAGE ON FOREIGN SERVER s6 TO regress_test_role2 WITH GRANT OPTION;
|
GRANT USAGE ON FOREIGN SERVER s6 TO regress_test_role2 WITH GRANT OPTION;
|
||||||
\des+
|
\des+
|
||||||
List of foreign servers
|
List of foreign servers
|
||||||
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
|
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}
|
s1 | foreign_data_user | foo | foreign_data_user=U/foreign_data_user +| | 1.0 | {servername=s1} |
|
||||||
| | | regress_test_role=U/foreign_data_user | | |
|
| | | regress_test_role=U/foreign_data_user | | | |
|
||||||
s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b}
|
s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b} |
|
||||||
s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521}
|
s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521} |
|
||||||
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b}
|
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} |
|
||||||
s5 | foreign_data_user | foo | | | 15.0 |
|
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}
|
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 | | |
|
| | | regress_test_role2=U*/foreign_data_user | | | |
|
||||||
s7 | foreign_data_user | foo | | oracle | 17.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}
|
s8 | foreign_data_user | postgresql | | | | {host=localhost,dbname=s8db} |
|
||||||
t1 | regress_test_role | foo | | | |
|
t1 | regress_test_role | foo | | | | |
|
||||||
t2 | regress_test_role | foo | | | |
|
t2 | regress_test_role | foo | | | | |
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
SET ROLE regress_test_role;
|
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
|
DETAIL: owner of server s1
|
||||||
privileges for foreign-data wrapper foo
|
privileges for foreign-data wrapper foo
|
||||||
\des+
|
\des+
|
||||||
List of foreign servers
|
List of foreign servers
|
||||||
Name | Owner | Foreign-data wrapper | Access privileges | Type | Version | Options
|
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}
|
s1 | regress_test_indirect | foo | foreign_data_user=U/foreign_data_user +| | 1.1 | {servername=s1} |
|
||||||
| | | regress_test_role=U/foreign_data_user | | |
|
| | | regress_test_role=U/foreign_data_user | | | |
|
||||||
s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b}
|
s2 | foreign_data_user | foo | | | 1.1 | {host=a,dbname=b} |
|
||||||
s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521}
|
s3 | foreign_data_user | foo | | oracle | | {tnsname=orcl,port=1521} |
|
||||||
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b}
|
s4 | foreign_data_user | foo | | oracle | | {host=a,dbname=b} |
|
||||||
s5 | foreign_data_user | foo | | | 15.0 |
|
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}
|
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 | | |
|
| | | regress_test_role2=U*/foreign_data_user | | | |
|
||||||
s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b}
|
s7 | foreign_data_user | foo | | oracle | 17.0 | {host=a,dbname=b} |
|
||||||
s8 | foreign_data_user | postgresql | | | | {dbname=db1,connect_timeout=30}
|
s8 | foreign_data_user | postgresql | | | | {dbname=db1,connect_timeout=30} |
|
||||||
t1 | regress_test_role | foo | | | |
|
t1 | regress_test_role | foo | | | | |
|
||||||
t2 | regress_test_role | foo | | | |
|
t2 | regress_test_role | foo | | | | |
|
||||||
(10 rows)
|
(10 rows)
|
||||||
|
|
||||||
-- DROP SERVER
|
-- DROP SERVER
|
||||||
|
@ -663,10 +663,10 @@ Server: sc
|
||||||
Has OIDs: no
|
Has OIDs: no
|
||||||
|
|
||||||
\det+
|
\det+
|
||||||
List of foreign tables
|
List of foreign tables
|
||||||
Schema | Table | Server | Options
|
Schema | Table | Server | Options | Description
|
||||||
--------+-------+--------+----------------------------
|
--------+-------+--------+----------------------------+-------------
|
||||||
public | ft1 | sc | {"delimiter=,","quote=\""}
|
public | ft1 | sc | {"delimiter=,","quote=\""} | ft1
|
||||||
(1 row)
|
(1 row)
|
||||||
|
|
||||||
CREATE INDEX id_ft1_c2 ON ft1 (c2); -- ERROR
|
CREATE INDEX id_ft1_c2 ON ft1 (c2); -- ERROR
|
||||||
|
|
Loading…
Reference in New Issue