On Tue, Jun 28, 2011 at 4:12 AM,  <fluca1...@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

-- 
Sent via pgsql-general mailing list (pgsql-general@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general

Reply via email to