X-Original-To: pgsql-docs-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id C98A65284F for ; Tue, 5 Jul 2005 08:14:43 -0300 (ADT) Received: from svr1.postgresql.org ([200.46.204.71]) by localhost (av.hub.org [200.46.204.144]) (amavisd-new, port 10024) with ESMTP id 63551-08 for ; Tue, 5 Jul 2005 11:14:38 +0000 (GMT) Received: from web52704.mail.yahoo.com (web52704.mail.yahoo.com [206.190.39.155]) by svr1.postgresql.org (Postfix) with SMTP id 60FC752848 for ; Tue, 5 Jul 2005 08:14:37 -0300 (ADT) Received: (qmail 62085 invoked by uid 60001); 5 Jul 2005 11:14:40 -0000 DomainKey-Signature: a=rsa-sha1; q=dns; c=nofws; s=s1024; d=yahoo.com.br; h=Message-ID:Received:Date:From:Subject:To:MIME-Version:Content-Type:Content-Transfer-Encoding; b=MFVBomQqnfmY7CQQA20E7aeQyOW3GqBftXkynZFu/UY+WzhKzPRa/A5MpPpyILvA8qBpKdzx+aU7jBXysZqjnCW5NGl5XY42ke1Mg6R1JPrrvayccziLZbhDoNiN/g7n9J3Oi2q5Jax475fscKG5+UOn7npEXHYkJnNsbWz6fFg= ; Message-ID: <20050705111440.62083.qmail@web52704.mail.yahoo.com> Received: from [200.216.87.13] by web52704.mail.yahoo.com via HTTP; Tue, 05 Jul 2005 08:14:40 ART Date: Tue, 5 Jul 2005 08:14:40 -0300 (ART) From: Halley Pacheco de Oliveira Subject: current_schemas() To: pgsql-docs@postgresql.org MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.374 tagged_above=0 required=5 tests=DNS_FROM_RFC_ABUSE X-Spam-Level: X-Archive-Number: 200507/4 X-Sequence-Number: 3130 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. Halley 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]) ORDER BY 1; ************************** List of schemas Name | Owner --------------------+---------- information_schema | postgres pg_catalog | postgres pg_toast | postgres public | postgres (4 rows) teste=# SELECT current_schema(); current_schema ---------------- public (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 casts. _______________________________________________________ Yahoo! Acesso Grátis - Internet rápida e grátis. Instale o discador agora! http://br.acesso.yahoo.com/