Hi,

Attached is a patch that brings PostgreSQL support in PHP out of the stone age!

It adds a five new functions:

* pg_query_params

Allows paramaterised queries (ie. no escaping required). This really is just a libpq shortcut for prepare/execute

libpq function: PQexecParams

* pg_prepare

Creates a named prepared query

libpq function: PQprepare

* pg_execute

Executes a named prepared query

libpq function: PQexecPrepared

* pg_transaction_status

Returns transaction status of a connection

libpq function: PQtransactionStatus

* pg_result_error_field

Allows getting advanced diagnostics on errors, most importantly allows getting the SQLSTATE error code on errors, therefore finally pgsql users can identify errors by ID.

libpq function: PQresultErrorField

Notes
-----

I haven't attached docs or regression tests, these will follow if the patch is accepted (or before if you require)

Should pg_query_params instead be folded into pg_query, with an optional 3rd parameter which would be the parameter array? Would this then be difficult for clients to detect if the 3rd parameter is available to them?

I've tested it all and seems to work fine, please review :)

Cheers,

Chris

Attachment: ext-pgsql.txt.gz
Description: GNU Zip compressed data

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

Reply via email to