From 8cd6b4541b7fa8625c02c6fce5df3943ae79f909 Mon Sep 17 00:00:00 2001 From: Sander Roobol Date: Wed, 10 Apr 2002 15:19:08 +0000 Subject: [PATCH] Fixed many typos, bad grammar and abused tags. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@77583 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/pgsql.xml | 448 +++++++++++++++++++++++--------------------- 1 file changed, 230 insertions(+), 218 deletions(-) diff --git a/functions/pgsql.xml b/functions/pgsql.xml index cfca250ed7..460f4b98df 100644 --- a/functions/pgsql.xml +++ b/functions/pgsql.xml @@ -1,63 +1,10 @@ - + PostgreSQL functions PostgreSQL - - - Use of PostgreSQL module with PHP 4.0.6 is not recommended due to - a bug in notice message handling. - - - - - PostgreSQL function names will be changed in 4.2.0 release to - confirm current coding standard. Most of new names will have - additional under score(s), e.g. pg_lo_open(). Some functions are - renamed to different name for consistency. e.g. pg_exec() to - pg_query(). Older names may be used in 4.2.0 and a few releases - from 4.2.0, but they may be deleted in the future. CVS version - has new function names. - - - Function names changed - - - - - - Obsolete pg_connect()/pg_pconnect() syntax will be depreciated to - support async connect feature in the future. Please use - connection string for pg_connect() and pg_pconnect(). - - Postgres, developed originally in the UC Berkeley Computer Science Department, pioneered many of the object-relational concepts now @@ -73,17 +20,136 @@ pg_loexport pg_lo_export feature. PostgreSQL supports many character encoding including multibyte character encoding. The current version and more information about PostgreSQL is available at www.postgresql.org. + url="&url.pgsql;">&url.pgsql;. In order to enable PostgreSQL support, - "--with-pgsql[=DIR]" is required when you compile + is required when you compile PHP. If shared object module is available, PostgreSQL module may be loaded using extension directive in &php.ini; or dl function. Supported ini directives are described in - php.ini-dist file which comes with source distribution. - + php.ini-dist which comes with source distribution. + + + + Using the PostgreSQL module with PHP 4.0.6 is not recommended due to + a bug in the notice message handling code. Use 4.1.0 or later. + + + + + PostgreSQL function names will be changed in 4.2.0 release to + confirm to current coding standards. Most of new names will have + additional underscores, e.g. pg_lo_open(). Some functions are + renamed to different name for consistency. e.g. pg_exec() to + pg_query(). Older names can be used in 4.2.0 and a few releases + from 4.2.0, but they may be deleted in the future. + + + Function names changed + + + + Old name + New name + + + + + pg_exec + pg_query + + + pg_getlastoid + pg_last_oid + + + pg_cmdtuples + pg_affected_rows + + + pg_numrows + pg_num_rows + + + pg_numfields + pg_num_fields + + + pg_fieldname + pg_field_name + + + pg_fieldsize + pg_field_size + + + pg_fieldnum + pg_field_num + + + pg_fieldptrlen + pg_field_ptrlen + + + pg_fieldisnull + pg_field_is_null + + + pg_freeresult + pg_free_result + + + pg_result + pg_fetch_result + + + pg_loreadall + pg_lo_read_all + + + pg_locreate + pg_lo_create + + + pg_lounlink + pg_lo_unlink + + + pg_loopen + pg_lo_unlink + + + pg_loclose + pg_lo_close + + + pg_loread + pg_lo_read + + + pg_lowrite + pg_lo_write + + + pg_loimport + pg_lo_import + + + pg_loexport + pg_lo_export + + + +
+ + The old pg_connect/pg_pconnect + syntax will be deprecated to support asynchronous connections in the + future. Please use a connection string for pg_connect + and pg_pconnect. + +
Not all functions are supported by all builds. It depends on your libpq (The PostgreSQL C Client interface) version and how libpq is @@ -98,7 +164,7 @@ pg_loexport pg_lo_export Since version 6.3 (03/02/1998) PostgreSQL uses unix domain sockets by default. TCP port will NOT be opened by default. A table is - shown below describing these new connection possibilities. This + shown below describing these new connection possibilities. This socket will be found in /tmp/.s.PGSQL.5432. This option can be enabled with the '-i' flag to postmaster and it's meaning is: "listen on @@ -108,36 +174,36 @@ pg_loexport pg_lo_export - Postmaster - PHP - Status + Postmaster + PHP + Status - postmaster & - pg_connect("dbname=MyDbName"); - OK + postmaster & + pg_connect("dbname=MyDbName"); + OK - postmaster -i & - pg_connect("dbname=MyDbName"); - OK + postmaster -i & + pg_connect("dbname=MyDbName"); + OK - postmaster & - pg_connect("host=localhost dbname=MyDbName"); - - Unable to connect to PostgreSQL server: connectDB() failed: - Is the postmaster running and accepting TCP/IP (with -i) - connection at 'localhost' on port '5432'? in - /path/to/file.php on line 20. - + postmaster & + pg_connect("host=localhost dbname=MyDbName"); + + Unable to connect to PostgreSQL server: connectDB() failed: + Is the postmaster running and accepting TCP/IP (with -i) + connection at 'localhost' on port '5432'? in + /path/to/file.php on line 20. + - postmaster -i & - pg_connect("host=localhost dbname=MyDbName"); - OK + postmaster -i & + pg_connect("host=localhost dbname=MyDbName"); + OK @@ -158,21 +224,21 @@ pg_loexport pg_lo_export has been deprecated. - Environmental variable affects PostgreSQL server/client + Environmental variables affect PostgreSQL server/client behavior. For example, PostgreSQL module will lookup PGHOST - environment variable when hostname is omitted in connection + environment variable when the hostname is omitted in the connection string. Supported environment variables are different from version to version. Refer to PostgreSQL Programmer's Manual (libpq - Environment Variables) for details. Make sure you set environment variables for appropriate user. Use - $_ENV or getenv to check - environment variables available to current process. + $_ENV or getenv to check + which environment variables are available to the current process. Setting default parameters - + - From PostgreSQL 7.1.0, text data type has 1GB as its max - size. Older PostgreSQL's text data type is limited by block - size. (Default 8KB. Max 32KB defined at compile time) + Starting with PostgreSQL 7.1.0, you can store up to 1GB into a + field of type text. In older versions, this was limited to the block + size (default was 8KB, maximum was 32KB, defined at compile time) To use the large object (lo) interface, it is required to enclose large object functions within a transaction block. A transaction - block starts with a SQL statement begin and if - the transaction was valid ends with commit or - end. If the transaction fails the transaction - should be closed with rollback or - abort. + block starts with a SQL statement BEGIN and if + the transaction was valid ends with COMMIT or + END. If the transaction fails the transaction + should be closed with ROLLBACK or + ABORT. Using Large Objects @@ -208,9 +274,9 @@ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD PGDATESTYLE PGTZ PGCLIENTENCOD $database = pg_connect ("dbname=jacarta"); pg_query ($database, "begin"); $oid = pg_lo_create ($database); - echo ("$oid\n"); + echo "$oid\n"; $handle = pg_lo_open ($database, $oid, "w"); - echo ("$handle\n"); + echo "$handle\n"; pg_lo_write ($handle, "large object data"); pg_lo_close ($handle); pg_query ($database, "commit"); @@ -218,8 +284,8 @@ export PGHOST PGPORT PGDATABASE PGUSER PGPASSWORD PGDATESTYLE PGTZ PGCLIENTENCOD ]]> - Do not close connection resource before closing large object - resource. + You should not close the connection to the PostgreSQL server + before closing the large object.
@@ -256,7 +322,7 @@ echo $cmdtuples . " tuples are affected."; - This function used called pg_cmdtuples(). + This function used to be called pg_cmdtuples(). @@ -285,9 +351,9 @@ echo $cmdtuples . " tuples are affected."; pg_connect opens a connection to a - PostgreSQL database specified by + PostgreSQL database specified by the connection_string. It returns a connection - resource on success. It returns &false;, if the connection could + resource on success. It returns &false; if the connection could not be made. connection_string should be a quoted string. @@ -317,17 +383,16 @@ $dbconn4 = pg_connect ($conn_string); If a second call is made to pg_connect with - the same connection_string arguments, no + the same connection_string, no new connection will be established, but instead, the connection resource of the already opened connection will be returned. You can have multiple connections to the same database if you use different connection string. - Syntax supports multiple parameters: + The old syntax with multiple parameters $conn = pg_connect ("host", "port", "options", "tty", "dbname") - - has been deprecated. + has been deprecated. See also pg_pconnect, @@ -353,64 +418,27 @@ $dbconn4 = pg_connect ($conn_string); pg_pconnect opens a connection to a - PostgreSQL database. It returns a connection resource that is + PostgreSQL database. It returns a connection resource that is needed by other PostgreSQL functions. - It returns a connection resource on success, or &false; if the - connection could not be made. The arguments should be within a - quoted string. The arguments available include - host, port, - tty, options, - dbname, user, and - password. - - - Using pg_pconnect - - -]]> - - - - If a second call is made to pg_pconnect with - the same arguments, no new connection will be established, but - instead, the connection resource of the already opened connection - will be returned. You can have multiple connections to the same - database if you use different connection string. + For a description of the connection_string + parameter, see pg_connect. - Multiple parameters syntax for pg_pconnect - $conn = pg_pconnect ("host", "port", "options", "tty", - "dbname") - - has been deprecated. - - - To enable persistent connection, pgsql.allow_persistent - &php.ini; directive must be set to "On". (Default is On) - Max number of persistent connection can be defined by pgsql.max_persistent - &php.ini; directive. (Default is -1 which is no limit) Total number - of connection can be set by pgsql.max_links &php.ini; directive. pg_close will not close persistent links - generated by pg_pconnect. + generated by pg_pconnect. See also pg_connect. @@ -434,11 +462,9 @@ $dbconn4 = pg_connect ($conn_string); resourceconnection - pg_connection_busy returns &true; if - connection busy. If connection is busy, previously sent query to - PostgreSQL server is still executing. If - pg_get_result is called, - pg_get_result will block. + pg_connection_busy returns &true; if the + connection is busy. If it's is busy, a previous query is still executing. + If pg_get_result is called, it will be blocked. See also pg_connection_status and @@ -463,10 +489,8 @@ $dbconn4 = pg_connect ($conn_string); resourceconnection - pg_connection_reset reset connection with - the same parameter when connection is made. It is useful for - error recovery. It returns &true; if it resets connection - successfully, otherwise returns &false;. + pg_connection_reset resets the connection. + It is useful for error recovery. &return.success; See also pg_connect, @@ -493,11 +517,11 @@ $dbconn4 = pg_connect ($conn_string); pg_connection_status returns a connection - status. Possible status is PGSQL_CONNECTION_OK - or PGSQL_CONNECTION_BAD. + status. Possible statuses are PGSQL_CONNECTION_OK + and PGSQL_CONNECTION_BAD. - See also pg_connection_busy + See also pg_connection_busy. @@ -516,19 +540,15 @@ $dbconn4 = pg_connect ($conn_string); resourceconnection - pg_close closes down the non-persistent + pg_close closes the non-persistent connection to a PostgreSQL database associated with the given - connection resource. It returns &true;, if - connection is a valid connection resource, - otherwise it return &false;. + connection resource. &return.success; - pg_close is not usually necessary, as - non-persistent open links are automatically closed at the end of - the script's execution. pg_close will not - close persistent links generated by - pg_pconnect. + Using pg_close is not usually necessary, as + non-persistent open connections are automatically closed at the end + of the script. @@ -544,7 +564,7 @@ $dbconn4 = pg_connect ($conn_string); pg_copy_from - Copy table from array + Copy a table from an array @@ -558,8 +578,8 @@ $dbconn4 = pg_connect ($conn_string); stringnull_as - pg_copy_from copy table from array. It - return &true; for success, otherwise &false;. + pg_copy_from copies a table from an array. + &return.success; See also pg_copy_to @@ -573,7 +593,7 @@ $dbconn4 = pg_connect ($conn_string); pg_copy_to - Copy table to array + Copy a table to an array @@ -586,9 +606,8 @@ $dbconn4 = pg_connect ($conn_string); stringnull_as - pg_copy_to copy table to array. The result - array is returned if it success to copy. Otherwise it returns - &false;. + pg_copy_to copies a table to an array. The + resulting array is returned. It returns &false; on failure. See also pg_copy_from @@ -610,13 +629,12 @@ $dbconn4 = pg_connect ($conn_string); resourceconnection - pg_end_copy syncs PostgreSQL frontend + pg_end_copy syncs the PostgreSQL frontend (usually a web server process) with the PostgreSQL server after doing a copy operation performed by pg_put_line. pg_end_copy - must be issued, otherwise the PostgreSQL server may get "out of - sync" error with the frontend. It returns &true; for success, - otherwise it returns &false;. + must be issued, otherwise the PostgreSQL server may get out of + sync with the frontend and will report an error. &return.success; For further details and an example, see also @@ -644,13 +662,12 @@ $dbconn4 = pg_connect ($conn_string); to the PostgreSQL backend server. This is useful for example for very high-speed inserting of data into a table, initiated by starting a PostgreSQL copy-operation. That final NULL-character - is added automatically. It returns &true; if successful, &false; - otherwise. + is added automatically. &return.success; - Note the application must explicitly send the two characters "\." - on a final line to indicate to the backend that it has finished + The application must explicitly send the two characters "\." + on the last line to indicate to the backend that it has finished sending its data. @@ -689,26 +706,21 @@ $dbconn4 = pg_connect ($conn_string); stringpg_last_error resourceconnection - - pg_last_error returns a string containing - the last error message for given - connection. It returns &false; on failure. - pg_last_error returns the last error - message for given connection and error - message may be overwritten if other libpq functions are called on - the connection. PostgreSQL functions calls libpq functions - internally. Therefore, details about the error may not be - retrieved using the pg_last_error - function. pg_result_error_message() will be added from 4.2.0 to - get last error for the result resource. + message for given connection. Errormessages + may be overwritten by calls to other PostgreSQL functions, so make + sure you call pg_last_error before any other + PostgreSQL functions. - This function used called pg_errormessage(). + This function used to be called pg_errormessage(). + + See also pg_result_error_message. + @@ -792,7 +804,7 @@ $dbconn4 = pg_connect ($conn_string); - This function used called pg_getlastoid(). + This function used to be called pg_getlastoid(). @@ -848,7 +860,7 @@ $dbconn4 = pg_connect ($conn_string); - This function used called pg_exec(). + This function used to be called pg_exec(). @@ -1208,7 +1220,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_fieldisnull(). + This function used to be called pg_fieldisnull(). @@ -1236,7 +1248,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_fieldname(). + This function used to be called pg_fieldname(). @@ -1268,7 +1280,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_fieldnum(). + This function used to be called pg_fieldnum(). @@ -1300,7 +1312,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_field_prtlen(). + This function used to be called pg_field_prtlen(). @@ -1334,7 +1346,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_fieldsize(). + This function used to be called pg_fieldsize(). @@ -1367,7 +1379,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_field_type(). + This function used to be called pg_field_type(). @@ -1402,7 +1414,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_field_len(). + This function used to be called pg_field_len(). @@ -1435,7 +1447,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_loclose(). + This function used to be called pg_loclose(). @@ -1478,7 +1490,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_locreate(). + This function used to be called pg_locreate(). @@ -1511,7 +1523,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_loexport(). + This function used to be called pg_loexport(). @@ -1547,7 +1559,7 @@ for ($i=0; $i < $num; $i++) { ¬e.sm.uidcheck; - This function used called pg_loimport(). + This function used to be called pg_loimport(). @@ -1592,7 +1604,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_loopen(). + This function used to be called pg_loopen(). @@ -1630,7 +1642,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_loraed(). + This function used to be called pg_loread(). @@ -1720,7 +1732,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_loreadall(). + This function used to be called pg_loreadall(). @@ -1754,7 +1766,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_lo_unlink(). + This function used to be called pg_lo_unlink(). @@ -1791,7 +1803,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_lo_write(). + This function used to be called pg_lo_write(). @@ -1823,7 +1835,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_numfields(). + This function used to be called pg_numfields(). @@ -1861,7 +1873,7 @@ for ($i=0; $i < $num; $i++) { - This function used called pg_num_rows(). + This function used to be called pg_num_rows().