diff options
Diffstat (limited to 'ext/pgsql')
-rw-r--r-- | ext/pgsql/README | 68 | ||||
-rw-r--r-- | ext/pgsql/mysql_users.php | 14 | ||||
-rw-r--r-- | ext/pgsql/tests/README | 12 |
3 files changed, 47 insertions, 47 deletions
diff --git a/ext/pgsql/README b/ext/pgsql/README index 86df804fbd..26f7aad02d 100644 --- a/ext/pgsql/README +++ b/ext/pgsql/README @@ -1,27 +1,27 @@ ==== About This Module === -PostgreSQL module provides access to PostgreSQL server from +PostgreSQL module provides access to PostgreSQL server from PHP script. This module uses PostgreSQL C client lib called libpq. -It is important that you use libpq that is later than backend -(PostgreSQL Server) version. Otherwise, you may experience -strange problems. +It is important that you use libpq that is later than backend +(PostgreSQL Server) version. Otherwise, you may experience +strange problems. -Please send e-mail to yohgaki@php.net if you have comments for +Please send e-mail to yohgaki@php.net if you have comments for pgsql module. I appreciate your feedback. ==== API Change === -Older PHP than 4.2.0, pg_loimport()/pg_loexport() connection +Older PHP than 4.2.0, pg_loimport()/pg_loexport() connection parameter as last parameter, not like other functions. From 4.2.0, -connection parameter became 1st parameter. Old syntax is preserved, +connection parameter became 1st parameter. Old syntax is preserved, but it will raise NOTICE error message. pg_connect()/pg_pconnect() has obsolete multi parameter syntax. This syntax will be deleted in 4.3.0 or later. -Omitting connectin parameter is NOT recommended. Connection +Omitting connectin parameter is NOT recommended. Connection parameter may be required for future PHP version. Specify connection always if you don't want to rewrite code when it is changed. -==== Function Name Change ==== +==== Function Name Change ==== Function names are going to be changed to confirm coding standard. MySQL module has been done this already. Function names will be changed as follows. @@ -29,8 +29,8 @@ be changed as follows. pg_errormessage -> pg_error_message pg_cmdtuples -> pg_affected_rows pg_fieldnum -> pg_field_num -and so on. Except pg_cmdtuples, under scores '_' will be added to -names. +and so on. Except pg_cmdtuples, under scores '_' will be added to +names. Older names will become aliases of new functions for backward compatibility. @@ -39,14 +39,14 @@ Manual will be updated when this change is committed to CVS source. ==== Configure Option Notes ==== You cannot specify PostgreSQL source directly to build PostgreSQL -module with specific version. You need to install PostgreSQL +module with specific version. You need to install PostgreSQL somewhere in your system to build PHP with PostgreSQL support. ==== Note For PostgreSQL 7.2 ==== I've tested up to 7.2.2. ==== TODO List === -Make pg_convert() smater. +Make pg_convert() smater. - Better regex - User defiend type support Support async connection. @@ -57,7 +57,7 @@ WARNING: API/behavior may be changed without notice. Async query can improve application performance *significantly*. Please test and report any failure to -yohgaki@php.net +yohgaki@php.net There are some cases that async functions blocks process. Even if process was blocked, functions work as expected. (except it blocks @@ -65,13 +65,13 @@ process) These are cases that process is blocked. Refer to libpq manual for details. Followings are common cases that async functions are blocked. - - If libpq is compile with USE_SSL, some async functions are + - If libpq is compile with USE_SSL, some async functions are blocked. - - If libpq under Win32 is *NOT* compiled with - WIN32_NON_BLOCKING_CONNECTIONS, non-blocking connection will block. + - If libpq under Win32 is *NOT* compiled with + WIN32_NON_BLOCKING_CONNECTIONS, non-blocking connection will block. -Async function may also block if you have not retrive result and -send or execute query. If there is result left on connection, +Async function may also block if you have not retrive result and +send or execute query. If there is result left on connection, pg_send_query() will block until last query is completed. Garbages are cleaned when resource is cleaned up. There is no need to @@ -84,7 +84,7 @@ API may be changed. NOTE: These functions are added in PHP 4.2.0 unless they are mentioned. ------------------------------------------------------------------- -bool pg_send_query(resource connection, string query) +bool pg_send_query(resource connection, string query) Sends async query to backend. Result may be retrieved with pg_get_result(). It does not accept multiple query, but it accepts @@ -92,7 +92,7 @@ multiple queries at once. Each result may be retrieved separately by pg_get_result(). -------------------------------------------------------------------- -bool pg_cancel_query(resource connection) +bool pg_cancel_query(resource connection) Cancels currently executing async query already sent to PostgreSQL server. This function is useful when user request time consuming query @@ -100,7 +100,7 @@ to server. It cannot cancel query executed by pg_exec(), since pg_exec() is a blocking function. -------------------------------------------------------------------- -resource pg_get_result(resource conn) +resource pg_get_result(resource conn) Gets pgsql query result resource. Returned value can be fed to pg_result()/pg_fetch_*(). pg_get_result() may block if result is not @@ -112,7 +112,7 @@ in connection, it returns false. -------------------------------------------------------------------- bool pg_connection_busy(resource connection) -Returns connections is executing query or not. +Returns connections is executing query or not. -------------------------------------------------------------------- int pg_connection_status(resource connection) @@ -129,7 +129,7 @@ connection parameter. It's useful for error recovery. -------------------------------------------------------------------- string pg_result_error(resource result) -Get error message associated with result +Get error message associated with result -------------------------------------------------------------------- int pg_result_status(resource result) @@ -166,7 +166,7 @@ Large Object Functions -------------------------------------------------------------------- int pg_lo_tell(resource large_object) -Returns current position of large object +Returns current position of large object -------------------------------------------------------------------- bool pg_lo_lseek(resource large_object, int offset[, int whence]) @@ -179,7 +179,7 @@ Notice message function -------------------------------------------------------------------- string pg_last_notice(resource connection) -Returns the last notice set by the backend +Returns the last notice set by the backend This function is fully implemed in only in current CVS version. PHP 4.3.0 supposed to included fully implemented version. @@ -201,35 +201,35 @@ array pg_convert(resource db, string table, array values) -------------------------------------------------------------------- bool pg_insert(resource db, string table, array values[, bool convert[, bool async]]) - Insert values (filed=>value) to table + Insert values (filed=>value) to table -------------------------------------------------------------------- bool pg_update(resource db, string table, array fields, array ids[, bool convert[, bool async]]) - Update table using values (field=>value) and ids (id=>value) + Update table using values (field=>value) and ids (id=>value) -------------------------------------------------------------------- bool pg_delete(resource db, string table, array ids[, bool convert[, bool async]]) - Delete records has ids (id=>value) + Delete records has ids (id=>value) -------------------------------------------------------------------- array pg_select(resource db, string table, array ids[, bool convert]) - Select records that has ids (id=>value) + Select records that has ids (id=>value) -------------------------------------------------------------------- array pg_get_notify([resource db[, notify]]) - Get notify message on the connection + Get notify message on the connection -------------------------------------------------------------------- string pg_unescape_bytea(string bytea_data) - Unescape bytea field data + Unescape bytea field data -------------------------------------------------------------------- bool pg_ping(resource db) ping database connection and try to reset connection if it's - broken + broken ------------------------------------------------------------------- -Again, experimental functions are subject to be changed without +Again, experimental functions are subject to be changed without notice. diff --git a/ext/pgsql/mysql_users.php b/ext/pgsql/mysql_users.php index edfaa1cddc..44d4f1b66d 100644 --- a/ext/pgsql/mysql_users.php +++ b/ext/pgsql/mysql_users.php @@ -2,7 +2,7 @@ /* * File: mysql_users.php * Author: Yasuo Ohgaki <yohgaki@php.net> - * + * * This file contains example user defined functions that does * similar to MySQL functions. They can be implemented as module * functions, but there won't be many users need them. @@ -12,11 +12,11 @@ /* * mysql_list_dbs() - * - * This function should be needed, since PostgreSQL connection + * + * This function should be needed, since PostgreSQL connection * binds database. */ -function pg_list_dbs($db) +function pg_list_dbs($db) { assert(is_resource($db)); $query = ' @@ -24,7 +24,7 @@ SELECT d.datname as "Name", u.usename as "Owner", pg_encoding_to_char(d.encoding) as "Encoding" -FROM +FROM pg_database d LEFT JOIN pg_user u ON d.datdba = u.usesysid ORDER BY 1; '; @@ -35,7 +35,7 @@ ORDER BY 1; /* * mysql_list_tables() */ -function pg_list_tables($db) +function pg_list_tables($db) { assert(is_resource($db)); $query = " @@ -58,7 +58,7 @@ ORDER BY 1; * * See also pg_meta_data(). It returns field definition as array. */ -function pg_list_fields($db, $table) +function pg_list_fields($db, $table) { assert(is_resource($db)); $query = " diff --git a/ext/pgsql/tests/README b/ext/pgsql/tests/README index 1a29a34e64..5321d1f48d 100644 --- a/ext/pgsql/tests/README +++ b/ext/pgsql/tests/README @@ -1,15 +1,15 @@ -Test scripts assumes: +Test scripts assumes: - PostgreSQL server is installed locally - there is a PostgreSQL account for the users running the test scripts - there is database named "test" -For instance, if your login name is 'testuser', you should have PostgreSQL -user account named 'testuser' and grant that user access to the database +For instance, if your login name is 'testuser', you should have PostgreSQL +user account named 'testuser' and grant that user access to the database 'test'. -If you have account and database, type "createdb test" from command prompt -to create the database to execute the test scripts. By executing the above -command as the same user running the tests you ensure that the user is +If you have account and database, type "createdb test" from command prompt +to create the database to execute the test scripts. By executing the above +command as the same user running the tests you ensure that the user is granted access to the database. If you find problems in PostgreSQL module, please mail to |