com.caucho.quercus.lib.db
Class PostgresModule

java.lang.Object
  extended by com.caucho.quercus.module.AbstractQuercusModule
      extended by com.caucho.quercus.lib.db.PostgresModule
All Implemented Interfaces:
QuercusModule

public class PostgresModule
extends AbstractQuercusModule

Quercus postgres routines.


Field Summary
static int PGSQL_ASSOC
           
static int PGSQL_BAD_RESPONSE
           
static int PGSQL_BOTH
           
static int PGSQL_COMMAND_OK
           
static int PGSQL_CONNECT_FORCE_NEW
           
static int PGSQL_CONNECTION_BAD
           
static int PGSQL_CONNECTION_OK
           
static int PGSQL_CONV_FORCE_NULL
           
static int PGSQL_CONV_IGNORE_DEFAULT
           
static int PGSQL_COPY_IN
           
static int PGSQL_COPY_OUT
           
static int PGSQL_DIAG_CONTEXT
           
static int PGSQL_DIAG_INTERNAL_POSITION
           
static int PGSQL_DIAG_INTERNAL_QUERY
           
static int PGSQL_DIAG_MESSAGE_DETAIL
           
static int PGSQL_DIAG_MESSAGE_HINT
           
static int PGSQL_DIAG_MESSAGE_PRIMARY
           
static int PGSQL_DIAG_SEVERITY
           
static int PGSQL_DIAG_SOURCE_FILE
           
static int PGSQL_DIAG_SOURCE_FUNCTION
           
static int PGSQL_DIAG_SOURCE_LINE
           
static int PGSQL_DIAG_SQLSTATE
           
static int PGSQL_DIAG_STATEMENT_POSITION
           
static int PGSQL_EMPTY_QUERY
           
static int PGSQL_ERRORS_DEFAULT
           
static int PGSQL_ERRORS_TERSE
           
static int PGSQL_ERRORS_VERBOSE
           
static int PGSQL_FATAL_ERROR
           
static int PGSQL_NONFATAL_ERROR
           
static int PGSQL_NUM
           
static int PGSQL_SEEK_CUR
           
static int PGSQL_SEEK_END
           
static int PGSQL_SEEK_SET
           
static int PGSQL_STATUS_LONG
           
static int PGSQL_STATUS_STRING
           
static int PGSQL_TRANSACTION_ACTIVE
           
static int PGSQL_TRANSACTION_IDLE
           
static int PGSQL_TRANSACTION_INERROR
           
static int PGSQL_TRANSACTION_INTRANS
           
static int PGSQL_TRANSACTION_UNKNOWN
           
static int PGSQL_TUPLES_OK
           
 
Fields inherited from class com.caucho.quercus.module.AbstractQuercusModule
PHP_INI_ALL, PHP_INI_PERDIR, PHP_INI_SYSTEM, PHP_INI_USER
 
Constructor Summary
PostgresModule()
          Constructor
 
Method Summary
 java.lang.String[] getLoadedExtensions()
          Returns true for the postgres extension.
static int pg_affected_rows(Env env, PostgresResult result)
          Returns number of affected records (tuples)
static boolean pg_cancel_query(Env env, Postgres conn)
          Cancel an asynchronous query
static java.lang.String pg_client_encoding(Env env, Postgres conn)
          Gets the client encoding
static boolean pg_close(Env env, Postgres conn)
          Closes a PostgreSQL connection
static int pg_cmdtuples(Env env, PostgresResult result)
          pg_affected_rows() alias.
static Postgres pg_connect(Env env, java.lang.String connectionString, int connectionType)
          Open a PostgreSQL connection
static boolean pg_connection_busy(Env env, Postgres conn)
          Get connection is busy or not
static boolean pg_connection_reset(Env env, Postgres conn)
          Reset connection (reconnect)
static int pg_connection_status(Env env, Postgres conn)
          Get connection status
static ArrayValue pg_convert(Env env, Postgres conn, java.lang.String tableName, ArrayValue assocArray, int options)
          Convert associative array values into suitable for SQL statement
static boolean pg_copy_from(Env env, Postgres conn, java.lang.String tableName, ArrayValue rows, java.lang.String delimiter, java.lang.String nullAs)
          Insert records into a table from an array
static ArrayValue pg_copy_to(Env env, Postgres conn, java.lang.String tableName, java.lang.String delimiter, java.lang.String nullAs)
          Copy a table to an array
static java.lang.String pg_dbname(Env env, Postgres conn)
          Get the database name
static boolean pg_delete(Env env, Postgres conn, java.lang.String tableName, ArrayValue assocArray, int options)
          Deletes records
static boolean pg_end_copy(Env env, Postgres conn)
          Sync with PostgreSQL backend
static StringValue pg_errormessage(Env env, Postgres conn)
          pg_last_error() alias.
