Re: Query changes - Mailing list pgsql-general

From Martijn van Oosterhout
Subject Re: Query changes
Date
Msg-id 20030518014740.GB10998@svana.org
Whole thread Raw
In response to Query changes  (Tapan Trivedi <ttrivedi@webifyservices.com>)
List 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

Attachment

pgsql-general by date:

Previous
From: Scott Chapman
Date:
Subject: Python database adapter and stored procedures
Next
From: "culley harrelson"
Date:
Subject: inheritance vs 1-1 relationship