]> granicus.if.org Git - postgresql/commit
Add current_database().
authorBruce Momjian <bruce@momjian.us>
Tue, 20 Aug 2002 04:46:00 +0000 (04:46 +0000)
committerBruce Momjian <bruce@momjian.us>
Tue, 20 Aug 2002 04:46:00 +0000 (04:46 +0000)
commitde9801fc62ba9ed905c2f20686459a206d453453
treee6ed5e64ba97e2156230373abb038af9138149be
parentf736fdb0222ded716bd4f0cdddc06158773d9bc1
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
doc/src/sgml/func.sgml
src/backend/utils/adt/misc.c
src/include/catalog/pg_proc.h
src/include/utils/builtins.h