#34719 [Opn]: Add proposal about the pg_query function documentation

From: Date: Mon, 03 Oct 2005 16:31:22 +0000
Subject: #34719 [Opn]: Add proposal about the pg_query function documentation
References: 1  Groups: php.doc 
Request: Send a blank email to phpdoc+get-969370435@lists.php.net to get a copy of this message
ID: 34719 Updated by: kouber@php.net Reported By: bouchon at alussinan dot org Status: Open Bug Type: Documentation problem PHP Version: Irrelevant New Comment: Actually, pg_query() automatically encloses everything in a transaction block, unless a transaction has already been started - in which case the queries again fit into one transaction. However, you're right - it would be good to mention that multiple queries could be passed to pg_query() and they all are executed as one transaction. Previous Comments: ------------------------------------------------------------------------ [2005-10-03 17:08:46] bouchon at alussinan dot org Description: ------------ Hello, I would like to propose to add a short explanation inside the documentation of the pg_query function, about transactions : ## Note that the pg_query() function can also take several queries embeded inside one transaction block. Example : $SQLQuery = 'BEGIN;'; $SQLQuery.= 'INSERT INTO a (a,b) VALUES (1,2);'; $SQLQuery.= 'INSERT INTO b (ref_b,c) VALUES (2,5);'; $SQLQuery.= 'COMMIT;'; $HandleResults = pg_query($SQLQuery); The essential point of a transaction is that it bundles multiple steps into a single, all-or-nothing operation. You can get more informations about transaction on http://www.postgresql.org/docs/8.0/interactive/tutorial-transactions.html ## I think that this feature should be mentionned inside the pg_query() function documentation. If this proposal is accepted, feel free to rewrite it in a better english. Kind regards, -- Bruno BAGUETTE - bouchon@alussinan.org (hardly filtered mail, but I read answers on the newsgroup) ------------------------------------------------------------------------ -- Edit this bug report at http://bugs.php.net/?id=34719&edit=1

« previous php.doc (#969370435) next »