Received: from maia.hub.org (unknown [200.46.204.183]) by mail.postgresql.org (Postfix) with ESMTP id 4649C632968 for ; Wed, 13 May 2009 05:30:51 -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 78950-05 for ; Wed, 13 May 2009 05:30:49 -0300 (ADT) X-Greylist: delayed 05:55:04.250432 by SQLgrey-1.7.6 Received: from outbound.vnet-inc.com (outbound.vnet-inc.com [216.146.104.103]) by mail.postgresql.org (Postfix) with ESMTP id 1019F63221F for ; Wed, 13 May 2009 05:30:49 -0300 (ADT) Received: from [192.168.157.32] (unknown [216.129.226.25]) by outbound.vnet-inc.com (Postfix) with ESMTP id 32A145A62; Tue, 12 May 2009 19:19:00 -0600 (MDT) Message-ID: <4A0A1EB0.9030808@ttc-cmc.net> Date: Tue, 12 May 2009 19:13:20 -0600 From: dmp User-Agent: Mozilla/5.0 (X11; U; Linux i686; en-US; rv:1.7.13) Gecko/20060417 X-Accept-Language: en-us, en MIME-Version: 1.0 To: Joe Kramer CC: pgsql-jdbc@postgresql.org Subject: Re: Unable to access table named "user" Content-Type: text/plain; charset=ISO-8859-1; format=flowed 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: 200905/72 X-Sequence-Number: 19622 > 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 -- -- MyJSQLView SQL Dump -- Version: 3.01 -- WebSite: http://myjsqlview.org -- -- Host: 127.0.0.1 -- Generated On: 2009.05.12 AD at 07:09:47 MDT -- SQL version: PostgreSQL 8.3.3 -- Database: key_tables -- -- ------------------------------------------ -- -- Dumping data for table "public"."keY_tAble2" -- LOCK TABLE "public"."keY_tAble2"; INSERT INTO "public"."keY_tAble2" ("Host", "Db", "Username", "select_priv") VALUES ('cindy', 'sample', 'danap', 't'); danap.