Unable to access table named "user"

Started by Joe Krameralmost 17 years ago5 messagesgeneral
Jump to latest
#1Joe Kramer
cckramer@gmail.com

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;

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?

Thanks.

#2Scott Marlowe
scott.marlowe@gmail.com
In reply to: Joe Kramer (#1)
Re: Unable to access table named "user"

On Tue, May 12, 2009 at 1:26 AM, Joe Kramer <cckramer@gmail.com> 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;

Try "public"."user"

#3Joe Kramer
cckramer@gmail.com
In reply to: Scott Marlowe (#2)
Re: Unable to access table named "user"

Don't help either.

Jdbc statement:
SELECT * from "public"."user" ;

Exception:
ERROR: relation "public.user" does not exist

Show quoted text

On Tue, May 12, 2009 at 5:55 PM, Scott Marlowe <scott.marlowe@gmail.com> wrote:

On Tue, May 12, 2009 at 1:26 AM, Joe Kramer <cckramer@gmail.com> 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;

Try "public"."user"

#4Sam Mason
sam@samason.me.uk
In reply to: Joe Kramer (#3)
Re: Unable to access table named "user"

On Tue, May 12, 2009 at 06:57:07PM +1000, Joe Kramer wrote:

Don't help either.

Jdbc statement:
SELECT * from "public"."user" ;

Exception:
ERROR: relation "public.user" does not exist

Are you sure the table exists or you're connecting to the correct
database then? If you connect with psql and do "\dt" does it show up?

--
Sam http://samason.me.uk/

#5Adrian Klaver
adrian.klaver@aklaver.com
In reply to: Sam Mason (#4)
Re: Unable to access table named "user"

On Tuesday 12 May 2009 3:16:34 am Sam Mason wrote:

On Tue, May 12, 2009 at 06:57:07PM +1000, Joe Kramer wrote:

Don't help either.

Jdbc statement:
SELECT * from "public"."user" ;

Exception:
ERROR: relation "public.user" does not exist

Are you sure the table exists or you're connecting to the correct
database then? If you connect with psql and do "\dt" does it show up?

--
Sam http://samason.me.uk/

I would have to second Sam on this. If you find you are connected to the correct
database, does the JDBC driver allow you to select other tables or is the
problem restricted to this table?

--
Adrian Klaver
aklaver@comcast.net