Re: Query changes

From: Martijn van Oosterhout <kleptog(at)svana(dot)org>
To: Tapan Trivedi <ttrivedi(at)webifyservices(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Query changes
Date: 2003-05-18 01:47:40
Message-ID: 20030518014740.GB10998@svana.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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(at)svana(dot)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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message culley harrelson 2003-05-18 04:36:33 inheritance vs 1-1 relationship
Previous Message Evan Lurie 2003-05-17 22:34:07 Issues with DBD::Pg on OS X 10.2