Re: Referencing created tables fails with message that

From: Ragnar Hafstað <gnari(at)simnet(dot)is>
To: tommy(at)tommysvensson(dot)net
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Referencing created tables fails with message that
Date: 2005-02-28 06:33:25
Message-ID: 1109572405.16690.55.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Sun, 2005-02-27 at 18:50 -0500, Tommy Svensson wrote:
> I have just installed Postgresql and tried it for the first time.
>
> One very serious problem I ran into was when actually trying to use
> created tables.
> Creating a simple table without any foreign keys works OK, but after
> creating the
> table it is not possible to do a select on it! I tried the following
> variants:
>
> SELECT * FROM <table>;
> SELECT * FROM public.<table>;
> SELECT * FROM <schema>.public.<table>;
>
> All result in the message "The relation <table> does not exist!" or "The
> relation public.<table> does not exist!".

you do not give actual examples, nor do you say how you created the
tables, but one possibility is that you ran into the case-folding
feature.

names are folded to lowercase unless quoted in doublequotes.

if you (or the client you use) created your table with
quoted upper-case or mixed case names, you must do the same
with the selects.

CREATE TABLE "Foo" (a text);
SELECT a from "Foo"; -- works
SELECT a from Foo; -- fails

the same applies to other names, such as columns.

gnari

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Tino Wildenhain 2005-02-28 07:33:10 Re: Referencing created tables fails with message that
Previous Message Jay Guerette 2005-02-28 05:45:23 Re: row numbering