pg.ddx.io  pgsql-bugs@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Tom Lane <tgl@sss.pgh.pa.us>
To: stankiewiczal@gmail.com
Cc: pgsql-bugs@lists.postgresql.org
Subject: Re: BUG #17195: Can't bind $1::int param when I use COPY TO STDOUT statement - libpq, C++
Date: Sun, 19 Sep 2021 11:08:29 -0400
Message-ID: <1552784.1632064109@sss.pgh.pa.us> (raw)
In-Reply-To: <17195-895cc4ceea72abbd@postgresql.org>
References: <17195-895cc4ceea72abbd@postgresql.org>

PG Bug reporting form <noreply@postgresql.org> writes:
>     auto sql = "COPY(SELECT version_ts FROM test_point WHERE serie_id =
> $1::int) TO STDOUT (FORMAT binary)";

Don't hold your breath for that to work :-(.  Utility statements in
general do not support parameterization.  COPY is not an exception,
even when it contains what looks like a full DML command.  Maybe
somebody will improve that someday, but we'll certainly treat it
as a new feature not a bug fix.

			regards, tom lane





view thread (2+ messages)

Message-ID: <1552784.1632064109@sss.pgh.pa.us>
Permalink:  ../1552784.1632064109@sss.pgh.pa.us/
Also on:    postgresql.org/message-id/1552784.1632064109@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 using the --to and --cc options:
  reply via email

  To: pgsql-bugs@postgresql.org
  Cc: tgl@sss.pgh.pa.us, stankiewiczal@gmail.com, pgsql-bugs@lists.postgresql.org
  Subject: Re: BUG #17195: Can't bind $1::int param when I use COPY TO STDOUT statement - libpq, C++
  In-Reply-To: <1552784.1632064109@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