Class | ActiveRecord::ConnectionAdapters::PostgreSQLAdapter |
In: |
lib/active_record/connection_adapters/postgresql_adapter.rb
|
Parent: | AbstractAdapter |
The PostgreSQL adapter works both with the native C (ruby.scripting.ca/postgres/) and the pure Ruby (available both as gem and from rubyforge.org/frs/?group_id=234&release_id=1944) drivers.
Options:
ADAPTER_NAME | = | 'PostgreSQL'.freeze | ||
NATIVE_DATABASE_TYPES | = | { :primary_key => "serial primary key".freeze, :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" }, :binary => { :name => "bytea" }, :boolean => { :name => "boolean" } | ||
PQTRANS_IDLE | = | defined?(PGconn::PQTRANS_IDLE) ? PGconn::PQTRANS_IDLE : 0 | ruby-pg defines Ruby constants for transaction status, ruby-postgres does not. |
Adds a new column to the named table. See TableDefinition#column for details of the options you can use.
Executes an SQL statement, returning a PGresult object on success or raising a PGError exception otherwise.
Executes an INSERT query and returns the new record‘s ID
Sets the schema search path to a string of comma-separated schema names. Names beginning with $ have to be quoted (e.g. $user => ’$user’). See: www.postgresql.org/docs/current/static/ddl-schemas.html
This should be not be called manually but set in database.yml.
Returns the configured supported identifier length supported by PostgreSQL, or report the default of 63 on PostgreSQL 7.x.
Wrap a block in a transaction. Returns result of block.
Unescapes bytea output from a database to the binary string it represents. NOTE: This is NOT an inverse of escape_bytea! This is only to be used
on escaped binary output from database drive.