mirror of
https://github.com/postgres/postgres.git
synced 2025-05-02 11:44:50 +03:00
Supress non-temp schemas from psql \dn display.
This commit is contained in:
parent
afb09b5a31
commit
a922472a2a
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.101 2003/12/01 22:21:54 momjian Exp $
|
$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.102 2003/12/23 23:13:14 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -957,6 +957,7 @@ testdb=>
|
|||||||
Lists all available schemas (namespaces). If <replaceable
|
Lists all available schemas (namespaces). If <replaceable
|
||||||
class="parameter">pattern</replaceable> (a regular expression)
|
class="parameter">pattern</replaceable> (a regular expression)
|
||||||
is specified, only schemas whose names match the pattern are listed.
|
is specified, only schemas whose names match the pattern are listed.
|
||||||
|
Non-local temporary schemas are suppressed.
|
||||||
</para>
|
</para>
|
||||||
</listitem>
|
</listitem>
|
||||||
</varlistentry>
|
</varlistentry>
|
||||||
|
@ -3,7 +3,7 @@
|
|||||||
*
|
*
|
||||||
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
* Copyright (c) 2000-2003, PostgreSQL Global Development Group
|
||||||
*
|
*
|
||||||
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.90 2003/12/01 22:21:54 momjian Exp $
|
* $PostgreSQL: pgsql/src/bin/psql/describe.c,v 1.91 2003/12/23 23:13:14 momjian Exp $
|
||||||
*/
|
*/
|
||||||
#include "postgres_fe.h"
|
#include "postgres_fe.h"
|
||||||
#include "describe.h"
|
#include "describe.h"
|
||||||
@ -1626,14 +1626,15 @@ listSchemas(const char *pattern)
|
|||||||
|
|
||||||
initPQExpBuffer(&buf);
|
initPQExpBuffer(&buf);
|
||||||
printfPQExpBuffer(&buf,
|
printfPQExpBuffer(&buf,
|
||||||
"SELECT n.nspname AS \"%s\",\n"
|
"SELECT n.nspname AS \"%s\",\n"
|
||||||
" u.usename AS \"%s\"\n"
|
" u.usename AS \"%s\"\n"
|
||||||
"FROM pg_catalog.pg_namespace n LEFT JOIN pg_catalog.pg_user u\n"
|
"FROM pg_catalog.pg_namespace n LEFT JOIN pg_catalog.pg_user u\n"
|
||||||
" ON n.nspowner=u.usesysid\n",
|
" ON n.nspowner=u.usesysid\n"
|
||||||
|
"WHERE (n.nspname NOT LIKE 'pg\\\\_temp\\\\_%%' OR\n"
|
||||||
|
" n.nspname = (pg_catalog.current_schemas(true))[1])\n", /* temp schema is first */
|
||||||
_("Name"),
|
_("Name"),
|
||||||
_("Owner"));
|
_("Owner"));
|
||||||
|
processNamePattern(&buf, pattern, true, false,
|
||||||
processNamePattern(&buf, pattern, false, false,
|
|
||||||
NULL, "n.nspname", NULL,
|
NULL, "n.nspname", NULL,
|
||||||
NULL);
|
NULL);
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user