pg.ddx.io pgsql-jdbc@postgresql.org mailing list archivehelp / color / mirror / Atom feed
From: dmp <danap@ttc-cmc.net>
To: Joe Kramer <cckramer@gmail.com>
Cc: pgsql-jdbc@postgresql.org
Subject: Re: Unable to access table named "user"
Date: Tue, 12 May 2009 19:13:20 -0600
Message-ID: <4A0A1EB0.9030808@ttc-cmc.net> (raw)
> 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.
view thread (8+ messages)
Message-ID: <4A0A1EB0.9030808@ttc-cmc.net> Permalink: ../4A0A1EB0.9030808@ttc-cmc.net/ Also on: postgresql.org/message-id/4A0A1EB0.9030808@ttc-cmc.net ·
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: danap@ttc-cmc.net, cckramer@gmail.com Subject: Re: Unable to access table named "user" In-Reply-To: <4A0A1EB0.9030808@ttc-cmc.net> References: <4A0A1EB0.9030808@ttc-cmc.net> * 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