Re: BUG #17195: Can't bind $1::int param when I use COPY TO STDOUT statement - libpq, C++ - Mailing list pgsql-bugs

From Tom Lane
Subject Re: BUG #17195: Can't bind $1::int param when I use COPY TO STDOUT statement - libpq, C++
Date
Msg-id 1552784.1632064109@sss.pgh.pa.us
Whole thread Raw
In response to BUG #17195: Can't bind $1::int param when I use COPY TO STDOUT statement - libpq, C++  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
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



pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #17194: Issue with pgoutput
Next
From: Tom Lane
Date:
Subject: Re: Query planning on partitioned table causes postgres 13.4 to consume all memory