Re: BUG #15927: PGresult *PQexecParams(..) not work on view - Mailing list pgsql-bugs

From Andres Freund
Subject Re: BUG #15927: PGresult *PQexecParams(..) not work on view
Date
Msg-id 20190726182144.ezu2rzad2uh2p5r2@alap3.anarazel.de
Whole thread Raw
In response to BUG #15927: PGresult *PQexecParams(..) not work on view  (PG Bug reporting form <noreply@postgresql.org>)
List pgsql-bugs
Hi,

On 2019-07-26 18:11:08 +0000, PG Bug reporting form wrote:
> create temp table ttt(a text)
> ...
> select * from ttt where a= $1
> create temp view vvv as select * from ttt where a= $1
> >ERROR: bind message supplies 1 parameters, but prepared statement ""
> requires 0

It's not really PQexecParams()'s fault that this doesn't work - we
simply do not support using parameters for DDL. And especially in a case
like this it seems unlikely that we will - what exactly would you expect
the created view to look like? I assume you think we'd change it so the
view references the value you supplied as a parameter as a literal
value? That seems like it'd be quite a bit of magic.

Greetings,

Andres Freund



pgsql-bugs by date:

Previous
From: PG Bug reporting form
Date:
Subject: BUG #15927: PGresult *PQexecParams(..) not work on view
Next
From: PG Bug reporting form
Date:
Subject: BUG #15928: Message no longer displaying rows affected with insert and update statements