static StringValue pg_escape_bytea(Env env, Postgres conn, StringValue data)
          Escape a string for insertion into a bytea field.
static StringValue pg_escape_bytea(Env env, StringValue data)
          Escape a string for insertion into a bytea field
static StringValue pg_escape_string(Env env, StringValue data)
          Escape a string for insertion into a text field
static PostgresResult pg_exec(Env env, Postgres conn, java.lang.String query)
          pg_query() alias
static PostgresResult pg_execute(Env env, Postgres conn, java.lang.String stmtName, ArrayValue params)
          Sends a request to execute a prepared statement with given parameters, and waits for the result
static ArrayValue pg_fetch_all_columns(Env env, PostgresResult result, int column)
          Fetches all rows in a particular result column as an array
static ArrayValue pg_fetch_all(Env env, PostgresResult result)
          Fetches all rows from a result as an array
static ArrayValue pg_fetch_array(Env env, PostgresResult result, Value row, int resultType)
          Fetch a row as an array
static ArrayValue pg_fetch_assoc(Env env, PostgresResult result, Value row)
          Fetch a row as an associative array
static Value pg_fetch_object(Env env, PostgresResult result, Value row, int resultType)
          Fetch a row as an object
static Value pg_fetch_result(Env env, PostgresResult result, Value row, Value fieldNameOrNumber)
          Returns values from a result resource
static ArrayValue pg_fetch_row(Env env, PostgresResult result, Value row)
          Get a row as an enumerated array
static LongValue pg_field_is_null(Env env, PostgresResult result, Value row, Value fieldNameOrNumber)
          Test if a field is SQL NULL
static Value pg_field_name(Env env, PostgresResult result, int fieldNumber)
          Returns the name of a field
static int pg_field_num(Env env, PostgresResult result, java.lang.String fieldName)
          Returns the field number of the named field
static int pg_field_prtlen(Env env, PostgresResult result, Value rowNumber, Value fieldNameOrNumber)
          Returns the printed length
static LongValue pg_field_size(Env env, PostgresResult result, int fieldNumber)
          Returns the internal storage size of the named field
static java.lang.String pg_field_table(Env env, PostgresResult result, int fieldNumber, boolean oidOnly)
          Returns the name or oid of the tables field
static LongValue pg_field_type_oid(Env env, PostgresResult result, int fieldNumber)
          Returns the type ID (OID) for the corresponding field number
static StringValue pg_field_type(Env env, PostgresResult result, int fieldNumber)
          Returns the type name for the corresponding field number
static LongValue pg_fieldisnull(Env env, PostgresResult result, Value row, Value fieldNameOrNumber)
          pg_field_is_null() alias.
static Value pg_fieldname(Env env, PostgresResult result, int fieldNumber)
          pg_field_name() alias.
static int pg_fieldnum(Env env, PostgresResult result, java.lang.String fieldName)
          pg_field_num() alias.
static int pg_fieldprtlen(Env env, PostgresResult result, Value rowNumber, Value fieldNameOrNumber)
          pg_field_ptrlen() alias.
static LongValue pg_fieldsize(Env env, PostgresResult result, int fieldNumber)
          pg_field_size() alias.
static StringValue pg_fieldtype(Env env, PostgresResult result, int fieldNumber)
          pg_field_type() alias.
static boolean pg_free_result(Env env, PostgresResult result)
          Free result memory
static boolean pg_freeresult(Env env, PostgresResult result)
          pg_free_result() alias.
static ArrayValue pg_get_notify(Env env, Postgres conn, int resultType)
          Gets SQL NOTIFY message
static int pg_get_pid(Env env, Postgres conn)
          Gets the backend's process ID
static PostgresResult pg_get_result(Env env, Postgres conn)
          Get asynchronous query result
static java.lang.String pg_getlastoid(Env env, PostgresResult result)
           
static java.lang.String pg_host(Env env, Postgres conn)
          Returns the host name associated with the connection
static boolean pg_insert(Env env, Postgres conn, java.lang.String tableName, ArrayValue assocArray, int options)
          Insert array into table
static StringValue pg_last_error(Env env, Postgres conn)
          Get the last error message string of a connection
static java.lang.String pg_last_notice(Env env, Postgres conn)
          Returns the last notice message from PostgreSQL server
static java.lang.String pg_last_oid(Env env, PostgresResult result)
          Returns the last row's OID Note that: - OID is a unique id.
static boolean pg_lo_close(Env env, java.lang.Object largeObject)
          Close a large object
static LongValue pg_lo_create(Env env, Postgres conn)
          Create a large object
static boolean pg_lo_export(Env env, Postgres conn, int oid, Path path)
          Export a large object to a file
static LongValue pg_lo_import(Env env, Postgres conn, Path path)
          Import a large object from file
