Re: Query changes

Поиск
Список
Период
Сортировка
От Martijn van Oosterhout
Тема Re: Query changes
Дата
Msg-id 20030518014740.GB10998@svana.org
обсуждение исходный текст
Ответ на Query changes  (Tapan Trivedi <ttrivedi@webifyservices.com>)
Список pgsql-general
On Thu, May 15, 2003 at 05:30:56PM +0530, Tapan Trivedi wrote:
> Hi all:
>
> I have started using postgreSQL for our internal systems which were
> running on MS SQL.
>
> I have a problem which I faced for my first cut tests on migration.
>
> My internal systems are developed using ASP and Java. While, I could
> access the database in postgreSQL, I have to pass the table names as
> "table_name" for all queries (in quotes). Is there something I have
> missed during the setup ?
>
> I do not want to think about getting into the code and changing all the
> queries :-(

If you use quotes it preserve case. So, if you use quotes when you create
the table, you may need quotes when you access the table. OTOH if you don't
use quotes when you create the table, you won't need them in the queries
either. Example:

create table HelloWorld (...);
select * from HelloWorld;     <-- WORKS
select * from helloworld;     <-- WORKS

create table "HelloWorld" (...);
select * from "HelloWorld";       <-- WORKS
select * from HelloWorld;         <-- FAILS
select * from helloworld;         <-- FAILS

Hope this helps,

--
Martijn van Oosterhout   <kleptog@svana.org>   http://svana.org/kleptog/
> "the West won the world not by the superiority of its ideas or values or
> religion but rather by its superiority in applying organized violence.
> Westerners often forget this fact, non-Westerners never do."
>   - Samuel P. Huntington

Вложения

В списке pgsql-general по дате отправления:

Предыдущее
От: Scott Chapman
Дата:
Сообщение: Python database adapter and stored procedures
Следующее
От: "culley harrelson"
Дата:
Сообщение: inheritance vs 1-1 relationship