Skip site navigation (1) Skip section navigation (2)


From: Halley Pacheco de Oliveira <halleypo(at)yahoo(dot)com(dot)br>
To: pgsql-docs(at)postgresql(dot)org
Subject: current_schemas()
Date: 2005-07-05 11:14:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-docs
I would like to know how to use current_schemas(), since SELECT current_schemas(); didn't work in
PostgreSQL 7.4 and 8.0 psql.


PostgreSQL 8.0.3 Documentation
Chapter 16. Server Run-time Environment
16.4. Run-time Configuration

The current effective value of the search path can be examined via the SQL function
current_schemas(). This is not quite the same as examining the value of search_path, since
current_schemas() shows how the requests appearing in search_path were resolved.

teste=# \dn
********* QUERY **********
SELECT n.nspname AS "Name",
       u.usename AS "Owner"
FROM pg_catalog.pg_namespace n LEFT JOIN pg_catalog.pg_user u
       ON n.nspowner=u.usesysid
WHERE   (n.nspname NOT LIKE 'pg\\_temp\\_%' OR
                 n.nspname = (pg_catalog.current_schemas(true))[1])

        List of schemas
        Name        |  Owner
 information_schema | postgres
 pg_catalog         | postgres
 pg_toast           | postgres
 public             | postgres
(4 rows)

teste=# SELECT current_schema();
(1 row)

teste=# SELECT current_schemas();
ERROR:  function current_schemas() does not exist
HINT:  No function matches the given name and argument types. You may need to add explicit type

Yahoo! Acesso Grátis - Internet rápida e grátis. 
Instale o discador agora!


pgsql-docs by date

Next:From: Alvaro HerreraDate: 2005-07-05 14:06:38
Subject: Re: current_schemas()
Previous:From: Bruce MomjianDate: 2005-07-01 13:32:13
Subject: Re: log_min_duration_statement versus log_statement

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group