Type:
Class
Constants:
ADAPTER_NAME : 'PostgreSQL'
NATIVE_DATABASE_TYPES : { primary_key: "serial primary key", string: { name: "character varying", limit: 255 }, text: { name: "text" }, integer: { name: "integer" }, float: { name: "float" }, decimal: { name: "decimal" }, datetime: { name: "timestamp" }, timestamp: { name: "timestamp" }, time: { name: "time" }, date: { name: "date" }, daterange: { name: "daterange" }, numrange: { name: "numrange" }, tsrange: { name: "tsrange" }, tstzrange: { name: "tstzrange" }, int4range: { name: "int4range" }, int8range: { name: "int8range" }, binary: { name: "bytea" }, boolean: { name: "boolean" }, xml: { name: "xml" }, tsvector: { name: "tsvector" }, hstore: { name: "hstore" }, inet: { name: "inet" }, cidr: { name: "cidr" }, macaddr: { name: "macaddr" }, uuid: { name: "uuid" }, json: { name: "json" }, ltree: { name: "ltree" } }
FOREIGN_KEY_VIOLATION : "23503"

See www.postgresql.org/docs/9.1/static/errcodes-appendix.html

UNIQUE_VIOLATION : "23505"
FEATURE_NOT_SUPPORTED : "0A000"
MONEY_COLUMN_TYPE_OID : 790

The internal PostgreSQL identifier of the money data type.

BYTEA_COLUMN_TYPE_OID : 17

The internal PostgreSQL identifier of the BYTEA data type.

The PostgreSQL adapter works with the native C (bitbucket.org/ged/ruby-pg) driver.

Options:

  • :host - Defaults to a Unix-domain socket in /tmp. On machines without Unix-domain sockets, the default is to connect to localhost.

  • :port - Defaults to 5432.

  • :username - Defaults to be the same as the operating system name of the user running the application.

  • :password - Password to be used if the server demands password authentication.

  • :database - Defaults to be the same as the user name.

  • :schema_search_path - An optional schema search path for the connection given as a string of comma-separated schema names. This is backward-compatible with the :schema_order option.

  • :encoding - An optional client encoding that is used in a SET client_encoding TO <encoding> call on the connection.

  • :min_messages - An optional client min messages that is used in a SET client_min_messages TO <min_messages> call on the connection.

  • :variables - An optional hash of additional parameters that will be used in SET SESSION key = val calls on the connection.

  • :insert_returning - An optional boolean to control the use or RETURNING for INSERT statements defaults to true.

Any further options are used as connection parameters to libpq. See www.postgresql.org/docs/9.1/static/libpq-connect.html for the list of parameters.

In addition, default connection parameters of libpq can be set per environment variables. See www.postgresql.org/docs/9.1/static/libpq-envars.html .

alias_type
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID

alias_type(new, old) Class Public methods Alias the old type to

2025-01-10 15:47:30
type
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID::Date

type() Instance Public methods

2025-01-10 15:47:30
json
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ColumnMethods

json(name, options = {}) Instance Public methods

2025-01-10 15:47:30
client_min_messages
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements

client_min_messages() Instance Public methods Returns the current client message

2025-01-10 15:47:30
index_name_exists?
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements

index_name_exists?(table_name, index_name, default) Instance Public methods

2025-01-10 15:47:30
change_column_null
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements

change_column_null(table_name, column_name, null, default = nil) Instance Public methods

2025-01-10 15:47:30
primary_key
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements

primary_key(table) Instance Public methods Returns just a table's primary key

2025-01-10 15:47:30
delete
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool

delete(sql_key) Instance Public methods

2025-01-10 15:47:30
change_column_default
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements

change_column_default(table_name, column_name, default) Instance Public methods Changes

2025-01-10 15:47:30
schema_search_path=
  • References/Ruby on Rails/Rails/Classes/ActiveRecord/ActiveRecord::ConnectionAdapters/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter/ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements

schema_search_path=(schema_csv) Instance Public methods Sets the schema search

2025-01-10 15:47:30