Hi.

Current pgsql.c supports prepared statement, but pg_execute() will raise
E_WARNING if query plan is not prepared yet. This is annoying when
database connection is persistent under web environment.

I would like to do something like

if (!pg_execute($db, 'myquery', array()) {
   pg_prepare($db, 'myquery', 'SQL');
   pg_execute($db, 'myquery', array();
}

WITHOUT raising any error, since @ operator does not work well with
error handler. (i.e. need special handling for pg_execute)

There are 4 options:

1) just ignore errors on pg_execute(). errors can be identified by return 
status anyway.
2) add pg_is_prepared()
3) add bool parameter to pg_execute()
   e.g. pg_execute(resource connection, string stmtname, array params, bool 
ignore_error)
4) ignore pg_execute() error if params is null array.

Any comments?

-- 
Yasuo Ohgaki

-- 
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to