Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRyQm-0003dH-BQ for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Sep 2021 15:08:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1mRyQl-0005HE-AT for pgsql-bugs@arkaria.postgresql.org; Sun, 19 Sep 2021 15:08:35 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRyQl-0005H6-3Y for pgsql-bugs@lists.postgresql.org; Sun, 19 Sep 2021 15:08:35 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1mRyQi-0005ta-Ts for pgsql-bugs@lists.postgresql.org; Sun, 19 Sep 2021 15:08:34 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.15.2/8.15.2) with ESMTP id 18JF8Tvr1552785; Sun, 19 Sep 2021 11:08:29 -0400 From: Tom Lane 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++ In-reply-to: <17195-895cc4ceea72abbd@postgresql.org> References: <17195-895cc4ceea72abbd@postgresql.org> Comments: In-reply-to PG Bug reporting form message dated "Sun, 19 Sep 2021 09:17:08 -0000" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <1552783.1632064109.1@sss.pgh.pa.us> Date: Sun, 19 Sep 2021 11:08:29 -0400 Message-ID: <1552784.1632064109@sss.pgh.pa.us> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk PG Bug reporting form 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