Module: PG::Constants

Included in:
PG, Connection, Result
Defined in:
lib/pg/constants.rb,
ext/pg.c

Constant Summary collapse

CONNECTION_OK =

Connection succeeded

INT2FIX(CONNECTION_OK)
CONNECTION_BAD =

Connection failed

INT2FIX(CONNECTION_BAD)
CONNECTION_STARTED =

Waiting for connection to be made.

INT2FIX(CONNECTION_STARTED)
CONNECTION_MADE =

Connection OK; waiting to send.

INT2FIX(CONNECTION_MADE)
CONNECTION_AWAITING_RESPONSE =

Waiting for a response from the server.

INT2FIX(CONNECTION_AWAITING_RESPONSE)
CONNECTION_AUTH_OK =

Received authentication; waiting for backend start-up to finish.

INT2FIX(CONNECTION_AUTH_OK)
CONNECTION_SSL_STARTUP =

Negotiating SSL encryption.

INT2FIX(CONNECTION_SSL_STARTUP)
CONNECTION_SETENV =

Negotiating environment-driven parameter settings.

INT2FIX(CONNECTION_SETENV)
CONNECTION_NEEDED =

connect() needed.

Internal state
PGRES_POLLING_READING =

Async connection is waiting to read

INT2FIX(PGRES_POLLING_READING)
PGRES_POLLING_WRITING =

Async connection is waiting to write

INT2FIX(PGRES_POLLING_WRITING)
PGRES_POLLING_FAILED =

Async connection failed or was reset

INT2FIX(PGRES_POLLING_FAILED)
PGRES_POLLING_OK =

Async connection succeeded

INT2FIX(PGRES_POLLING_OK)
PQTRANS_IDLE =