static java.lang.Object pg_lo_open(Env env, Postgres conn, int oid, java.lang.String mode)
          Open a large object
static LongValue pg_lo_read_all(Env env, java.lang.Object largeObject)
          Reads an entire large object and send straight to browser
static StringValue pg_lo_read(Env env, java.lang.Object largeObject, int len)
          Read a large object
static boolean pg_lo_seek(Env env, java.lang.Object largeObject, int offset, int whence)
          Seeks position within a large object
static int pg_lo_tell(Env env, java.lang.Object largeObject)
          Returns current seek position a of large object
static boolean pg_lo_unlink(Env env, Postgres conn, int oid)
          Delete a large object
static LongValue pg_lo_write(Env env, java.lang.Object largeObject, java.lang.String data, int len)
          Write to a large object
static boolean pg_loclose(Env env, java.lang.Object largeObject)
          pg_lo_close() alias.
static LongValue pg_locreate(Env env, Postgres conn)
          pg_lo_create() alias
static boolean pg_loexport(Env env, Postgres conn, int oid, Path path)
          pg_lo_export() alias.
static LongValue pg_loimport(Env env, Postgres conn, Path path)
          pg_lo_import() alias.
static java.lang.Object pg_loopen(Env env, Postgres conn, int oid, java.lang.String mode)
          pg_lo_open() alias.
static StringValue pg_loread(Env env, java.lang.Object largeObject, int len)
          pg_lo_read() alias.
static LongValue pg_loreadall(Env env, java.lang.Object largeObject)
          pg_lo_read_all() alias.
static boolean pg_lounlink(Env env, Postgres conn, int oid)
          pg_lo_unlink() alias.
static LongValue pg_lowrite(Env env, java.lang.Object largeObject, java.lang.String data, int len)
          pg_lo_write() alias.
static ArrayValue pg_meta_data(Env env, Postgres conn, java.lang.String tableName)
          Get meta data for table
static int pg_num_fields(Env env, PostgresResult result)
          Returns the number of fields in a result
static LongValue pg_num_rows(Env env, PostgresResult result)
          Returns the number of rows in a result
static int pg_numfields(Env env, PostgresResult result)
          pg_num_fields() alias.
static LongValue pg_numrows(Env env, PostgresResult result)
          pg_num_rows() alias.
static java.lang.String pg_options(Env env, Postgres conn)
          Get the options associated with the connection
static Value pg_parameter_status(Env env, Postgres conn, StringValue paramName)
          Looks up a current parameter setting of the server
static Value pg_parameter_status(Env env, StringValue paramName)
          Looks up a current parameter setting of the server
static Postgres pg_pconnect(Env env, java.lang.String connectionString, int connectType)
          Open a persistent PostgreSQL connection
static boolean pg_ping(Env env, Postgres conn)
          Ping database connection
static StringValue pg_port(Env env, Postgres conn)
          Return the port number associated with the connection
static PostgresStatement pg_prepare(Env env, Postgres conn, java.lang.String stmtName, java.lang.String query)
          Submits a request to create a prepared statement with the given parameters, and waits for completion
static boolean pg_put_line(Env env, Postgres conn, java.lang.String data)
          Send a NULL-terminated string to PostgreSQL backend
static PostgresResult pg_query_params(Env env, Postgres conn, java.lang.String query, ArrayValue params)
          Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text
static PostgresResult pg_query(Env env, Postgres conn, java.lang.String query)
          Execute a query
static PostgresResult pg_query(Env env, java.lang.String query)
          Execute a query
static Value pg_result_error_field(Env env, PostgresResult result, int fieldCode)
          Returns an individual field of an error report
static java.lang.String pg_result_error(Env env, PostgresResult result)
          Get error message associated with result
static boolean pg_result_seek(Env env, PostgresResult result, int offset)
          Set internal row offset in result resource
static int pg_result_status(Env env, PostgresResult result, int type)
          Get status of query result
static Value pg_result(Env env, PostgresResult result, Value row, Value fieldNameOrNumber)
          Returns values from a result resource
static ArrayValue pg_select(Env env, Postgres conn, java.lang.String tableName, ArrayValue assocArray, int options)
          Select records
static boolean pg_send_execute(Env env, Postgres conn, java.lang.String stmtName, ArrayValue params)
          Sends a request to execute a prepared statement with given parameters, without waiting for the result(s)
static boolean pg_send_prepare(Env env, Postgres conn, java.lang.String stmtName, java.lang.String query)
          Sends a request to create a prepared statement with the given parameters, without waiting for completion
static boolean pg_send_query_params(Env env, Postgres conn, java.lang.String query, ArrayValue params)
          Submits a command and separate parameters to the server without waiting for the result(s)
static boolean pg_send_query(Env env, Postgres conn, java.lang.String query)
          Sends asynchronous query
static int pg_set_client_encoding(Env env, Postgres conn, java.lang.String encoding)
          Set the client encoding
