Thread: Problem with table name in capitals.

Problem with table name in capitals.

From
Kurt Roeckx
Date:
When I'm using a table with capitals from excel or something,
using microsoft query, I get an error that the relation
"public"."table" doesn't exist.

I noticed that I got simular errors when I didn't put quotes
around the name of the table.  I assume it's the same problem
here?

When I rename the table/column to lower case it works.

Is this a problem in the ODBC driver, or in microsoft query?  If
the later, can it be fixed in the ODBC driver?


Kurt


Re: Problem with table name in capitals.

From
Jeff Eckermann
Date:
--- Kurt Roeckx <Q@ping.be> wrote:
> When I'm using a table with capitals from excel or
> something,
> using microsoft query, I get an error that the
> relation
> "public"."table" doesn't exist.
>
> I noticed that I got simular errors when I didn't
> put quotes
> around the name of the table.  I assume it's the
> same problem
> here?
>
> When I rename the table/column to lower case it
> works.
>
> Is this a problem in the ODBC driver, or in
> microsoft query?

Neither one.  Table/column names in PostgreSQL are
case insensitive, as the SQL standard requires.  In
PostgreSQL this is achieved by forcing all names to
lower case before evaluation.  Quoted names are not
changed, as you found.  You will need to rename your
tables/columns to lower case names, or always quote
them in queries.

__________________________________________________
Do you Yahoo!?
Yahoo! Mail Plus - Powerful. Affordable. Sign up now.
http://mailplus.yahoo.com

Re: Problem with table name in capitals.

From
Kurt Roeckx
Date:
On Fri, Dec 13, 2002 at 08:17:01PM -0800, Jeff Eckermann wrote:
>
> You will need to rename your
> tables/columns to lower case names, or always quote
> them in queries.

So if I get this right, the problem was that there were quotes
when it was created.  So I should blame pgadmin for doing that?

You can't really put quotes around the names of the tables/column
when you're still in that wizard.

I'll just rename them all.


Kurt


Re: Problem with table name in capitals.

From
"Dave Page"
Date:

> -----Original Message-----
> From: Kurt Roeckx [mailto:Q@ping.be]
> Sent: 14 December 2002 13:08
> To: Jeff Eckermann
> Cc: pgsql-odbc@postgresql.org
> Subject: Re: [ODBC] Problem with table name in capitals.
>
>
> On Fri, Dec 13, 2002 at 08:17:01PM -0800, Jeff Eckermann wrote:
> >
> > You will need to rename your
> > tables/columns to lower case names, or always quote
> > them in queries.
>
> So if I get this right, the problem was that there were
> quotes when it was created.  So I should blame pgadmin for doing that?

No, 'cos pgAdmin hasn't done anything wrong. You are quite entitled to
use mixed case identifiers if you like, and pgAdmin will allow you to do
so. If your client application cannot then deal with that, then it;s
hardly the fault of pgAdmin.

> You can't really put quotes around the names of the
> tables/column when you're still in that wizard.

If the wizard you're referring to is the pgAdmin Migration Wizard, then
it will use mixed case names by default, but on the very first page of
the wizard, there are options to fold the names to lower case for you.

Regards, Dave.

Re: Problem with table name in capitals.

From
Kurt Roeckx
Date:
On Sat, Dec 14, 2002 at 07:54:48PM -0000, Dave Page wrote:
>
> > You can't really put quotes around the names of the
> > tables/column when you're still in that wizard.
>
> If the wizard you're referring to is the pgAdmin Migration Wizard

No, that stupid wizard from microsoft can't do it.


Kurt


Re: Problem with table name in capitals.

From
Hiroshi Inoue
Date:
Kurt Roeckx wrote:
>
> When I'm using a table with capitals from excel or something,
> using microsoft query, I get an error that the relation
> "public"."table" doesn't exist.
>
> I noticed that I got simular errors when I didn't put quotes
> around the name of the table.  I assume it's the same problem
> here?
>
> When I rename the table/column to lower case it works.
>
> Is this a problem in the ODBC driver, or in microsoft query?

Maybe the latter. For example if there's a table named
"AbC", MS query issues a command like 'select ...
from AbC' whereas MS Access issues a double-quoted query
like 'select ... from "AbC"'.

> If the later, can it be fixed in the ODBC driver?

How can we fix it without affecting existent applications
which use the driver ?

regards,
Hiroshi Inoue
    http://w2422.nsk.ne.jp/~inoue/