diff --git a/reference/pgsql/functions/pg-delete.xml b/reference/pgsql/functions/pg-delete.xml index c928b3c461..e5e772905c 100644 --- a/reference/pgsql/functions/pg-delete.xml +++ b/reference/pgsql/functions/pg-delete.xml @@ -1,5 +1,5 @@ - + @@ -19,17 +19,66 @@ intoptions - pg_delete deletes record condition specified by - assoc_array which has - field=>value. If options is + pg_delete deletes records from a table specified by + the keys and values in assoc_array. If options is specified, pg_convert is applied - to assoc_array with specified option. - &return.success; - If PGSQL_DML_STRING is part of the - options then query string is returned. + to assoc_array with the specified options. + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. + + + + + table_name + + + Name of the table from which to delete rows. + + + + + assoc_array + + + An array whose keys are field names in the table table_name, + and whose values are the values of those fields that are to be deleted. + + + + + options + + + Any number of PGSQL_CONV_FORCE_NULL, + PGSQL_DML_NO_CONV, + PGSQL_DML_EXEC or + PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the + options then query string is returned. + + + + + + + + + &reftitle.returnvalues; + + &return.success; Returns string if PGSQL_DML_STRING is passed + via options. + + + &reftitle.examples; diff --git a/reference/pgsql/functions/pg-escape-bytea.xml b/reference/pgsql/functions/pg-escape-bytea.xml index 43f8a6885c..fa76f65cf1 100644 --- a/reference/pgsql/functions/pg-escape-bytea.xml +++ b/reference/pgsql/functions/pg-escape-bytea.xml @@ -1,11 +1,11 @@ - + pg_escape_bytea - Escape binary for bytea type + Escape a string for insertion into a bytea field @@ -21,22 +21,72 @@ - When you SELECT bytea type, PostgreSQL returns octal byte value - prefixed by \ (e.g. \032). Users are supposed to convert back to - binary format by yourself. + When you SELECT a bytea type, PostgreSQL returns octal byte values + prefixed with '\' (e.g. \032). Users are supposed to convert back to + binary format manually. This function requires PostgreSQL 7.2 or later. With PostgreSQL - 7.2.0 and 7.2.1, bytea type must be casted when you enable + 7.2.0 and 7.2.1, bytea values must be cast when you enable multi-byte support. i.e. INSERT INTO test_table (image) VALUES ('$image_escaped'::bytea); PostgreSQL 7.2.2 or - later does not need cast. Exception is when client and backend - character encoding does not match, there may be multi-byte - stream error. User must cast to bytea to avoid this error. + later does not need a cast. The exception is when the client and backend + character encoding does not match, and there may be multi-byte + stream error. User must then cast to bytea to avoid this error. + + &reftitle.parameters; + + + + data + + + A string containing text or binary data to be inserted into a bytea + column. + + + + + + + + + &reftitle.returnvalues; + + A string containing the escaped data. + + + + + &reftitle.examples; + + + <function>pg_escape_bytea</function> example + + +]]> + + + + + &reftitle.seealso; diff --git a/reference/pgsql/functions/pg-escape-string.xml b/reference/pgsql/functions/pg-escape-string.xml index 2c8117909c..79a0f8f10a 100644 --- a/reference/pgsql/functions/pg-escape-string.xml +++ b/reference/pgsql/functions/pg-escape-string.xml @@ -1,11 +1,11 @@ - + pg_escape_string - Escape string for text/char type + Escape a string for insertion into a text field @@ -16,10 +16,12 @@ stringdata - pg_escape_string escapes string for - text/char datatype. It returns escaped string for - PostgreSQL. Use of this function is recommended instead of - addslashes. + pg_escape_string escapes a string for + insertion into the database. It returns an escaped string in the + PostgreSQL format. Use of this function is recommended instead of + addslashes. If the type of the column + is bytea, pg_escape_bytea must be used + instead. @@ -28,6 +30,55 @@ + + &reftitle.parameters; + + + + data + + + A string containing text to be escaped. + + + + + + + + + &reftitle.returnvalues; + + A string containing the escaped data. + + + + + &reftitle.examples; + + + <function>pg_escape_string</function> example + + +]]> + + + + + &reftitle.seealso; diff --git a/reference/pgsql/functions/pg-free-result.xml b/reference/pgsql/functions/pg-free-result.xml index 0dfd8a906a..e39e8e217f 100644 --- a/reference/pgsql/functions/pg-free-result.xml +++ b/reference/pgsql/functions/pg-free-result.xml @@ -1,5 +1,5 @@ - + @@ -14,14 +14,13 @@ resourceresult - pg_free_result only needs to be called if you - are worried about using too much memory while your script is - running. All result memory will automatically be freed when the - script is finished. But, if you are sure you are not going to - need the result data anymore in a script, you may call - pg_free_result with the - result resource as an argument and the - associated result memory will be freed. &return.success; + pg_free_result frees the memory and data associated with the + specified PostgreSQL query result resource. + + + This function need only be called if memory + consumption during script execution is a problem. Otherwise, all result memory will + be automatically freed when the script ends. @@ -30,11 +29,68 @@ + + &reftitle.parameters; + + + + result + + + PostgreSQL query result resource, returned by pg_query, + pg_query_params or pg_execute + (among others). + + + + + + + + + &reftitle.returnvalues; + + &return.success; + + + + + &reftitle.examples; + + + <function>pg_free_result</function> example + + +]]> + + &example.outputs; + + + + + + + &reftitle.seealso; pg_query + pg_query_params + pg_execute diff --git a/reference/pgsql/functions/pg-get-notify.xml b/reference/pgsql/functions/pg-get-notify.xml index 8103609f81..61d4971090 100644 --- a/reference/pgsql/functions/pg-get-notify.xml +++ b/reference/pgsql/functions/pg-get-notify.xml @@ -1,5 +1,5 @@ - + pg_get_notify @@ -14,15 +14,54 @@ intresult_type - pg_get_notify gets notify message sent by - NOTIFY SQL command. To receive notify - messages, LISTEN SQL command must be - issued. If there is notify message on the connection, array - contains message name and backend PID is returned. If there is no - message, &false; is returned. + pg_get_notify gets notifications generated by a + NOTIFY SQL command. To receive notifications, + the LISTEN SQL command must be + issued. - + + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. + + + + + result_type + + + An optional parameter that controls + how the returned array is indexed. + result_type is a constant and can take the + following values: PGSQL_ASSOC, + PGSQL_NUM and PGSQL_BOTH. + Using PGSQL_NUM, pg_get_notify + will return an array with numerical indices, using + PGSQL_ASSOC it will return only associative indices + while PGSQL_BOTH, the default, will return both + numerical and associative indices. + + + + + + + + + &reftitle.returnvalues; + + An array containing the NOTIFY message name and backend PID. + Otherwise if no NOTIFY is waiting, then &false; is returned. + + + &reftitle.examples; diff --git a/reference/pgsql/functions/pg-get-pid.xml b/reference/pgsql/functions/pg-get-pid.xml index ab5ed8438d..0b8421f67a 100644 --- a/reference/pgsql/functions/pg-get-pid.xml +++ b/reference/pgsql/functions/pg-get-pid.xml @@ -1,9 +1,9 @@ - + pg_get_pid - Gets backend's process ID + Gets the backend's process ID @@ -13,12 +13,36 @@ resourceconnection - pg_get_pid gets backend (database server - process) PID. PID is useful to check if NOTIFY - message is sent from other process or not. + pg_get_pid gets the backend's (database server + process) PID. The PID is useful to determine whether or not a NOTIFY + message received via pg_get_notify is sent from another process + or not. + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. + + + + + + + + + &reftitle.returnvalues; + + The backend database process ID. + + + &reftitle.examples; diff --git a/reference/pgsql/functions/pg-insert.xml b/reference/pgsql/functions/pg-insert.xml index f4ce01cf51..c0c1cdd7ca 100644 --- a/reference/pgsql/functions/pg-insert.xml +++ b/reference/pgsql/functions/pg-insert.xml @@ -1,5 +1,5 @@ - + @@ -21,18 +21,68 @@ pg_insert inserts the values of assoc_array into the table specified by table_name. - table_name must at least have as many columns as - assoc_array has elements. The fieldnames in - table_name must match the indices of assoc_array. - &return.success; - If options is specified, pg_insert - is applied to assoc_array with specified option. - If PGSQL_DML_STRING is part of the - options then query string is returned. + If options is + specified, pg_convert is applied + to assoc_array with the specified options. &warn.experimental.func; + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. + + + + + table_name + + + Name of the table into which to insert rows. The table table_name must at least + have as many columns as assoc_array has elements. + + + + + assoc_array + + + An array whose keys are field names in the table table_name, + and whose values are the values of those fields that are to be inserted. + + + + + options + + + Any number of PGSQL_CONV_OPTS, + PGSQL_DML_NO_CONV, + PGSQL_DML_EXEC, + PGSQL_DML_ASYNC or + PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the + options then query string is returned. + + + + + + + + + &reftitle.returnvalues; + + &return.success; Returns string if PGSQL_DML_STRING is passed + via options. + + + &reftitle.examples; diff --git a/reference/pgsql/functions/pg-update.xml b/reference/pgsql/functions/pg-update.xml index 137bbe81f5..32db2d0648 100644 --- a/reference/pgsql/functions/pg-update.xml +++ b/reference/pgsql/functions/pg-update.xml @@ -1,5 +1,5 @@ - + @@ -29,6 +29,69 @@ &warn.experimental.func; + + &reftitle.parameters; + + + + connection + + + PostgreSQL database connection resource. + + + + + table_name + + + Name of the table into which to insert rows. The table table_name must at least + have as many columns as condition has elements. + + + + + data + + + An array whose keys are field names in the table table_name, + and whose values are what matched rows are to be updated to. + + + + + condition + + + An array whose keys are field names in the table table_name, + and whose values are the conditions that a row must meet to be updated. + + + + + options + + + Any number of PGSQL_CONV_OPTS, + PGSQL_DML_NO_CONV, + PGSQL_DML_EXEC or + PGSQL_DML_STRING combined. If PGSQL_DML_STRING is part of the + options then query string is returned. + + + + + + + + + &reftitle.returnvalues; + + &return.success; Returns string if PGSQL_DML_STRING is passed + via options. + + + &reftitle.examples;