Re: BUG #15927: PGresult *PQexecParams(..) not work on view

From: Andres Freund <andres(at)anarazel(dot)de>
To: PG Bug reporting form <noreply(at)postgresql(dot)org>
Cc: pgsql-bugs(at)lists(dot)postgresql(dot)org, pm_fon(at)mail(dot)ru
Subject: Re: BUG #15927: PGresult *PQexecParams(..) not work on view
Date: 2019-07-26 18:21:44
Message-ID: 20190726182144.ezu2rzad2uh2p5r2@alap3.anarazel.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2019-07-26 18:21:53 BUG #15928: Message no longer displaying rows affected with insert and update statements
Previous Message PG Bug reporting form 2019-07-26 18:11:08 BUG #15927: PGresult *PQexecParams(..) not work on view