static int pg_set_error_verbosity(Env env, Postgres conn, int intVerbosity)
          Determines the verbosity of messages returned by pg_last_error() and pg_result_error()
static boolean pg_trace(Env env, Path path, java.lang.String mode, Postgres conn)
          Enable tracing a PostgreSQL connection
static int pg_transaction_status(Env env, Postgres conn)
          Returns the current in-transaction status of the server
static java.lang.String pg_tty(Env env, Postgres conn)
          Return the TTY name associated with the connection
static java.lang.String pg_unescape_bytea(Env env, java.lang.String data)
          Unescape binary for bytea type
static boolean pg_untrace(Env env, Postgres conn)
          Disable tracing of a PostgreSQL connection
static boolean pg_update(Env env, Postgres conn, java.lang.String tableName, ArrayValue data, ArrayValue condition, int options)
          Update table
static ArrayValue pg_version(Env env, Postgres conn)
          Returns an array with client, protocol and server version (when available)
 
Methods inherited from class com.caucho.quercus.module.AbstractQuercusModule
addConstant, addConstant, addConstant, getConstMap, getIniDefinitions
 
Methods inherited from class java.lang.Object
clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
 

Field Detail

PGSQL_ASSOC

public static final int PGSQL_ASSOC
See Also:
Constant Field Values

PGSQL_NUM

public static final int PGSQL_NUM
See Also:
Constant Field Values

PGSQL_BOTH

public static final int PGSQL_BOTH
See Also:
Constant Field Values

PGSQL_CONNECT_FORCE_NEW

public static final int PGSQL_CONNECT_FORCE_NEW
See Also:
Constant Field Values

PGSQL_CONNECTION_BAD

public static final int PGSQL_CONNECTION_BAD
See Also:
Constant Field Values

PGSQL_CONNECTION_OK

public static final int PGSQL_CONNECTION_OK
See Also:
Constant Field Values

PGSQL_SEEK_SET

public static final int PGSQL_SEEK_SET
See Also:
Constant Field Values

PGSQL_SEEK_CUR

public static final int PGSQL_SEEK_CUR
See Also:
Constant Field Values

PGSQL_SEEK_END

public static final int PGSQL_SEEK_END
See Also:
Constant Field Values

PGSQL_EMPTY_QUERY

public static final int PGSQL_EMPTY_QUERY
See Also:
Constant Field Values

PGSQL_COMMAND_OK

public static final int PGSQL_COMMAND_OK
See Also:
Constant Field Values

PGSQL_TUPLES_OK

public static final int PGSQL_TUPLES_OK
See Also:
Constant Field Values

PGSQL_COPY_OUT

public static final int PGSQL_COPY_OUT
See Also:
Constant Field Values

PGSQL_COPY_IN

public static final int PGSQL_COPY_IN
See Also:
Constant Field Values

PGSQL_BAD_RESPONSE

public static final int PGSQL_BAD_RESPONSE
See Also:
Constant Field Values

PGSQL_NONFATAL_ERROR

public static final int PGSQL_NONFATAL_ERROR
See Also:
Constant Field Values

PGSQL_FATAL_ERROR

public static final int PGSQL_FATAL_ERROR
See Also:
Constant Field Values

PGSQL_TRANSACTION_IDLE

public static final int PGSQL_TRANSACTION_IDLE
See Also:
Constant Field Values

PGSQL_TRANSACTION_ACTIVE

public static final int PGSQL_TRANSACTION_ACTIVE
See Also:
Constant Field Values

PGSQL_TRANSACTION_INTRANS

public static final int PGSQL_TRANSACTION_INTRANS
See Also:
Constant Field Values

PGSQL_TRANSACTION_INERROR

public static final int PGSQL_TRANSACTION_INERROR
See Also:
Constant Field Values

PGSQL_TRANSACTION_UNKNOWN

public static final int PGSQL_TRANSACTION_UNKNOWN
See Also:
Constant Field Values

PGSQL_DIAG_SEVERITY

public static final int PGSQL_DIAG_SEVERITY
See Also:
Constant Field Values

PGSQL_DIAG_SQLSTATE

public static final int PGSQL_DIAG_SQLSTATE
See Also:
Constant Field Values

PGSQL_DIAG_MESSAGE_PRIMARY

public static final int PGSQL_DIAG_MESSAGE_PRIMARY
See Also:
Constant Field Values

PGSQL_DIAG_MESSAGE_DETAIL

public static final int PGSQL_DIAG_MESSAGE_DETAIL
See Also:
Constant Field Values

PGSQL_DIAG_MESSAGE_HINT

public static final int PGSQL_DIAG_MESSAGE_HINT
See Also:
Constant Field Values

PGSQL_DIAG_STATEMENT_POSITION

