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

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: stankiewiczal(at)gmail(dot)com
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org
Subject: Re: BUG #17195: Can't bind $1::int param when I use COPY TO STDOUT statement - libpq, C++
Date: 2021-09-19 15:08:29
Message-ID: 1552784.1632064109@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

PG Bug reporting form <noreply(at)postgresql(dot)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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message Tom Lane 2021-09-19 16:03:04 Re: Query planning on partitioned table causes postgres 13.4 to consume all memory
Previous Message Tom Lane 2021-09-19 15:04:10 Re: BUG #17194: Issue with pgoutput