Received: from localhost (unknown [200.46.204.183]) by postgresql.org (Postfix) with ESMTP id F23E164FCDE for ; Wed, 20 Aug 2008 13:40:08 -0300 (ADT) Received: from postgresql.org ([200.46.204.86]) by localhost (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 84871-06 for ; Wed, 20 Aug 2008 13:40:04 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from tempest.mainecoon.com (tempest.mainecoon.com [69.12.217.123]) by postgresql.org (Postfix) with ESMTP id 6D19464FCE6 for ; Wed, 20 Aug 2008 13:40:05 -0300 (ADT) Received: from [10.1.1.2] (fw.boscorama.com [75.101.8.88]) by tempest.mainecoon.com (Postfix) with ESMTPSA id C86CD6EA0B0 for ; Wed, 20 Aug 2008 09:40:02 -0700 (PDT) Message-ID: <48AC48DB.6020603@boscorama.com> Date: Wed, 20 Aug 2008 09:39:55 -0700 From: Bosco Rama User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.8.1.16) Gecko/20080717 SeaMonkey/1.1.11 Mnenhy/0.7.4.0 MIME-Version: 1.0 To: pgsql-interfaces@postgresql.org Subject: Re: schema name in the SQL statement. References: <738m08$3l61o@dmzms99802.na.baesystems.com> In-Reply-To: <738m08$3l61o@dmzms99802.na.baesystems.com> Content-Type: text/plain; charset=us-ascii Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0 tagged_above=0 required=5 tests=none X-Spam-Level: X-Archive-Number: 200808/16 X-Sequence-Number: 6791 Masis, Alexander (US SSA) wrote: > My db has one schema. In fact I deleted the default "public" and created > my own: "schema_1". > In my SQL query I have to explicitly specify schema name: > "select my_colomn from schema_1.table_name;" > Can't schema be specified as default value during connection, or can I > set the schema before I send the query? After the connection is established, set the search_path to be your schema: "set search_path to schema_1;" At that point you can use unqualified relation references again: "select my_colomn from table_name;" Bosco.