Re: rationale behind quotes for camel case?

Поиск
Список
Период
Сортировка
От Merlin Moncure
Тема Re: rationale behind quotes for camel case?
Дата
Msg-id BANLkTintjDtU-f8QeMTp5hSgLSdhZOt01A@mail.gmail.com
обсуждение исходный текст
Ответ на rationale behind quotes for camel case?  (fluca1978@infinito.it)
Ответы Re: rationale behind quotes for camel case?
Список pgsql-general
On Tue, Jun 28, 2011 at 4:12 AM,  <fluca1978@infinito.it> wrote:
> Hi all,
> first of all I'm not expressing any critique against the use of quotes for
> identifier expressed using camel case. However a lot of new postgresql users
> seems to be unhappy with the use of quotes for camel case identifiers, so
> I'd like to know what is the rationale behind it.

A few reasons:
*) aesthetics: given two queries that express the same thing, I'd
prefer the one with no " vs lots of ".  Quoted identifiers do not
increase code clarity nor provide any technical benefit beyond being
able to mix identifiers by case, which most would agree is a terrible
idea.
*) once you decide to quote your identifiers like that, you have to
always do it.  not just formal code, but queries in psql, etc. having
to type it out all the time is time consuming and distracting. (by the
way, I switched to lower case keywords a long time ago on similar
grounds)
*) lousy tools: sooner or later you may bump into a tool that
generates sql improperly without the quoted identifiers.

The rebuttal to the above points is that the problem with not quoting
is that your identifiers are folded to lower case on the server which
can make them difficult to read in psql, pgadmin, etc. when outputted.
 This is true and I consequently use underscores to break up words in
my personal style (order_number, not OrderNumber), avoiding that
problem.  Some people don't like it, but it is the easiest to type,
the most tool friendly, and most regular.

merlin

В списке pgsql-general по дате отправления:

Предыдущее
От: John R Pierce
Дата:
Сообщение: Re: rationale behind quotes for camel case?
Следующее
От: Adrian Klaver
Дата:
Сообщение: Re: Gist Index: Problem getting data in GiST Support Functions "penalty".