mirror of
https://github.com/postgres/postgres.git
synced 2025-07-07 00:36:50 +03:00
Patch for current_schemas to optionally include implicit ...
Second cut attached. This one just adds a boolean option to the existing function to indicate that implicit schemas are to be included (or not). I remembered the docs as well this time :-) Dave Page
This commit is contained in:
@ -1,5 +1,5 @@
|
|||||||
<!--
|
<!--
|
||||||
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.102 2002/06/15 02:59:55 thomas Exp $
|
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.103 2002/06/15 20:03:51 momjian Exp $
|
||||||
PostgreSQL documentation
|
PostgreSQL documentation
|
||||||
-->
|
-->
|
||||||
|
|
||||||
@ -4323,9 +4323,9 @@ SELECT NULLIF(value, '(none)') ...
|
|||||||
<entry>name of current schema</entry>
|
<entry>name of current schema</entry>
|
||||||
</row>
|
</row>
|
||||||
<row>
|
<row>
|
||||||
<entry><function>current_schemas()</function></entry>
|
<entry><function>current_schemas(boolean)</function></entry>
|
||||||
<entry><type>name[]</type></entry>
|
<entry><type>name[]</type></entry>
|
||||||
<entry>names of schemas in search path</entry>
|
<entry>names of schemas in search path optionally including implicit schemas</entry>
|
||||||
</row>
|
</row>
|
||||||
</tbody>
|
</tbody>
|
||||||
</tgroup>
|
</tgroup>
|
||||||
@ -4378,10 +4378,10 @@ SELECT NULLIF(value, '(none)') ...
|
|||||||
at the front of the search path (or NULL if the search path is
|
at the front of the search path (or NULL if the search path is
|
||||||
empty). This is the schema that will be used for any tables or
|
empty). This is the schema that will be used for any tables or
|
||||||
other named objects that are created without specifying a target schema.
|
other named objects that are created without specifying a target schema.
|
||||||
<function>current_schemas</function> returns an array of the names of all
|
<function>current_schemas(boolean)</function> returns an array of the names of all
|
||||||
schemas presently in the search path. Note that these functions show
|
schemas presently in the search path. The boolean option determines whether or not
|
||||||
only schemas that are explicitly part of the path; when a system schema
|
implicitly included system schemas such as pg_catalog are included in the search
|
||||||
is being searched implicitly, it is not listed.
|
path returned.
|
||||||
</para>
|
</para>
|
||||||
|
|
||||||
<table>
|
<table>
|
||||||
|
@ -12,7 +12,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.37 2002/06/13 06:19:45 ishii Exp $
|
* $Header: /cvsroot/pgsql/src/backend/utils/adt/name.c,v 1.38 2002/06/15 20:03:51 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -251,7 +251,7 @@ current_schema(PG_FUNCTION_ARGS)
|
|||||||
Datum
|
Datum
|
||||||
current_schemas(PG_FUNCTION_ARGS)
|
current_schemas(PG_FUNCTION_ARGS)
|
||||||
{
|
{
|
||||||
List *search_path = fetch_search_path(false);
|
List *search_path = fetch_search_path(PG_GETARG_BOOL(0));
|
||||||
int nnames = length(search_path);
|
int nnames = length(search_path);
|
||||||
Datum *names;
|
Datum *names;
|
||||||
int i;
|
int i;
|
||||||
|
@ -37,7 +37,7 @@
|
|||||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: catversion.h,v 1.134 2002/06/11 15:44:38 thomas Exp $
|
* $Id: catversion.h,v 1.135 2002/06/15 20:03:51 momjian Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -53,6 +53,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* yyyymmddN */
|
/* yyyymmddN */
|
||||||
#define CATALOG_VERSION_NO 200206111
|
#define CATALOG_VERSION_NO 200206151
|
||||||
|
|
||||||
#endif
|
#endif
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: pg_proc.h,v 1.241 2002/06/11 15:41:37 thomas Exp $
|
* $Id: pg_proc.h,v 1.242 2002/06/15 20:03:51 momjian Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* The script catalog/genbki.sh reads this file and generates .bki
|
* The script catalog/genbki.sh reads this file and generates .bki
|
||||||
@ -1761,7 +1761,7 @@ DESCR("convert name to varchar");
|
|||||||
|
|
||||||
DATA(insert OID = 1402 ( current_schema PGNSP PGUID 12 f f f t f s 0 19 "0" 100 0 0 100 current_schema - _null_ ));
|
DATA(insert OID = 1402 ( current_schema PGNSP PGUID 12 f f f t f s 0 19 "0" 100 0 0 100 current_schema - _null_ ));
|
||||||
DESCR("current schema name");
|
DESCR("current schema name");
|
||||||
DATA(insert OID = 1403 ( current_schemas PGNSP PGUID 12 f f f t f s 0 1003 "0" 100 0 0 100 current_schemas - _null_ ));
|
DATA(insert OID = 1403 ( current_schemas PGNSP PGUID 12 f f f t f s 1 1003 "16" 100 0 0 100 current_schemas - _null_ ));
|
||||||
DESCR("current schema search list");
|
DESCR("current schema search list");
|
||||||
|
|
||||||
DATA(insert OID = 1404 ( overlay PGNSP PGUID 14 f f f t f i 4 25 "25 25 23 23" 100 0 0 100 "select substring($1, 1, ($3 - 1)) || $2 || substring($1, ($3 + $4))" - _null_ ));
|
DATA(insert OID = 1404 ( overlay PGNSP PGUID 14 f f f t f i 4 25 "25 25 23 23" 100 0 0 100 "select substring($1, 1, ($3 - 1)) || $2 || substring($1, ($3 + $4))" - _null_ ));
|
||||||
|
Reference in New Issue
Block a user