Transaction is currently idle (#transaction_status)

INT2FIX(PQTRANS_IDLE)
PQTRANS_ACTIVE =

Transaction is currently active; query has been sent to the server, but not yet completed. (#transaction_status)

INT2FIX(PQTRANS_ACTIVE)
PQTRANS_INTRANS =

Transaction is currently idle, in a valid transaction block (#transaction_status)

INT2FIX(PQTRANS_INTRANS)
PQTRANS_INERROR =

Transaction is currently idle, in a failed transaction block (#transaction_status)

INT2FIX(PQTRANS_INERROR)
PQTRANS_UNKNOWN =

Transaction's connection is bad (#transaction_status)

INT2FIX(PQTRANS_UNKNOWN)
PQERRORS_TERSE =

Terse error verbosity level (#set_error_verbosity)

INT2FIX(PQERRORS_TERSE)
PQERRORS_DEFAULT =

Default error verbosity level (#set_error_verbosity)

INT2FIX(PQERRORS_DEFAULT)
PQERRORS_VERBOSE =

Verbose error verbosity level (#set_error_verbosity)

INT2FIX(PQERRORS_VERBOSE)
PQPING_OK =

Server is accepting connections.

INT2FIX(PQPING_OK)
PQPING_REJECT =

Server is alive but rejecting connections.

INT2FIX(PQPING_REJECT)
PQPING_NO_RESPONSE =

Could not establish connection.

INT2FIX(PQPING_NO_RESPONSE)
PQPING_NO_ATTEMPT =

Connection not attempted (bad params).

INT2FIX(PQPING_NO_ATTEMPT)
INV_WRITE =

Flag for #lo_creat, #lo_open – open for writing

INT2FIX(INV_WRITE)
INV_READ =

Flag for #lo_creat, #lo_open – open for reading

INT2FIX(INV_READ)
SEEK_SET =

Flag for #lo_lseek – seek from object start

INT2FIX(SEEK_SET)
SEEK_CUR =

Flag for #lo_lseek – seek from current position

INT2FIX(SEEK_CUR)
SEEK_END =

Flag for #lo_lseek – seek from object end

INT2FIX(SEEK_END)
PGRES_EMPTY_QUERY =

The string sent to the server was empty.

#result_status constant
PGRES_COMMAND_OK =

Successful completion of a command returning no data.

#result_status constant
PGRES_TUPLES_OK =

Successful completion of a command returning data

(such as a SELECT or SHOW).
#result_status constant
PGRES_COPY_OUT =

Copy Out (from server) data transfer started.

#result_status constant
PGRES_COPY_IN =

Copy In (to server) data transfer started.

#result_status constant
PGRES_BAD_RESPONSE =

The server’s response was not understood.

#result_status constant
PGRES_NONFATAL_ERROR =

A nonfatal error (a notice or warning) occurred.

#result_status constant
PGRES_FATAL_ERROR =

A fatal error occurred.

#result_status constant
PGRES_COPY_BOTH =
INT2FIX(PGRES_COPY_BOTH)
PGRES_SINGLE_TUPLE =
INT2FIX(PGRES_SINGLE_TUPLE)
PG_DIAG_SEVERITY =

The severity; the field contents are ERROR, FATAL, or PANIC (in an error message), or WARNING, NOTICE, DEBUG, INFO, or LOG (in a notice message), or a localized translation of one of these. Always present.

#result_error_field argument constant
PG_DIAG_SQLSTATE =

The SQLSTATE code for the error. The SQLSTATE code identies the type of error that has occurred; it can be used by front-end applications to perform specic operations (such as er- ror handling) in response to a particular database error. For a list of the possible SQLSTATE codes, see Appendix A. This eld is not localizable, and is always present.

#result_error_field argument constant
PG_DIAG_MESSAGE_PRIMARY =

The primary human-readable error message (typically one line). Always present.

#result_error_field argument constant
PG_DIAG_MESSAGE_DETAIL =

Detail: an optional secondary error message carrying more detail about the problem. Might run to multiple lines.

#result_error_field argument constant
PG_DIAG_MESSAGE_HINT =

Hint: an optional suggestion what to do about the problem. This is intended to differ from detail in that it offers advice (potentially inappropriate) rather than hard facts. Might run to multiple lines.

#result_error_field argument constant
PG_DIAG_STATEMENT_POSITION =

A string containing a decimal integer indicating an error cursor position as an index into the original statement string. The rst character has index 1, and positions are measured in characters not bytes.

#result_error_field argument constant
PG_DIAG_INTERNAL_POSITION =

This is dened the same as the PG_DIAG_STATEMENT_POSITION eld, but it is used when the cursor position refers to an internally generated command rather than the one submitted by the client. The PG_DIAG_INTERNAL_QUERY eld will always appear when this eld appears.

#result_error_field argument constant
PG_DIAG_INTERNAL_QUERY =

The text of a failed internally-generated command. This could be, for example, a SQL query issued by a PL/pgSQL function.

#result_error_field argument constant
PG_DIAG_CONTEXT =

An indication of the context in which the error occurred. Presently this includes a call stack traceback of active procedural language functions and internally-generated queries. The trace is one entry per line, most recent rst.

#result_error_field argument constant
PG_DIAG_SOURCE_FILE =

The le name of the source-code location where the error was reported.

#result_error_field argument constant
PG_DIAG_SOURCE_LINE =

The line number of the source-code location where the error was reported.

#result_error_field argument constant
PG_DIAG_SOURCE_FUNCTION =

The name of the source-code function reporting the error.

#result_error_field argument constant
PG_DIAG_SCHEMA_NAME =

If the error was associated with a specific database object, the name of the schema containing that object, if any.

#result_error_field argument constant
PG_DIAG_TABLE_NAME =

If the error was associated with a specific table, the name of the table. (When this field is present, the schema name field provides the name of the table's schema.)

#result_error_field argument constant
PG_DIAG_COLUMN_NAME =

If the error was associated with a specific table column, the name of the column. (When this field is present, the schema and table name fields identify the table.)

#result_error_field argument constant
PG_DIAG_DATATYPE_NAME =

If the error was associated with a specific datatype, the name of the datatype. (When this field is present, the schema name field provides the name of the datatype's schema.)

#result_error_field argument constant
PG_DIAG_CONSTRAINT_NAME =

If the error was associated with a specific constraint, the name of the constraint. The table or domain that the constraint belongs to is reported using the fields listed above. (For this purpose, indexes are treated as constraints, even if they weren't created with constraint syntax.)

#result_error_field argument constant
INVALID_OID =

Invalid OID constant

INT2FIX(InvalidOid)
InvalidOid =
INT2FIX(InvalidOid)