public static final int PGSQL_DIAG_STATEMENT_POSITION
See Also:
Constant Field Values

PGSQL_DIAG_INTERNAL_POSITION

public static final int PGSQL_DIAG_INTERNAL_POSITION
See Also:
Constant Field Values

PGSQL_DIAG_INTERNAL_QUERY

public static final int PGSQL_DIAG_INTERNAL_QUERY
See Also:
Constant Field Values

PGSQL_DIAG_CONTEXT

public static final int PGSQL_DIAG_CONTEXT
See Also:
Constant Field Values

PGSQL_DIAG_SOURCE_FILE

public static final int PGSQL_DIAG_SOURCE_FILE
See Also:
Constant Field Values

PGSQL_DIAG_SOURCE_LINE

public static final int PGSQL_DIAG_SOURCE_LINE
See Also:
Constant Field Values

PGSQL_DIAG_SOURCE_FUNCTION

public static final int PGSQL_DIAG_SOURCE_FUNCTION
See Also:
Constant Field Values

PGSQL_ERRORS_TERSE

public static final int PGSQL_ERRORS_TERSE
See Also:
Constant Field Values

PGSQL_ERRORS_DEFAULT

public static final int PGSQL_ERRORS_DEFAULT
See Also:
Constant Field Values

PGSQL_ERRORS_VERBOSE

public static final int PGSQL_ERRORS_VERBOSE
See Also:
Constant Field Values

PGSQL_STATUS_LONG

public static final int PGSQL_STATUS_LONG
See Also:
Constant Field Values

PGSQL_STATUS_STRING

public static final int PGSQL_STATUS_STRING
See Also:
Constant Field Values

PGSQL_CONV_IGNORE_DEFAULT

public static final int PGSQL_CONV_IGNORE_DEFAULT
See Also:
Constant Field Values

PGSQL_CONV_FORCE_NULL

public static final int PGSQL_CONV_FORCE_NULL
See Also:
Constant Field Values
Constructor Detail

PostgresModule

public PostgresModule()
Constructor

Method Detail

getLoadedExtensions

public java.lang.String[] getLoadedExtensions()
Returns true for the postgres extension.

Specified by:
getLoadedExtensions in interface QuercusModule
Overrides:
getLoadedExtensions in class AbstractQuercusModule

pg_affected_rows

public static int pg_affected_rows(Env env,
                                   PostgresResult result)
Returns number of affected records (tuples)


pg_cmdtuples

public static int pg_cmdtuples(Env env,
                               PostgresResult result)
pg_affected_rows() alias.


pg_cancel_query

public static boolean pg_cancel_query(Env env,
                                      Postgres conn)
Cancel an asynchronous query


pg_client_encoding

public static java.lang.String pg_client_encoding(Env env,
                                                  Postgres conn)
Gets the client encoding


pg_close

public static boolean pg_close(Env env,
                               Postgres conn)
Closes a PostgreSQL connection


pg_connect

public static Postgres pg_connect(Env env,
                                  java.lang.String connectionString,
                                  int connectionType)
Open a PostgreSQL connection


pg_connection_busy

public static boolean pg_connection_busy(Env env,
                                         Postgres conn)
Get connection is busy or not


pg_connection_reset

public static boolean pg_connection_reset(Env env,
                                          Postgres conn)
Reset connection (reconnect)


pg_connection_status

public static int pg_connection_status(Env env,
                                       Postgres conn)
Get connection status


pg_convert

public static ArrayValue pg_convert(Env env,
                                    Postgres conn,
                                    java.lang.String tableName,
                                    ArrayValue assocArray,
                                    int options)
Convert associative array values into suitable for SQL statement


pg_copy_from

public static boolean pg_copy_from(Env env,
                                   Postgres conn,
                                   java.lang.String tableName,
                                   ArrayValue rows,
                                   java.lang.String delimiter,
                                   java.lang.String nullAs)
Insert records into a table from an array


pg_copy_to

public static ArrayValue pg_copy_to(Env env,
                                    Postgres conn,
                                    java.lang.String tableName,
                                    java.lang.String delimiter,
                                    java.lang.String nullAs)
Copy a table to an array


pg_dbname

public static java.lang.String pg_dbname(Env env,
                                         Postgres conn)
Get the database name


pg_delete

public static boolean pg_delete(Env env,
                                Postgres conn,
                                java.lang.String tableName,
                                ArrayValue assocArray,
                                int options)
Deletes records


pg_end_copy

public static boolean pg_end_copy(Env env,
                                  Postgres conn)
Sync with PostgreSQL backend


pg_escape_bytea

public static StringValue pg_escape_bytea(Env env,
                                          StringValue data)
Escape a string for insertion into a bytea field


pg_escape_bytea

public static StringValue pg_escape_bytea(Env env,
                                          Postgres conn,
                                          StringValue data)
Escape a string for insertion into a bytea field.


