Re: How to run queries without double quotes on tables and columns

From: Thom Brown <thombrown(at)gmail(dot)com>
To: Susan M Farley <sfarley1(at)gmu(dot)edu>
Cc: pgsql-novice(at)postgresql(dot)org
Subject: Re: How to run queries without double quotes on tables and columns
Date: 2009-10-11 02:41:23
Message-ID: bddc86150910101941o37d8baffp97d4617469ebed83@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

If your object (table, column, view etc) have mixed-case names (e.g.
My_Table instead of my_table), you need to quote them. If you have a table
called My_Table but use [SELECT * FROM My_Table;] it won't match as it is
treated as if it is all lower-case unless you quote it. In that case, you'd
have to use [SELECT * FROM "My_Table";]. The same applies to any database
object.
Regards

Thom

2009/10/11 Susan M Farley <sfarley1(at)gmu(dot)edu>

> Sorry, I'm really new to PostgreSQL and am used to Oracle. In function and
> in regular queries, I usually have to have double quotes (") around the
> names of columns and table names. Otherwise, I get an error that the schema,
> table, or column doesn't exist. I don't always have to though. Sometimes the
> function works just fine without them even though I am working with the same
> table and schema. What am I doing wrong?
>
> Thank you,
> Susan
>
> --
> Sent via pgsql-novice mailing list (pgsql-novice(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-novice
>

In response to

Browse pgsql-novice by date

  From Date Subject
Next Message Tom Lane 2009-10-11 02:42:43 Re: How to run queries without double quotes on tables and columns
Previous Message Susan M Farley 2009-10-11 01:30:59 How to run queries without double quotes on tables and columns