Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 8D5C8633112 for ; Tue, 12 May 2009 11:40:49 -0300 (ADT) Received: from mail.postgresql.org ([200.46.204.86]) by maia.hub.org (mx1.hub.org [200.46.204.183]) (amavisd-maia, port 10024) with ESMTP id 89849-02 for ; Tue, 12 May 2009 11:40:46 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey-1.7.6 Received: from exprod7og123.obsmtp.com (exprod7og123.obsmtp.com [64.18.2.24]) by mail.postgresql.org (Postfix) with SMTP id 31A4C633957 for ; Tue, 12 May 2009 11:40:45 -0300 (ADT) Received: from source ([74.125.78.27]) by exprod7ob123.postini.com ([64.18.6.12]) with SMTP ID DSNKSgmKbLzypu85DmhimTeFmSu2nuIWbG/Z@postini.com; Tue, 12 May 2009 07:40:45 PDT Received: by ey-out-2122.google.com with SMTP id 9so20649eyd.15 for ; Tue, 12 May 2009 07:40:43 -0700 (PDT) Received: by 10.216.54.72 with SMTP id h50mr3478898wec.28.1242139243608; Tue, 12 May 2009 07:40:43 -0700 (PDT) Received: from ?80.223.212.7? (dsl-hkibrasgw2-fed4df00-7.dhcp.inet.fi [80.223.212.7]) by mx.google.com with ESMTPS id 23sm264726eya.49.2009.05.12.07.40.42 (version=TLSv1/SSLv3 cipher=RC4-MD5); Tue, 12 May 2009 07:40:42 -0700 (PDT) Message-ID: <4A098A68.5050005@enterprisedb.com> Date: Tue, 12 May 2009 17:40:40 +0300 From: Heikki Linnakangas Organization: EnterpriseDB User-Agent: Mozilla-Thunderbird 2.0.0.19 (X11/20090103) MIME-Version: 1.0 To: Joe Kramer CC: pgsql-jdbc@postgresql.org Subject: Re: Unable to access table named "user" References: In-Reply-To: Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200905/62 X-Sequence-Number: 19612 Joe Kramer wrote: > Hi, > > I have table named user (lower case) in public schema. > I can access it using Pgadmin as > SELECT * from "user"; SELECT * from "public.user"; SELECT * FROM public.user; Odd, I would not expect the 2nd variant to work, unless you also have a table called "public.user", ie with a dot in the name. > I can't find any way to access this table from Jdbc. > Tried to access as public.user, user in single and double quotes, nothing helps. > I get exceptions like > ERROR: relation "public.user" does not exist > ERROR: relation "user" does not exist > > Also tried to execute "SET search_path TO public" beforehand in same > jdbc connection, makes no difference. > > Is there any way? These should all work: SELECT * FROM "user" SELECT * FROM public.user SELECT * FROM public."user" -- Heikki Linnakangas EnterpriseDB http://www.enterprisedb.com