pg_escape_string

public static StringValue pg_escape_string(Env env,
                                           StringValue data)
Escape a string for insertion into a text field


pg_execute

public static PostgresResult pg_execute(Env env,
                                        Postgres conn,
                                        java.lang.String stmtName,
                                        ArrayValue params)
Sends a request to execute a prepared statement with given parameters, and waits for the result


pg_fetch_all_columns

public static ArrayValue pg_fetch_all_columns(Env env,
                                              PostgresResult result,
                                              int column)
Fetches all rows in a particular result column as an array


pg_fetch_all

public static ArrayValue pg_fetch_all(Env env,
                                      PostgresResult result)
Fetches all rows from a result as an array


pg_fetch_array

public static ArrayValue pg_fetch_array(Env env,
                                        PostgresResult result,
                                        Value row,
                                        int resultType)
Fetch a row as an array


pg_fetch_assoc

public static ArrayValue pg_fetch_assoc(Env env,
                                        PostgresResult result,
                                        Value row)
Fetch a row as an associative array


pg_fetch_object

public static Value pg_fetch_object(Env env,
                                    PostgresResult result,
                                    Value row,
                                    int resultType)
Fetch a row as an object


pg_fetch_result

public static Value pg_fetch_result(Env env,
                                    PostgresResult result,
                                    Value row,
                                    Value fieldNameOrNumber)
Returns values from a result resource


pg_result

public static Value pg_result(Env env,
                              PostgresResult result,
                              Value row,
                              Value fieldNameOrNumber)
Returns values from a result resource


pg_fetch_row

public static ArrayValue pg_fetch_row(Env env,
                                      PostgresResult result,
                                      Value row)
Get a row as an enumerated array


pg_field_is_null

public static LongValue pg_field_is_null(Env env,
                                         PostgresResult result,
                                         Value row,
                                         Value fieldNameOrNumber)
Test if a field is SQL NULL


pg_fieldisnull

public static LongValue pg_fieldisnull(Env env,
                                       PostgresResult result,
                                       Value row,
                                       Value fieldNameOrNumber)
pg_field_is_null() alias.


pg_field_name

public static Value pg_field_name(Env env,
                                  PostgresResult result,
                                  int fieldNumber)
Returns the name of a field


pg_fieldname

public static Value pg_fieldname(Env env,
                                 PostgresResult result,
                                 int fieldNumber)
pg_field_name() alias.


pg_field_num

public static int pg_field_num(Env env,
                               PostgresResult result,
                               java.lang.String fieldName)
Returns the field number of the named field

Returns:
the field number (0-based) or -1 on error

pg_fieldnum

public static int pg_fieldnum(Env env,
                              PostgresResult result,
                              java.lang.String fieldName)
pg_field_num() alias.


pg_field_prtlen

public static int pg_field_prtlen(Env env,
                                  PostgresResult result,
                                  Value rowNumber,
                                  Value fieldNameOrNumber)
Returns the printed length


pg_fieldprtlen

public static int pg_fieldprtlen(Env env,
                                 PostgresResult result,
                                 Value rowNumber,
                                 Value fieldNameOrNumber)
pg_field_ptrlen() alias.


pg_field_size

public static LongValue pg_field_size(Env env,
                                      PostgresResult result,
                                      int fieldNumber)
Returns the internal storage size of the named field


pg_fieldsize

public static LongValue pg_fieldsize(Env env,
                                     PostgresResult result,
                                     int fieldNumber)
pg_field_size() alias.


pg_field_table

public static java.lang.String pg_field_table(Env env,
                                              PostgresResult result,
                                              int fieldNumber,
                                              boolean oidOnly)
Returns the name or oid of the tables field

Returns:
By default the tables name that field belongs to is returned but if oid_only is set to TRUE, then the oid will instead be returned.

pg_field_type_oid

public static LongValue pg_field_type_oid(Env env,
                                          PostgresResult result,
                                          int fieldNumber)
Returns the type ID (OID) for the corresponding field number


pg_field_type

public static StringValue pg_field_type(Env env,
                                        PostgresResult result,
                                        int fieldNumber)
Returns the type name for the corresponding field number


pg_fieldtype

public static StringValue pg_fieldtype(Env env,
                                       PostgresResult result,
                                       int fieldNumber)
pg_field_type() alias.


pg_free_result

public static boolean pg_free_result(Env env,
                                     PostgresResult result)
Free result memory


pg_freeresult

public static boolean pg_freeresult(Env env,
                                    PostgresResult result)
pg_free_result() alias.


pg_get_notify

public static ArrayValue pg_get_notify(Env env,
                                       Postgres conn,
                                       int resultType)
Gets SQL NOTIFY message


pg_get_pid

public static int pg_get_pid(Env env,
                             Postgres conn)
Gets the backend's process ID


