From 93c0ce6202a3a664e8430aff74861847f1937e1d Mon Sep 17 00:00:00 2001 From: Yasuo Ohgaki Date: Sun, 20 Jan 2002 09:03:41 +0000 Subject: [PATCH] Added renamed function list. Added new functions descriptions. Removed obsolete function refs created by mistake. Added description for optional row parameters for pg_fetch_*() 4.1.0 or later. git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@68190 c90b9560-bf6c-de11-be94-00142212c4b1 --- functions/pgsql.xml | 366 ++++++++++++++++++++++++++++++++------------ 1 file changed, 270 insertions(+), 96 deletions(-) diff --git a/functions/pgsql.xml b/functions/pgsql.xml index 147ec46a4d..6821f18614 100644 --- a/functions/pgsql.xml +++ b/functions/pgsql.xml @@ -1,5 +1,5 @@ - + PostgreSQL functions PostgreSQL @@ -21,9 +21,41 @@ 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() may be depreciated to support - async connect feature in the future. + 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(). @@ -65,7 +97,7 @@ 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 + by default. TCP port will NOT be opened by default. A table is 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 @@ -169,6 +201,8 @@ + + pg_close @@ -205,6 +239,8 @@ + + pg_cmdtuples @@ -243,6 +279,8 @@ echo $cmdtuples . " tuples are affected."; + + pg_connect @@ -315,6 +353,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_dbname @@ -337,6 +377,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_end_copy @@ -368,6 +410,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_errormessage @@ -455,6 +499,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_fetch_array @@ -541,9 +587,16 @@ echo $arr["author"] . " <- array\n"; + + + From 4.1.0, row became optional. + + + + pg_fetch_object @@ -649,9 +702,16 @@ pg_close ($db_conn); + + + From 4.1.0, row became optional. + + + + pg_fetch_row @@ -719,9 +779,16 @@ for ($i=0; $i < $num; $i++) { + + + From 4.1.0, row became optional. + + + + pg_fieldisnull @@ -747,6 +814,8 @@ for ($i=0; $i < $num; $i++) { + + pg_fieldname @@ -773,6 +842,8 @@ for ($i=0; $i < $num; $i++) { + + pg_fieldnum @@ -790,7 +861,7 @@ for ($i=0; $i < $num; $i++) { pg_fieldnum will return the number of the column (field) slot that corresponds to the - field_name in the given PosgreSQL + field_name in the given PostgreSQL result resource. Field numbering starts at 0. This function will return -1 on error. @@ -800,6 +871,8 @@ for ($i=0; $i < $num; $i++) { + + pg_fieldprtlen @@ -827,6 +900,8 @@ for ($i=0; $i < $num; $i++) { + + pg_fieldsize @@ -856,6 +931,8 @@ for ($i=0; $i < $num; $i++) { + + pg_fieldtype @@ -884,6 +961,8 @@ for ($i=0; $i < $num; $i++) { + + pg_freeresult @@ -914,6 +993,8 @@ for ($i=0; $i < $num; $i++) { + + pg_getlastoid @@ -943,6 +1024,8 @@ for ($i=0; $i < $num; $i++) { + + pg_host @@ -970,6 +1053,8 @@ for ($i=0; $i < $num; $i++) { + + pg_last_notice @@ -1012,6 +1097,8 @@ for ($i=0; $i < $num; $i++) { + + pg_loclose @@ -1042,6 +1129,8 @@ for ($i=0; $i < $num; $i++) { + + pg_locreate @@ -1075,6 +1164,8 @@ for ($i=0; $i < $num; $i++) { + + pg_loexport @@ -1112,6 +1203,8 @@ for ($i=0; $i < $num; $i++) { + + pg_loimport @@ -1146,6 +1239,8 @@ for ($i=0; $i < $num; $i++) { + + pg_loopen @@ -1186,6 +1281,8 @@ for ($i=0; $i < $num; $i++) { + + pg_loread @@ -1218,6 +1315,8 @@ for ($i=0; $i < $num; $i++) { + + pg_loreadall @@ -1250,6 +1349,8 @@ for ($i=0; $i < $num; $i++) { + + pg_lounlink @@ -1280,6 +1381,8 @@ for ($i=0; $i < $num; $i++) { + + pg_lowrite @@ -1312,6 +1415,8 @@ for ($i=0; $i < $num; $i++) { + + pg_numfields @@ -1339,6 +1444,8 @@ for ($i=0; $i < $num; $i++) { + + pg_numrows @@ -1372,6 +1479,8 @@ for ($i=0; $i < $num; $i++) { + + pg_options @@ -1474,6 +1583,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_port @@ -1497,6 +1608,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_put_line @@ -1550,6 +1663,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_result @@ -1594,6 +1709,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_set_client_encoding @@ -1617,11 +1734,12 @@ $dbconn4 = pg_connect ($conn_string); encoding and return 0 if success or -1 if error. - encoding is the client - encoding and can be either : - SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW, UNICODE, - MULE_INTERNAL, LATINX (X=1...9), KOI8, WIN, ALT, - SJIS, BIG5, WIN1250. + encoding is the client encoding and can be + either : SQL_ASCII, EUC_JP, EUC_CN, EUC_KR, EUC_TW, UNICODE, + MULE_INTERNAL, LATINX (X=1...9), KOI8, WIN, ALT, SJIS, BIG5, + WIN1250. Available encoding depends on your PostgreSQL and libpq + version. Refer to PostgreSQL manual for supported encodings for + your PostgreSQL. @@ -1640,6 +1758,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_client_encoding @@ -1684,6 +1804,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_trace @@ -1735,6 +1857,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_tty @@ -1758,6 +1882,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_untrace @@ -1787,6 +1913,8 @@ $dbconn4 = pg_connect ($conn_string); + + pg_get_result @@ -1803,52 +1931,48 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_get_result get result resource from async + query executed by + pg_send_query. pg_send_query + can send multiple queries to PostgreSQL server and + pg_get_result is used to get query result + one by one. It returns result resource. If there is no more + results, it returns &false;. - + + + - pg_request_cancel + pg_result_status - Cancel request + Get status of query result Description - bool pg_request_cancel - resource connection + int pg_result_status + resource result - &warn.undocumented.func; + pg_result_status returns status of result + resource. Possible retun values are PGSQL_EMPTY_QUERY, + PGSQL_COMMAND_OK, PGSQL_TUPLES_OK, PGSQL_COPY_TO, + PGSQL_COPY_FROM, PGSQL_BAD_RESPONSE, PGSQL_NONFATAL_ERROR and + PGSQL_FATAL_ERROR. + + + See also pgsql_connection_status. - - - pg_is_busy - - Get connection is busy or not - - - - Description - - - bool pg_is_busy - resource connection - - - - &warn.undocumented.func; - - - + @@ -1871,16 +1995,38 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_send_query send asynchronous query to the + connection. Unlike + pg_query, it can send multiple query to + PostgreSQL and get the result one by one using + pg_get_result. Script execution is not block + while query is executing. Use + pg_connection_busy to check connection is + busy (i.e. query is executing) Query may be canceled by calling + pg_cancel_query. + + + Although, user can send multiple query at once. User cannot send + multiple query over busy connection. If query is sent while + connection is busy, it waits until last query is finished and + discards all result. + + + See also pg_query, + pg_cancel_query, + pg_get_result and + pg_connection_busy + + pg_cancel_query - Cancel request + Cancel async query @@ -1892,7 +2038,14 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_cancel_query cancel asynchronous query sent by + pg_send_query. You cannot cancel query executed by + pg_query. + + + See also pg_send_query, + pg_cancel_result and + pg_connection_busy @@ -1915,7 +2068,15 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + 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. + + + See also pg_connection_status and + pg_get_result @@ -1938,7 +2099,15 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + 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;. + + + See also pg_connect, + pg_pconnect and + pg_connection_status @@ -1961,7 +2130,12 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_connection_status returns a connection + status. Possible status is PGSQL_CONNECTION_O + or PGSQL_CONNECTION_BAD. + + + See also pg_connection_busy @@ -1972,7 +2146,7 @@ $dbconn4 = pg_connect ($conn_string); pg_copy_from - No description given yet + Copy table from array @@ -1988,7 +2162,11 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_copy_from copy table from array. It + return &true; for success, otherwise &false;. + + + See also pg_copy_to @@ -1999,7 +2177,7 @@ $dbconn4 = pg_connect ($conn_string); pg_copy_to - Send null-terminated string to backend server + Copy table to array @@ -2014,7 +2192,12 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_copy_to copy table to array. The result + array is returned if it success to copy. Otherwise it returns + &false;. + + + See also pg_copy_from @@ -2037,7 +2220,16 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_escape_string escapes string for + bytea datatype. It returns escaped string. + + + + This function is requires PostgreSQL 7.2 or later. + + + + See also pg_escape_string @@ -2060,30 +2252,16 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_escape_string escapes string for + text/char datatype. It returns escaped string. - - - - - - - - pg_lo_close - - Close a large object - - - - Description - - - bool pg_lo_close - resource large_object - - + + + This function is requires PostgreSQL 7.2 or later. + + - &warn.undocumented.func; + See also pg_escape_bytea @@ -2108,7 +2286,12 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_lo_seek seeks position of large object + resource. whence is PGSQL_SEEK_SET, + PGSQL_SEEK_CUR or PGSQL_SEEK_END. + + + See also pg_lo_tell. @@ -2131,7 +2314,11 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_lo_tell returns current position (offset + from the beginning of large object). + + + See also pg_lo_seek. @@ -2154,34 +2341,21 @@ $dbconn4 = pg_connect ($conn_string); - &warn.undocumented.func; + pg_result_error returns error message + associated with result resource. Therefore, + user has better chance to get better error message than + pg_last_error. - - - - - - - - pg_result_status - - Get status of query result - - - - Description - - - int pg_result_status - resource result - - - &warn.undocumented.func; - + See also pg_query, + pg_send_query, + pg_get_result, + pg_last_error and + pg_last_notice + - +