pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Shaozhong SHI <shishaozhong@gmail.com>
Cc: pgsql-general <pgsql-general@lists.postgresql.org>
Subject: Re: How to ensure column names are double quoted while using execute format when building a stored procedure?
Date: Thu, 16 Dec 2021 14:15:42 -0800
Message-ID: <3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com> (raw)
In-Reply-To: <CAKFQuwZ-5VyPiFLPVYZcH-37g513OuJvj6kHkw_skfKyW1yFQA@mail.gmail.com>
References: <CA+i5JwYMbWKoJcP-o4HOY-G1YegxGs2FE0bWDanEF5g2WRj5yQ@mail.gmail.com>
	<CAKFQuwbGYaCzAhyqu2FMB6xVYMNBjWEGRiGz873AnzMysF9a5w@mail.gmail.com>
	<CA+i5JwbDUx6kWe5bkWJkHJjEVOEuojWJSxLfnxDQ5Cj_+v7XnQ@mail.gmail.com>
	<e7c25fae-fc9b-1964-3294-3ae478f2e286@aklaver.com>
	<CAKFQuwZ-5VyPiFLPVYZcH-37g513OuJvj6kHkw_skfKyW1yFQA@mail.gmail.com>

On 12/16/21 14:11, David G. Johnston wrote:
> On Thu, Dec 16, 2021 at 3:04 PM Adrian Klaver <adrian.klaver@aklaver.com 
> <mailto:adrian.klaver@aklaver.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.klaver@aklaver.com





view thread (9+ messages)

Message-ID: <3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com>
Permalink:  ../3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com/
Also on:    postgresql.org/message-id/3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, david.g.johnston@gmail.com, shishaozhong@gmail.com
  Subject: Re: How to ensure column names are double quoted while using execute format when building a stored procedure?
  In-Reply-To: <3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com>
  References: <CA+i5JwYMbWKoJcP-o4HOY-G1YegxGs2FE0bWDanEF5g2WRj5yQ@mail.gmail.com> <CAKFQuwbGYaCzAhyqu2FMB6xVYMNBjWEGRiGz873AnzMysF9a5w@mail.gmail.com> <CA+i5JwbDUx6kWe5bkWJkHJjEVOEuojWJSxLfnxDQ5Cj_+v7XnQ@mail.gmail.com> <e7c25fae-fc9b-1964-3294-3ae478f2e286@aklaver.com> <CAKFQuwZ-5VyPiFLPVYZcH-37g513OuJvj6kHkw_skfKyW1yFQA@mail.gmail.com> <3d76aa2d-0e1e-8cff-49de-93be10a2a5ea@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox