SQL: Are the "" around table & coloumnames necessary?

Started by Nonameabout 24 years ago5 messagesgeneral
Jump to latest
#1Noname
mikey.unsafe@gmx.net

Hello,

when I write a select for example,
it doesn't work this way:

select col1, col2
from my_table;

instead of that I have to write

select "col1", "col2"
from "my_table";

I dont understand this...is there a way to use
the more comfortable form without "" ?

thx

...Mike

#2Samik Raychaudhuri
samik@cae.wisc.edu
In reply to: Noname (#1)
Re: SQL: Are the "" around table & coloumnames necessary?

Are you using psql or any other program interface to write queries? For
me the queries does work without quotes around column-names.
HTH. Regards.
-Samik

Mikey wrote:

Show quoted text

Hello,

when I write a select for example,
it doesn't work this way:

select col1, col2
from my_table;

instead of that I have to write

select "col1", "col2"
from "my_table";

I dont understand this...is there a way to use
the more comfortable form without "" ?

thx

...Mike

#3Command Prompt, Inc.
pgsql-general@commandprompt.com
In reply to: Samik Raychaudhuri (#2)
Re: SQL: Are the "" around table & coloumnames necessary?

If the column names are capitalized they are required.

On Mon, 18 Feb 2002, Samik Raychauhduri wrote:

Are you using psql or any other program interface to write queries? For
me the queries does work without quotes around column-names.
HTH. Regards.
-Samik

Mikey wrote:

Hello,

when I write a select for example,
it doesn't work this way:

select col1, col2
from my_table;

instead of that I have to write

select "col1", "col2"
from "my_table";

I dont understand this...is there a way to use
the more comfortable form without "" ?

thx

...Mike

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/users-lounge/docs/faq.html

--
--
by way of pgsql-general@commandprompt.com
http://www.postgresql.info/
http://www.commandprompt.com/

#4Noname
mikey.unsafe@gmx.net
In reply to: Noname (#1)
Re: SQL: Are the "" around table & coloumnames necessary?

I have to use quotes at psql, pgadmin II and
other interfaces...
The postgresql 7.2 backend is on SuSE 7.0
I also have a 7.1.3 installation on a RedHat 7.1
and there I HAVENT to use quotes!
...I dont know why...

Samik Raychauhduri <samik@cae.wisc.edu> wrote in message news:<3C71B2C4.3050305@cae.wisc.edu>...

Show quoted text

Are you using psql or any other program interface to write queries? For
me the queries does work without quotes around column-names.
HTH. Regards.
-Samik

#5Doug McNaught
doug@wireboard.com
In reply to: Noname (#1)
Re: SQL: Are the "" around table & coloumnames necessary?

mikey.unsafe@gmx.net (Mikey) writes:

Hello,

when I write a select for example,
it doesn't work this way:

select col1, col2
from my_table;

instead of that I have to write

select "col1", "col2"
from "my_table";

I dont understand this...is there a way to use
the more comfortable form without "" ?

Double-quotes should only be necessary if your table names are
MixedCase.

-Doug
--
Let us cross over the river, and rest under the shade of the trees.
--T. J. Jackson, 1863