Re: relation does not exist!?

From: John DeSoi <desoi(at)pgedit(dot)com>
To: Søren Poulsen <wmsopou(at)hotmail(dot)com>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: relation does not exist!?
Date: 2005-07-10 14:27:05
Message-ID: E0D19281-7EE6-4753-B704-0A758E5A5448@pgedit.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice


On Jul 10, 2005, at 9:12 AM, Søren Poulsen wrote:

> Just installed postgresql today - I keep getting the error
> "relation ... does not exist"
> when I try some simple selects. This is the scenario:
>
> Created a user X and a schema by the same name X using pgAdmin (pg
> 8.0.3) , and set
> the user as owner of the schema.
> Then I created a table Y under schema X, and set user X as owner of
> the table. Then
> I put some rows in the table.
> As postgres user when I try "select * from Y" I get the error
> "relation Y does not exist".
> I have tried "select * from X.Y", same error. The I tried logging
> in as X and executing the
> select, but still get the same error. I have also tried the same
> select from a Java program
> using JDBC and get the same error. What am I doing wrong?

Perhaps you created the table (or schema) with the name quoted. By
default, PostgreSQL folds names to lower case. So to "select * from
Y" there has to be a table named with a lowercase 'y'. If the table
name is really a capital 'Y' you need:

select * from "Y"
or
select * from "X"."Y"
depending on the name of the schema.

Click on the table in pgAdmin and look at the SQL definition to see
if the names are quoted.

John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL

In response to

Responses

Browse pgsql-novice by date

  From Date Subject
Next Message Lucius Seneca 2005-07-10 15:00:06 CSV Import?
Previous Message Søren Poulsen 2005-07-10 13:12:49 relation does not exist!?