1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Add current_database().

> Quick system function to pull out the current database.
>
> I've used this a number of times to allow stored procedures to find out
> where they are.  Especially useful for those that do logging or hit a
> remote server.
>
> It's called current_database() to match with current_user().

It's also a necessity for an informational schema.  The catalog
(database) name is required in a number of places.

Rod Taylor
This commit is contained in:
Bruce Momjian
2002-08-20 04:46:00 +00:00
parent f736fdb022
commit de9801fc62
4 changed files with 30 additions and 4 deletions

View File

@ -1,5 +1,5 @@
<!--
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.112 2002/08/16 23:01:18 tgl Exp $
$Header: /cvsroot/pgsql/doc/src/sgml/func.sgml,v 1.113 2002/08/20 04:45:59 momjian Exp $
PostgreSQL documentation
-->
@ -5082,6 +5082,11 @@ SELECT NULLIF(value, '(none)') ...
<entry><type>name[]</type></entry>
<entry>names of schemas in search path optionally including implicit schemas</entry>
</row>
<row>
<entry><function>current_database()</function></entry>
<entry><type>name</type></entry>
<entry>name of current database</entry>
</row>
</tbody>
</tgroup>
</table>