pg.ddx.io  pgsql-jdbc@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Heikki Linnakangas <heikki.linnakangas@enterprisedb.com>
To: Joe Kramer <cckramer@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Unable to access table named "user"
Date: Tue, 12 May 2009 17:40:40 +0300
Message-ID: <4A098A68.5050005@enterprisedb.com> (raw)
In-Reply-To: <b4c00a110905120019r78d2534ck3fb32c8320d2c79d@mail.gmail.com>
References: <b4c00a110905120019r78d2534ck3fb32c8320d2c79d@mail.gmail.com>

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



view thread (8+ messages)  latest in thread

Message-ID: <4A098A68.5050005@enterprisedb.com>
Permalink:  ../4A098A68.5050005@enterprisedb.com/
Also on:    postgresql.org/message-id/4A098A68.5050005@enterprisedb.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-jdbc@postgresql.org
  Cc: heikki.linnakangas@enterprisedb.com, cckramer@gmail.com
  Subject: Re: Unable to access table named "user"
  In-Reply-To: <4A098A68.5050005@enterprisedb.com>
  References: <b4c00a110905120019r78d2534ck3fb32c8320d2c79d@mail.gmail.com> <4A098A68.5050005@enterprisedb.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox