Skip site navigation (1) Skip section navigation (2)

Re: BUG #3002: PQexecParams only supports some commands; needs improved error reporting, documenting or fixing

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Phil Endecott" <spam_from_postgresql_bugs(at)chezphil(dot)org>
Cc: pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #3002: PQexecParams only supports some commands; needs improved error reporting, documenting or fixing
Date: 2007-02-14 07:39:19
Message-ID: 19059.1171438759@sss.pgh.pa.us (view raw or flat)
Thread:
Lists: pgsql-bugs
"Phil Endecott" <spam_from_postgresql_bugs(at)chezphil(dot)org> writes:
> I understand that PQexecParams may only be used for SELECT, INSERT, DELETE
> and UPDATE commands, but not for other commands where parameter substitution
> might be useful such as CREATE VIEW and CREATE TABLE AS SELECT.  When I used
> PQexecParams with CREATE VIEW with one $ parameter I got no error
> immediately, but got a "no value found for parameter 1" error when I later
> ran a query that used the view.

As near as I can tell, your issue is that you haven't thought carefully
about what "$1" in a CREATE VIEW *means*.  Is it supposed to represent a
constant value bound into the view when it's created?  Is it supposed to
represent a value supplied whenever the view is used (if so, how do you
disambiguate when the query calling the view uses $1 for its own
purposes?).  Or something else?

Given defensible arguments for a particular answer to these definitional
questions, we might think about implementing something, but right now my
instinct is to not go there.  I'm not seeing a use-case that would
justify work on this.

			regards, tom lane

In response to

Responses

pgsql-bugs by date

Next:From: Tom LaneDate: 2007-02-14 07:54:10
Subject: Re: BUG #2996: to_char( timestamp, 'DD-Mon-YYYY HH24:MI:SS.MS' ) reports .1000 ms
Previous:From: Tom LaneDate: 2007-02-14 07:30:39
Subject: Re: BUG #3000: Linking problem

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group