Обсуждение: double quotes in unicode dbs

Поиск
Список
Период
Сортировка

double quotes in unicode dbs

От
Peter Novodvorsky
Дата:
Hello!

   I'm writing native driver for OpenOffice.Org for PostgreSQL. I used
to use 8-bit charset db to test a driver (koi8-r, actually), and when I
tried UNICODE db I've found the following problem: queries with double
quotes don't work. For example,

       SELECT * FROM TEST1;

works, but

       SELECT * FROM "TEST1";

doesn't. I'd gladly remove all quoting of table names, but it is done
by sdbc layer of OpenOffice.Org, and I don't want to hack it.

   Is it bug of PostgreSQL multibyte support or mine syntax error?

Thanks.

--
Peter Novodvorsky                             nidd@myxomop.com
   http://garcia.myxomop.com/NiddWiki   Deadheads, unite!

Re: double quotes in unicode dbs

От
Thomas Beutin
Дата:
Hi Peter,

On Thu, Aug 08, 2002 at 04:48:02PM +0400, Peter Novodvorsky wrote:
>    I'm writing native driver for OpenOffice.Org for PostgreSQL. I used
> to use 8-bit charset db to test a driver (koi8-r, actually), and when I
> tried UNICODE db I've found the following problem: queries with double
> quotes don't work. For example,
>
>        SELECT * FROM TEST1;
>
> works, but
>
>        SELECT * FROM "TEST1";
>
> doesn't. I'd gladly remove all quoting of table names, but it is done
> by sdbc layer of OpenOffice.Org, and I don't want to hack it.
>
If You are quoting the table names they are treated case sensitive.
Is there an table TEST1 in Your database?

Greetings,
-tb
--
Thomas Beutin                             tb@laokoon.IN-Berlin.DE
Beam me up, Scotty. There is no intelligent live down in Redmond.

Re: double quotes in unicode dbs

От
Holger Klawitter
Дата:
>        SELECT * FROM TEST1;
>
> works, but
>
>        SELECT * FROM "TEST1";

It might be a normal case problem.

Doublequotes make Postgres preserve the case of table names otherwise every is
being converted to lower case. Probably your table is named in lowercase
(either by creating it using "test1" or TEST1 without the double quotes).
You can see the interal name with the "\d" command.

With kind regards / mit freundlichem Gruß
    Holger Klawitter
--
Holger Klawitter                          http://www.klawitter.de
lists@klawitter.de

Re: double quotes in unicode dbs

От
Peter Novodvorsky
Дата:
Holger Klawitter <lists@klawitter.de> writes:

>>        SELECT * FROM TEST1;
>>
>> works, but
>>
>>        SELECT * FROM "TEST1";
>
> It might be a normal case problem.
>
> Doublequotes make Postgres preserve the case of table names otherwise every is
> being converted to lower case. Probably your table is named in lowercase
> (either by creating it using "test1" or TEST1 without the double quotes).
> You can see the interal name with the "\d" command.

Thank you very much. It helped me to solve the problem.

--
Peter Novodvorsky                             nidd@myxomop.com
   http://garcia.myxomop.com/NiddWiki   Deadheads, unite!
           Kill 'em all, and let God sort 'em out