pg_get_result

public static PostgresResult pg_get_result(Env env,
                                           Postgres conn)
Get asynchronous query result


pg_host

public static java.lang.String pg_host(Env env,
                                       Postgres conn)
Returns the host name associated with the connection


pg_insert

public static boolean pg_insert(Env env,
                                Postgres conn,
                                java.lang.String tableName,
                                ArrayValue assocArray,
                                int options)
Insert array into table


pg_last_error

public static StringValue pg_last_error(Env env,
                                        Postgres conn)
Get the last error message string of a connection


pg_errormessage

public static StringValue pg_errormessage(Env env,
                                          Postgres conn)
pg_last_error() alias.


pg_last_notice

public static java.lang.String pg_last_notice(Env env,
                                              Postgres conn)
Returns the last notice message from PostgreSQL server


pg_last_oid

public static java.lang.String pg_last_oid(Env env,
                                           PostgresResult result)
Returns the last row's OID Note that: - OID is a unique id. It will not work if the table was created with "No oid". - MySql's "mysql_insert_id" receives the conection handler as argument but PostgreSQL's "pg_last_oid" uses the result handler.


pg_getlastoid

public static java.lang.String pg_getlastoid(Env env,
                                             PostgresResult result)

pg_lo_close

public static boolean pg_lo_close(Env env,
                                  java.lang.Object largeObject)
Close a large object


pg_loclose

public static boolean pg_loclose(Env env,
                                 java.lang.Object largeObject)
pg_lo_close() alias.


pg_lo_create

public static LongValue pg_lo_create(Env env,
                                     Postgres conn)
Create a large object


pg_locreate

public static LongValue pg_locreate(Env env,
                                    Postgres conn)
pg_lo_create() alias


pg_lo_export

public static boolean pg_lo_export(Env env,
                                   Postgres conn,
                                   int oid,
                                   Path path)
Export a large object to a file


pg_loexport

public static boolean pg_loexport(Env env,
                                  Postgres conn,
                                  int oid,
                                  Path path)
pg_lo_export() alias.


pg_lo_import

public static LongValue pg_lo_import(Env env,
                                     Postgres conn,
                                     Path path)
Import a large object from file


pg_loimport

public static LongValue pg_loimport(Env env,
                                    Postgres conn,
                                    Path path)
pg_lo_import() alias.


pg_lo_open

public static java.lang.Object pg_lo_open(Env env,
                                          Postgres conn,
                                          int oid,
                                          java.lang.String mode)
Open a large object


pg_loopen

public static java.lang.Object pg_loopen(Env env,
                                         Postgres conn,
                                         int oid,
                                         java.lang.String mode)
pg_lo_open() alias.


pg_lo_read_all

public static LongValue pg_lo_read_all(Env env,
                                       java.lang.Object largeObject)
Reads an entire large object and send straight to browser


pg_loreadall

public static LongValue pg_loreadall(Env env,
                                     java.lang.Object largeObject)
pg_lo_read_all() alias.


pg_lo_read

public static StringValue pg_lo_read(Env env,
                                     java.lang.Object largeObject,
                                     int len)
Read a large object


pg_loread

public static StringValue pg_loread(Env env,
                                    java.lang.Object largeObject,
                                    int len)
pg_lo_read() alias.


pg_lo_seek

public static boolean pg_lo_seek(Env env,
                                 java.lang.Object largeObject,
                                 int offset,
                                 int whence)
Seeks position within a large object


pg_lo_tell

public static int pg_lo_tell(Env env,
                             java.lang.Object largeObject)
Returns current seek position a of large object


pg_lo_unlink

public static boolean pg_lo_unlink(Env env,
                                   Postgres conn,
                                   int oid)
Delete a large object


pg_lounlink

public static boolean pg_lounlink(Env env,
                                  Postgres conn,
                                  int oid)
pg_lo_unlink() alias.


pg_lo_write

public static LongValue pg_lo_write(Env env,
                                    java.lang.Object largeObject,
                                    java.lang.String data,
                                    int len)
Write to a large object


pg_lowrite

public static LongValue pg_lowrite(Env env,
                                   java.lang.Object largeObject,
                                   java.lang.String data,
                                   int len)
pg_lo_write() alias.


pg_meta_data

public static ArrayValue pg_meta_data(Env env,
                                      Postgres conn,
                                      java.lang.String tableName)
Get meta data for table


pg_num_fields

public static int pg_num_fields(Env env,
                                PostgresResult result)
Returns the number of fields in a result


pg_numfields

public static int pg_numfields(Env env,
                               PostgresResult result)
pg_num_fields() alias.


pg_num_rows

public static LongValue pg_num_rows(Env env,
                                    PostgresResult result)
Returns the number of rows in a result


pg_numrows

public static LongValue pg_numrows(Env env,
                                   PostgresResult result)
