Re: Camel case identifiers and folding

From: Chris Travers <chris(dot)travers(at)gmail(dot)com>
To: Steve Haresnape <s(dot)haresnape(at)creativeintegrity(dot)co(dot)nz>
Cc: Postgres General <pgsql-general(at)postgresql(dot)org>
Subject: Re: Camel case identifiers and folding
Date: 2019-03-18 12:16:15
Message-ID: CAKt_Zfv9zxq9Hba+tTE5Euj+W4vq4vbmJ0gHrT12ifNAtPma_g@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Thu, Mar 14, 2019 at 11:07 PM Steve Haresnape <
s(dot)haresnape(at)creativeintegrity(dot)co(dot)nz> wrote:

> I'm porting a sql server database to postgresql 9.6. My camelCase
> identifiers are having their humps removed. This is disconcerting and sad.
>
> Is there a cure for this?
>

Double quote them.

>
> I don't want to quote my identifiers unless I have to. I don't want to use
> underscores. Everywhere else I write code I use camel case. I makes me feel
> warm inside.
>

The SQL standard mandates case folding. We don't quite follow the standard
(which mandates folding to upper case) because nobody here likes that, and
so we fold to lower case. In most cases, however, our behavior is close to
that of the standard.

>
> This is folding in the same sense Procrustes folded his guests to fit his
> bed.
>
> The sql standard has some dumb stuff in it. Do not appeal to it. It can be
> safely ignored in this regard (by Microsoft, and anyone else wishing to
> prevent the propagation of stupidity).
>

MySQL also ignores the standard and does not fold cases. You can weigh
this point vs what you give up by going that direction.....

>
> The only mechanism available to put any semantics into the database is via
> the naming of identifiers. Why screw with that? Imagine what would happen
> if your IDE decided to do that to your java code.
>
>
> Different languages address case and identifiers differently, no?

Why should PostgreSQL follow a Java standard?

--
Best Wishes,
Chris Travers

Efficito: Hosted Accounting and ERP. Robust and Flexible. No vendor
lock-in.
http://www.efficito.com/learn_more

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Chris Travers 2019-03-18 12:20:59 Re: Fwd: Camel case identifiers and folding
Previous Message Morris de Oryx 2019-03-18 11:20:11 Re: Camel case identifiers and folding