Re: Trigger function cannot reference field name with capital letter

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Patrick Dung <patrick_dkt(at)yahoo(dot)com(dot)hk>
Cc: John R Pierce <pierce(at)hogranch(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: Trigger function cannot reference field name with capital letter
Date: 2014-08-14 06:20:29
Message-ID: CAFj8pRBg_WY6cjkFv4pss4jiPekFZWU+EDTSWc82gzAe+mdogw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Hi

2014-08-14 8:10 GMT+02:00 Patrick Dung <patrick_dkt(at)yahoo(dot)com(dot)hk>:

> Thanks all for the help.
>
> BTW, letter casing is just a preference.
> Some people liked to use all small caps, some liked to use all big caps.
> I sometimes found that mixed case is more meaningful for the filed (eg.
> serialnumber vs serialNumber)
>
> What is your preference or suggestion?
>

Camel notation is not practical for SQL identifiers - SQL is not case
sensitive, but there are possible exception when you use double quotes. And
then usually you can hit a situation when one identifier is in one
situation case sensitive and elsewhere it is translated to lowercase. It
is not bug, it has usually good reasons, but it is terrible issue for
beginners. So SQL identifiers should be in lowercase or uppercase.
Uppercase has bigger sense on Oracle, lowercase on PostgreSQL.

Regards

Pavel

>
>
> On Thursday, August 14, 2014 12:18 PM, John R Pierce <
> pierce(at)hogranch(dot)com> wrote:
>
>
> On 8/13/2014 9:13 PM, John R Pierce wrote:
> >
> > SELECT * from tbl1 where new."postTimestamp' > timestamp '2014-01-01
> > 00:00:00'
>
> oops.
>
> SELECT * from tbl1 where new."postTimestamp" > timestamp '2014-01-01
> 00:00:00'
>
> I meant. I should proof what I write, hah!
>
>
>
> --
> john r pierce 37N 122W
> somewhere on the middle of the left coast
>
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
>
>

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Alban Hertroys 2014-08-14 06:49:30 Re: Pass where clause to a function
Previous Message Patrick Dung 2014-08-14 06:18:26 Re: PostgreSQL on AIX platform