Class DBI::DBD::Pg::Database
In: lib/dbd/pg/database.rb
Parent: DBI::BaseDatabase



POSTGRESQL_to_XOPEN = { "boolean" => [DBI::SQL_CHAR, 1, nil], "character" => [DBI::SQL_CHAR, 1, nil], "char" => [DBI::SQL_CHAR, 1, nil], "real" => [DBI::SQL_REAL, 4, 6], "double precision" => [DBI::SQL_DOUBLE, 8, 15], "smallint" => [DBI::SQL_SMALLINT, 2], "integer" => [DBI::SQL_INTEGER, 4], "bigint" => [DBI::SQL_BIGINT, 8], "numeric" => [DBI::SQL_NUMERIC, nil, nil], "time with time zone" => [DBI::SQL_TIME, nil, nil], "timestamp with time zone" => [DBI::SQL_TIMESTAMP, nil, nil], "bit varying" => [DBI::SQL_BINARY, nil, nil], #huh?? "character varying" => [DBI::SQL_VARCHAR, nil, nil], "bit" => [DBI::SQL_TINYINT, nil, nil], "text" => [DBI::SQL_VARCHAR, nil, nil], nil => [DBI::SQL_OTHER, nil, nil]   type map


type_map  [R] 

Public Class methods

See DBI::BaseDatabase#new. These attributes are also supported:

  • pg_async: boolean or strings ‘true’ or ‘false’. Indicates if we‘re to use PostgreSQL‘s asyncrohonous support. ‘NonBlocking’ is a synonym for this.
  • AutoCommit: ‘unchained’ mode in PostgreSQL. Commits after each statement execution.
  • pg_client_encoding: set the encoding for the client.
  • pg_native_binding: Boolean. Indicates whether to use libpq native binding or DBI‘s inline binding. Defaults to true.

Public Instance methods

Export a BLOB to a file.

Import a BLOB from a file.

Read a BLOB and return the data.

Remove a BLOB.

Write the value to the BLOB.

return the postgresql types for this session. returns an oid -> type name mapping.


See DBI::BaseDatabase.

These additional attributes are also supported:

  • nullable: true if NULL values are allowed in this column.
  • indexed: true if this column is a part of an index.
  • primary: true if this column is a part of a primary key.
  • unique: true if this column is a part of a unique key.
  • default: what will be insert if this column is left out of an insert query.
  • array_of_type: true if this is actually an array of this type. dbi_type will be the type authority if this is the case.

Are we in an transaction?

Forcibly initializes a new transaction.

Private Instance methods

Gathers the types from the postgres database and attempts to locate matching DBI::Type objects for them.

special quoting if value is element of an array