pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Lele Gaifax <lele@metapensiero.it>
Cc: pgsql-general@postgresql.org <pgsql-general@postgresql.org>
Subject: Re: Parameter placeholders, $n vs ?
Date: Thu, 24 May 2018 10:02:57 -0400
Message-ID: <24317.1527170577@sss.pgh.pa.us> (raw)
In-Reply-To: <CAKFQuwYh=fk31_2DJFDGe1D4UoBP2KThPTaPznZCV5HJ5Lha8g@mail.gmail.com>
References: <87o9h5bjhs.fsf@metapensiero.it>
	<CAKFQuwYh=fk31_2DJFDGe1D4UoBP2KThPTaPznZCV5HJ5Lha8g@mail.gmail.com>

"David G. Johnston" <david.g.johnston@gmail.com> writes:
> On Thursday, May 24, 2018, Lele Gaifax <lele@metapensiero.it> wrote:
>> So the questions: is the '?' style placeholder a supported variant? and
>> if so, should the ParamRef doc tell something about that?

> PostgreSQL's Prepare statement doesn't accept question mark as a parameter
> symbol, and cannot ever because it is already a valid operator symbol.

To enlarge on that a bit:

* PG's core parser certainly does not accept ? as a parameter symbol.
I speculate that you fed the input through some frontend that converts
? to $n (JDBC, perhaps)?

* The only thing in the core code that would print a ParamRef in any
sort of symbolic form is _outParamRef, and it's easily seen by inspection
to be incapable of omitting the "number" field ... not to mention that
it doesn't emit the JSON-esque representation you're showing us.  So
that behavior must also be due to some non-core pretty-printing code you
haven't identified to us.  No idea what rules that might have for deciding
to omit "number".

			regards, tom lane




view thread (4+ messages)  latest in thread

Message-ID: <24317.1527170577@sss.pgh.pa.us>
Permalink:  ../24317.1527170577@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/24317.1527170577@sss.pgh.pa.us

 · 

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: tgl@sss.pgh.pa.us, david.g.johnston@gmail.com, lele@metapensiero.it
  Subject: Re: Parameter placeholders, $n vs ?
  In-Reply-To: <24317.1527170577@sss.pgh.pa.us>
  References: <87o9h5bjhs.fsf@metapensiero.it> <CAKFQuwYh=fk31_2DJFDGe1D4UoBP2KThPTaPznZCV5HJ5Lha8g@mail.gmail.com> <24317.1527170577@sss.pgh.pa.us>

* 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