Re: Why are quotes required around table / column names in SQL statements? - Mailing list pgsql-general

From Joel Burton
Subject Re: Why are quotes required around table / column names in SQL statements?
Date
Msg-id Pine.LNX.4.21.0104080129410.11864-100000@olympus.scw.org
Whole thread Raw
In response to Why are quotes required around table / column names in SQL statements?  ("Wade Burlingame" <bad@dog.bad>)
List pgsql-general
On Mon, 2 Apr 2001, Wade Burlingame wrote:

> ...and is there any way I can get rid of this requirement?  I'm just getting
> into PGSQL and I find the quotes very distracting.

The quotes are only *needed* around tables/columns/etc if they contain
characters not in the alphanumeric set, or if it conflicts with a reserved
word.

So, one can say

  CREATE TABLE foo

but must use quotes for

  CREATE TABLE "foo is the word"

or

  CREATE TABLE "table"

or such.

The only time you normally see them (if you haven't used them) is w/tools
like pg_dump. And there's a command-line switch to not show them if not
neccssary, IIRC.


HTH,
--
Joel Burton   <jburton@scw.org>
Director of Information Systems, Support Center of Washington


pgsql-general by date:

Previous
From: Armin Preis
Date:
Subject: Re: JDBC
Next
From: Doug McNaught
Date:
Subject: Re: Why are quotes required around table / column names in SQL statements?