Re: rationale behind quotes for camel case? - Mailing list pgsql-general

From Merlin Moncure
Subject Re: rationale behind quotes for camel case?
Date
Msg-id BANLkTintjDtU-f8QeMTp5hSgLSdhZOt01A@mail.gmail.com
Whole thread Raw
In response to rationale behind quotes for camel case?  (fluca1978@infinito.it)
Responses Re: rationale behind quotes for camel case?
List 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 by date:

Previous
From: John R Pierce
Date:
Subject: Re: rationale behind quotes for camel case?
Next
From: Adrian Klaver
Date:
Subject: Re: Gist Index: Problem getting data in GiST Support Functions "penalty".