class PostgreSQLAdapter
Ruby on Rails 4.1.16
Since v2.2.3The 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_orderoption. -
:encoding- An optional client encoding that is used in aSET client_encoding TO <encoding>call on the connection. -
:min_messages- An optional client min messages that is used in aSET client_min_messages TO <min_messages>call on the connection. -
:variables- An optional hash of additional parameters that will be used inSET SESSION key = valcalls on the connection. -
:insert_returning- An optional boolean to control the use orRETURNINGforINSERTstatements 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 .
Inherits from
Namespace
Modules
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ColumnMethods
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::DatabaseStatements
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::OID
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Quoting
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ReferentialIntegrity
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Utils
Classes
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ColumnDefinition
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaCreation
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::StatementPool
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::Table
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::TableDefinition
Includes
Constants
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::ADAPTER_NAME
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::BYTEA_COLUMN_TYPE_OID
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::FEATURE_NOT_SUPPORTED
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::FOREIGN_KEY_VIOLATION
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::MONEY_COLUMN_TYPE_OID
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::NATIVE_DATABASE_TYPES
- ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::UNIQUE_VIOLATION
Methods (defined here)
- # active?
- # active_threadsafe?
- # adapter_name
- # clear_cache!
- # disable_extension
- # disconnect!
- # enable_extension
- # extension_enabled?
- # extensions
- # index_algorithms
- # migration_keys
- # postgresql_version
- # prepare_column_options
- # reconnect!
- # reset!
- # schema_creation
- # session_auth=
- # set_standard_conforming_strings
- # supports_ddl_transactions?
- # supports_explain?
- # supports_extensions?
- # supports_index_sort_order?
- # supports_insert_with_returning?
- # supports_migrations?
- # supports_partial_index?
- # supports_ranges?
- # supports_statement_cache?
- # supports_transaction_isolation?
- # table_alias_length
- # translate_exception
- # use_insert_returning?
- # valid_type?
- self. new
Private methods
(16)
Implementation detail — not part of the public API.
Methods (inherited)
From ActiveRecord::ConnectionAdapters::AbstractAdapter (49)
- # active?
- # active_threadsafe?
- # adapter_name
- # case_insensitive_comparison
- # case_sensitive_modifier
- # clear_cache!
- # close
- # create_savepoint
- # current_savepoint_name
- # disable_extension
- # disable_referential_integrity
- # disconnect!
- # enable_extension
- # expire
- # extensions
- # index_algorithms
- # lease
- # log
- # open_transactions
- # prefetch_primary_key?
- # raw_connection
- # reconnect!
- # release_savepoint
- # requires_reloading?
- # reset!
- # rollback_to_savepoint
- # schema_cache=
- # schema_creation
- # substitute_at
- # supports_bulk_alter?
- # supports_count_distinct?
- # supports_ddl_transactions?
- # supports_explain?
- # supports_extensions?
- # supports_index_sort_order?
- # supports_migrations?
- # supports_partial_index?
- # supports_primary_key?
- # supports_savepoints?
- # supports_transaction_isolation?
- # translate_exception
- # translate_exception_class
- # unprepared_statement
- # unprepared_visitor
- # valid_type?
- # verify!
- # without_prepared_statement?
- self. type_cast_config_to_boolean
- self. type_cast_config_to_integer
From ActiveRecord::ConnectionAdapters::PostgreSQLAdapter::SchemaStatements (30)
- # add_column
- # change_column
- # change_column_default
- # change_column_null
- # client_min_messages
- # client_min_messages=
- # collation
- # columns
- # create_database
- # create_schema
- # ctype
- # current_database
- # current_schema
- # drop_schema
- # encoding
- # index_name_exists?
- # index_name_length
- # indexes
- # primary_key
- # rename_column
- # rename_index
- # rename_table
- # schema_exists?
- # schema_names
- # schema_search_path
- # schema_search_path=
- # serial_sequence
- # table_exists?
- # tables
- # type_to_sql
From ActiveRecord::ConnectionAdapters::QueryCache (8)
- # cache
- # clear_query_cache
- # disable_query_cache!
- # enable_query_cache!
- # select_all
- # uncached
- self. dirties_query_cache
- self. new
From ActiveSupport::Callbacks (1)
From Object (22)
- # <
- # acts_like?
- # blank?
- # create_fixtures
- # deep_dup
- # destroy
- # duplicable?
- # html_safe?
- # in?
- # instance_values
- # instance_variable_names
- # presence
- # presence_in
- # present?
- # to_json_with_active_support_encoder
- # to_param
- # to_query
- # try
- # try!
- # unescape
- # with_options
- self. table_name_prefix
From ActiveSupport::Concern (2)
From ActiveSupport::DescendantsTracker (7)
- # descendants
- # direct_descendants
- # inherited
- self. clear
- self. descendants
- self. direct_descendants
- self. store_inherited