X-Original-To: pgsql-jdbc-postgresql.org@localhost.postgresql.org Received: from localhost (unknown [200.46.204.144]) by svr1.postgresql.org (Postfix) with ESMTP id 3AA9D8B9BCD for ; Wed, 2 Feb 2005 08:40:07 +0000 (GMT) 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 77258-06 for ; Wed, 2 Feb 2005 08:40:03 +0000 (GMT) Received: from chemaxon.hu (90.156-228-195.hosting.adatpark.hu [195.228.156.90]) by svr1.postgresql.org (Postfix) with ESMTP id 0E6968B9BBB for ; Wed, 2 Feb 2005 08:40:03 +0000 (GMT) Received: from a84-0-130-142.adsl-pool.axelero.hu ([84.0.130.142] helo=[10.0.0.161]) by chemaxon.hu with esmtpsa (Exim 4.44 #1 (Debian)) id 1CwG3N-0006on-RJ TLS Cipher TLSv1:AES256-SHA:256; Wed, 02 Feb 2005 09:40:02 +0100 Message-ID: <420091DE.9020003@chemaxon.hu> Date: Wed, 02 Feb 2005 09:39:58 +0100 From: =?ISO-8859-1?Q?Kov=E1cs_P=E9ter?= User-Agent: Mozilla Thunderbird 1.0 (Windows/20041206) X-Accept-Language: en-us, en MIME-Version: 1.0 To: Kris Jurka Cc: pgsql-jdbc@postgresql.org Subject: Re: Primary schema name prepended to database objects References: <41FFD091.4040507@chemaxon.hu> In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 8bit X-Virus-Scanned: by amavisd-new at hub.org X-Spam-Status: No, hits=0.05 tagged_above=0 required=5 tests=FORGED_RCVD_HELO X-Spam-Level: X-Archive-Number: 200502/9 X-Sequence-Number: 12189 Kris, Thank you for your reply! The problem is that where I write in my code, say: "SELECT * FROM mytable" the backend log contains: "SELECT * FROM myusername.mytable" Someone along the way (I suspect the JDBC driver, but I am not sure) "qualifies" my database objects. Probably that is why the "public" schema is not searched for "mytable". Are there cases/configurations where the JDBC driver prepends the username to the object name? Is it possible to prevent this from happening? Thank you! Peter Kris Jurka wrote: > > On Tue, 1 Feb 2005, [ISO-8859-1] Kovács Péter wrote: > > >>Hi there, >> >>I am not sure if this a general or jdbc question. (I am connecting to >>pgsql via jdbc.) I have postmaster (PostgreSQL) 7.4.5. It looks like the >>name of primary schema of the user (actually their username) is >>prepended to database objects so the "search_path" is not considered any >>more. > > > By default the search_path has the schema of your username included in it > with the special $user variable: > > jurka=# show search_path; > search_path > -------------- > $user,public > (1 row) > > > >>(I got my stuff in the "public" schema, so I do not find them as >>user 'x'.) How can I tell the jdbc driver not to use schema-qualified >>object names? >> > > > This should still search the public schema if an identically named object > is not found in your user schema. It is unclear from your report exactly > what your search_path setting is, what tables are where, and what query is > not finding them correctly. If your search_path is not set correctly you > may set this globally (postgresql.conf) or per user/database or per > connection to match your needs. > > Kris Jurka >