pg_num_rows() alias.


pg_options

public static java.lang.String pg_options(Env env,
                                          Postgres conn)
Get the options associated with the connection


pg_parameter_status

public static Value pg_parameter_status(Env env,
                                        Postgres conn,
                                        StringValue paramName)
Looks up a current parameter setting of the server


pg_parameter_status

public static Value pg_parameter_status(Env env,
                                        StringValue paramName)
Looks up a current parameter setting of the server


pg_pconnect

public static Postgres pg_pconnect(Env env,
                                   java.lang.String connectionString,
                                   int connectType)
Open a persistent PostgreSQL connection


pg_ping

public static boolean pg_ping(Env env,
                              Postgres conn)
Ping database connection


pg_port

public static StringValue pg_port(Env env,
                                  Postgres conn)
Return the port number associated with the connection


pg_prepare

public static PostgresStatement pg_prepare(Env env,
                                           Postgres conn,
                                           java.lang.String stmtName,
                                           java.lang.String query)
Submits a request to create a prepared statement with the given parameters, and waits for completion


pg_put_line

public static boolean pg_put_line(Env env,
                                  Postgres conn,
                                  java.lang.String data)
Send a NULL-terminated string to PostgreSQL backend


pg_query_params

public static PostgresResult pg_query_params(Env env,
                                             Postgres conn,
                                             java.lang.String query,
                                             ArrayValue params)
Submits a command to the server and waits for the result, with the ability to pass parameters separately from the SQL command text


pg_query

public static PostgresResult pg_query(Env env,
                                      java.lang.String query)
Execute a query


pg_query

public static PostgresResult pg_query(Env env,
                                      Postgres conn,
                                      java.lang.String query)
Execute a query


pg_exec

public static PostgresResult pg_exec(Env env,
                                     Postgres conn,
                                     java.lang.String query)
pg_query() alias


pg_result_error_field

public static Value pg_result_error_field(Env env,
                                          PostgresResult result,
                                          int fieldCode)
Returns an individual field of an error report


pg_result_error

public static java.lang.String pg_result_error(Env env,
                                               PostgresResult result)
Get error message associated with result


pg_result_seek

public static boolean pg_result_seek(Env env,
                                     PostgresResult result,
                                     int offset)
Set internal row offset in result resource


pg_result_status

public static int pg_result_status(Env env,
                                   PostgresResult result,
                                   int type)
Get status of query result


pg_select

public static ArrayValue pg_select(Env env,
                                   Postgres conn,
                                   java.lang.String tableName,
                                   ArrayValue assocArray,
                                   int options)
Select records


pg_send_execute

public static boolean pg_send_execute(Env env,
                                      Postgres conn,
                                      java.lang.String stmtName,
                                      ArrayValue params)
Sends a request to execute a prepared statement with given parameters, without waiting for the result(s)


pg_send_prepare

public static boolean pg_send_prepare(Env env,
                                      Postgres conn,
                                      java.lang.String stmtName,
                                      java.lang.String query)
Sends a request to create a prepared statement with the given parameters, without waiting for completion


pg_send_query_params

public static boolean pg_send_query_params(Env env,
                                           Postgres conn,
                                           java.lang.String query,
                                           ArrayValue params)
Submits a command and separate parameters to the server without waiting for the result(s)


pg_send_query

public static boolean pg_send_query(Env env,
                                    Postgres conn,
                                    java.lang.String query)
Sends asynchronous query


pg_set_client_encoding

public static int pg_set_client_encoding(Env env,
                                         Postgres conn,
                                         java.lang.String encoding)
Set the client encoding


pg_set_error_verbosity

public static int pg_set_error_verbosity(Env env,
                                         Postgres conn,
                                         int intVerbosity)
Determines the verbosity of messages returned by pg_last_error() and pg_result_error()


pg_trace

public static boolean pg_trace(Env env,
                               Path path,
                               java.lang.String mode,
                               Postgres conn)
Enable tracing a PostgreSQL connection


pg_transaction_status

public static int pg_transaction_status(Env env,
                                        Postgres conn)
Returns the current in-transaction status of the server


pg_tty

public static java.lang.String pg_tty(Env env,
                                      Postgres conn)
Return the TTY name associated with the connection


pg_unescape_bytea

public static java.lang.String pg_unescape_bytea(Env env,
                                                 java.lang.String data)
Unescape binary for bytea type


pg_untrace

public static boolean pg_untrace(Env env,
                                 Postgres conn)
Disable tracing of a PostgreSQL connection


pg_update

public static boolean pg_update(Env env,
                                Postgres conn,
                                java.lang.String tableName,
                                ArrayValue data,
                                ArrayValue condition,
                                int options)
Update table


pg_version

public static ArrayValue pg_version(Env env,
                                    Postgres conn)
Returns an array with client, protocol and server version (when available)