relation does not exist

Lists: pgsql-jdbc
From: eric cartman <panefsky(at)yahoo(dot)com>
To: pgsql-jdbc(at)postgresql(dot)org
Subject: relation does not exist
Date: 2006-02-21 19:17:03
Message-ID: 20060221191703.26450.qmail@web60321.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Hello to everyone,

I have a small problem using PostgreSQL.
The problem is that I create a database and some tables through ant and an .sql file.
Then by using DatabaseMetaData class and method getTables(..)I can make a list of the newly created tables, implying that everything worked fine.

But when I am trying to Insert values into tables, i get the message 'relation <name> does not exist'.

How can this be possible?


Thank you all in advance.

T.Panos


---------------------------------
Brings words and photos together (easily) with
PhotoMail - it's free and works with Yahoo! Mail.


From: Mark Lewis <mark(dot)lewis(at)mir3(dot)com>
To: eric cartman <panefsky(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: relation does not exist
Date: 2006-02-21 19:29:34
Message-ID: 1140550174.9076.371.camel@archimedes
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

Did you create the tables using case-sensitive names, such as:

create table "MyTable" ... ?

If this is the case, then you would see some upper-case letters in the
results from DatabaseMetaData.getTables(), and in order to use the
tables in any queries you would always need to quote the table names and
use correct case, since unquoted identifier names are always forced to
lower case in PostgreSQL.

-- Mark Lewis

On Tue, 2006-02-21 at 11:17 -0800, eric cartman wrote:
> Hello to everyone,
>
> I have a small problem using PostgreSQL.
> The problem is that I create a database and some tables through ant
> and an .sql file.
> Then by using DatabaseMetaData class and method getTables(..)I can
> make a list of the newly created tables, implying that everything
> worked fine.
>
> But when I am trying to Insert values into tables, i get the message
> 'relation <name> does not exist'.
>
> How can this be possible?
>
>
> Thank you all in advance.
>
> T.Panos
>
>
> ______________________________________________________________________
> Brings words and photos together (easily) with
> PhotoMail - it's free and works with Yahoo! Mail.


From: Kris Jurka <books(at)ejurka(dot)com>
To: eric cartman <panefsky(at)yahoo(dot)com>
Cc: pgsql-jdbc(at)postgresql(dot)org
Subject: Re: relation does not exist
Date: 2006-02-21 20:00:34
Message-ID: Pine.BSO.4.63.0602211459460.4950@leary.csoft.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

On Tue, 21 Feb 2006, eric cartman wrote:

> Hello to everyone,
>
> The problem is that I create a database and some tables through ant and
> an .sql file. Then by using DatabaseMetaData class and method
> getTables(..)I can make a list of the newly created tables, implying
> that everything worked fine.
>
> But when I am trying to Insert values into tables, i get the message
> 'relation <name> does not exist'.
>

getTables will tell you about all tables in all schemas. Perhaps there's
a table that is not in your search_path when you try and insert into it.

Kris Jurka


From: eric cartman <panefsky(at)yahoo(dot)com>
To: My Postgre Mailing <pgsql-jdbc(at)postgresql(dot)org>
Subject: relation does not exist
Date: 2006-02-22 10:48:18
Message-ID: 20060222104818.42218.qmail@web60318.mail.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-jdbc

I am afraid you are right.
The tables were created with quotes like
CREATE TABLE "name"
The getTables() method returns only name without quotes..

Thank you all.


---------------------------------
Yahoo! Autos. Looking for a sweet ride? Get pricing, reviews, & more on new and used cars.