Re: How to ensure column names are double quoted while using execute format when building a stored procedure?

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
Cc: Shaozhong SHI <shishaozhong(at)gmail(dot)com>, pgsql-general <pgsql-general(at)lists(dot)postgresql(dot)org>
Subject: Re: How to ensure column names are double quoted while using execute format when building a stored procedure?
Date: 2021-12-16 22:15:42
Message-ID: 3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 12/16/21 14:11, David G. Johnston wrote:
> On Thu, Dec 16, 2021 at 3:04 PM Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com
> <mailto:adrian(dot)klaver(at)aklaver(dot)com>> wrote:
>
>
> This:
>
> 'count of nulls in "UNIQUE_REFERENCE_NUMBER"'
>
> is just plain incorrect syntax.
>
>
> <single quote>count of nulls in <double
> quote>UNIQUE_REFRENCE_NUMBER<double quote><single quote>
>
> That is not invalid syntax.  It is just literal single quoted text - the
> double quotes are simply characters in the string.

Alright I took it to be what followed:

count("""UNIQUE_REFERENCE_NUMBER""").

Now I see it is a tag for the count.

>
> David J.
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Mladen Gogala 2021-12-17 02:38:55 Re: Packages, inner subprograms, and parameterizable anonymous blocks for PL/pgSQL
Previous Message David G. Johnston 2021-12-16 22:11:52 Re: How to ensure column names are double quoted while using execute format when building a stored procedure?