Re: Why are quotes required around table / column names in SQL statements?

Поиск
Список
Период
Сортировка
От Joel Burton
Тема Re: Why are quotes required around table / column names in SQL statements?
Дата
Msg-id Pine.LNX.4.21.0104080129410.11864-100000@olympus.scw.org
обсуждение исходный текст
Ответ на Why are quotes required around table / column names in SQL statements?  ("Wade Burlingame" <bad@dog.bad>)
Список 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 по дате отправления:

Предыдущее
От: Armin Preis
Дата:
Сообщение: Re: JDBC
Следующее
От: Doug McNaught
Дата:
Сообщение: Re: Why are quotes required around table / column names in SQL statements?