### Home Classes Methods

### In Files

- lib/sequel/adapters/shared/postgres.rb

### Namespace

- MODULE Sequel::Postgres::DatasetMethods::PreparedStatementMethods

### Methods

- ::extended
- ::included
- #_import
- #analyze
- #complex_expression_sql_append
- #compound_dataset_sql_append
- #delete_clause_methods
- #delete_from_sql
- #delete_using_sql
- #disable_insert_returning
- #explain
- #for_share
- #full_text_search
- #full_text_string_join
- #insert
- #insert_clause_methods
- #insert_pk
- #insert_select
- #join_from_sql
- #literal_blob_append
- #literal_false
- #literal_float
- #literal_string_append
- #literal_true
- #lock
- #multi_insert_sql
- #select_clause_methods
- #select_lock_sql
- #select_window_sql
- #select_with_sql_base
- #server_version
- #supports_cte_in_subqueries?
- #supports_distinct_on?
- #supports_modifying_joins?
- #supports_returning?
- #supports_timestamp_timezones?
- #supports_window_functions?
- #update_clause_methods
- #update_from_sql
- #update_table_sql
- #window

### Files

- CHANGELOG
- MIT-LICENSE
- README.rdoc
- active_record.rdoc
- advanced_associations.rdoc
- association_basics.rdoc
- cheat_sheet.rdoc
- dataset_basics.rdoc
- dataset_filtering.rdoc
- mass_assignment.rdoc
- migration.rdoc
- model_hooks.rdoc
- opening_databases.rdoc
- prepared_statements.rdoc
- querying.rdoc
- reflection.rdoc
- 1.0.txt
- 1.1.txt
- 1.3.txt
- 1.4.0.txt
- 1.5.0.txt
- 2.0.0.txt
- 2.1.0.txt
- 2.10.0.txt
- 2.11.0.txt
- 2.12.0.txt
- 2.2.0.txt
- 2.3.0.txt
- 2.4.0.txt
- 2.5.0.txt
- 2.6.0.txt
- 2.7.0.txt
- 2.8.0.txt
- 2.9.0.txt
- 3.0.0.txt
- 3.1.0.txt
- 3.10.0.txt
- 3.11.0.txt
- 3.12.0.txt
- 3.13.0.txt
- 3.14.0.txt
- 3.15.0.txt
- 3.16.0.txt
- 3.17.0.txt
- 3.18.0.txt
- 3.19.0.txt
- 3.2.0.txt
- 3.20.0.txt
- 3.21.0.txt
- 3.22.0.txt
- 3.23.0.txt
- 3.24.0.txt
- 3.25.0.txt
- 3.26.0.txt
- 3.27.0.txt
- 3.28.0.txt
- 3.29.0.txt
- 3.3.0.txt
- 3.30.0.txt
- 3.31.0.txt
- 3.32.0.txt
- 3.33.0.txt
- 3.4.0.txt
- 3.5.0.txt
- 3.6.0.txt
- 3.7.0.txt
- 3.8.0.txt
- 3.9.0.txt
- schema_modification.rdoc
- sharding.rdoc
- sql.rdoc
- testing.rdoc
- transactions.rdoc
- validations.rdoc
- virtual_rows.rdoc

### Class Index

Quicksearch

- Sequel
- Sequel::ADO
- Sequel::ADO::Database
- Sequel::ADO::Dataset
- Sequel::ADO::MSSQL
- Sequel::ADO::MSSQL::DatabaseMethods
- Sequel::ADO::MSSQL::Dataset
- Sequel::ASTTransformer
- Sequel::Access
- Sequel::Access::DatabaseMethods
- Sequel::Access::DatasetMethods
- Sequel::Adapter
- Sequel::AdapterNotFound
- Sequel::AdapterNotFound
- Sequel::Amalgalite
- Sequel::Amalgalite::Database
- Sequel::Amalgalite::Dataset
- Sequel::Amalgalite::SequelTypeMap
- Sequel::ArbitraryServers
- Sequel::BasicObject
- Sequel::ColumnsIntrospection
- Sequel::ConnectionPool
- Sequel::ConnectionPool::ClassMethods
- Sequel::DB2
- Sequel::DB2::DB2Error
- Sequel::DB2::Database
- Sequel::DB2::DatabaseMethods
- Sequel::DB2::Dataset
- Sequel::DB2::DatasetMethods
- Sequel::DBI
- Sequel::DBI::Database
- Sequel::DBI::Dataset
- Sequel::DataObjects
- Sequel::DataObjects::Database
- Sequel::DataObjects::Dataset
- Sequel::DataObjects::MySQL
- Sequel::DataObjects::MySQL::DatabaseMethods
- Sequel::DataObjects::MySQL::Dataset
- Sequel::DataObjects::Postgres
- Sequel::DataObjects::Postgres::AdapterMethods
- Sequel::DataObjects::Postgres::DatabaseMethods
- Sequel::DataObjects::Postgres::Dataset
- Sequel::DataObjects::SQLite
- Sequel::DataObjects::SQLite::DatabaseMethods
- Sequel::DataObjects::SQLite::Dataset
- Sequel::Database
- Sequel::DatabaseConnectionError
- Sequel::DatabaseDisconnectError
- Sequel::DatabaseError
- Sequel::Dataset
- Sequel::Dataset
- Sequel::Dataset::ArgumentMapper
- Sequel::Dataset::BindArgumentMethods
- Sequel::Dataset::Pagination
- Sequel::Dataset::PreparedStatementMethods
- Sequel::Dataset::QueryBlockCopy
- Sequel::Dataset::StoredProcedureMethods
- Sequel::Dataset::StoredProcedures
- Sequel::Dataset::TYPE_TRANSLATOR
- Sequel::Dataset::UnnumberedArgumentMapper
- Sequel::EmulateOffsetWithRowNumber
- Sequel::Error
- Sequel::Firebird
- Sequel::Firebird::Database
- Sequel::Firebird::DatabaseMethods
- Sequel::Firebird::Dataset
- Sequel::Firebird::DatasetMethods
- Sequel::HookFailed
- Sequel::HookFailed
- Sequel::IBMDB
- Sequel::IBMDB::Connection
- Sequel::IBMDB::Connection::Error
- Sequel::IBMDB::Database
- Sequel::IBMDB::Dataset
- Sequel::IBMDB::Dataset::CallableStatementMethods
- Sequel::IBMDB::Dataset::PreparedStatementMethods
- Sequel::IBMDB::Statement
- Sequel::Inflections
- Sequel::Informix
- Sequel::Informix::Database
- Sequel::Informix::DatabaseMethods
- Sequel::Informix::Dataset
- Sequel::Informix::DatasetMethods
- Sequel::IntegerMigrator
- Sequel::InvalidOperation
- Sequel::InvalidOperation
- Sequel::InvalidValue
- Sequel::InvalidValue
- Sequel::JDBC
- Sequel::JDBC::AS400
- Sequel::JDBC::AS400::DatabaseMethods
- Sequel::JDBC::AS400::Dataset
- Sequel::JDBC::DB2
- Sequel::JDBC::DB2::DatabaseMethods
- Sequel::JDBC::DB2::Dataset
- Sequel::JDBC::Database
- Sequel::JDBC::Derby
- Sequel::JDBC::Derby::DatabaseMethods
- Sequel::JDBC::Derby::Dataset
- Sequel::JDBC::Firebird
- Sequel::JDBC::Firebird::DatabaseMethods
- Sequel::JDBC::Firebird::Dataset
- Sequel::JDBC::H2
- Sequel::JDBC::H2::DatabaseMethods
- Sequel::JDBC::H2::Dataset
- Sequel::JDBC::HSQLDB
- Sequel::JDBC::HSQLDB::DatabaseMethods
- Sequel::JDBC::HSQLDB::Dataset
- Sequel::JDBC::Informix
- Sequel::JDBC::Informix::DatabaseMethods
- Sequel::JDBC::Informix::Dataset
- Sequel::JDBC::JTDS
- Sequel::JDBC::JTDS::DatabaseMethods
- Sequel::JDBC::JTDS::Dataset
- Sequel::JDBC::JavaLang
- Sequel::JDBC::JavaSQL
- Sequel::JDBC::JavaxNaming
- Sequel::JDBC::MSSQL
- Sequel::JDBC::MSSQL::DatabaseMethods
- Sequel::JDBC::MySQL
- Sequel::JDBC::MySQL::DatabaseMethods
- Sequel::JDBC::MySQL::Dataset
- Sequel::JDBC::Oracle
- Sequel::JDBC::Oracle::DatabaseMethods
- Sequel::JDBC::Oracle::Dataset
- Sequel::JDBC::Postgres
- Sequel::JDBC::Postgres::AdapterMethods
- Sequel::JDBC::Postgres::DatabaseMethods
- Sequel::JDBC::Postgres::Dataset
- Sequel::JDBC::SQLServer
- Sequel::JDBC::SQLServer::DatabaseMethods
- Sequel::JDBC::SQLServer::DatabaseMethods::MetadataDatasetMethods
- Sequel::JDBC::SQLServer::Dataset
- Sequel::JDBC::SQLite
- Sequel::JDBC::SQLite::DatabaseMethods
- Sequel::JDBC::SQLite::Dataset
- Sequel::JDBC::Transactions
- Sequel::LiteralString
- Sequel::LooserTypecasting
- Sequel::MSSQL
- Sequel::MSSQL::DatabaseMethods
- Sequel::MSSQL::DatasetMethods
- Sequel::Metaprogramming
- Sequel::Migration
- Sequel::MigrationAlterTableReverser
- Sequel::MigrationDSL
- Sequel::MigrationReverser
- Sequel::Migrator
- Sequel::Migrator::Error
- Sequel::Mock
- Sequel::Mock::Connection
- Sequel::Mock::Database
- Sequel::Mock::Dataset
- Sequel::Model
- Sequel::Model::Associations
- Sequel::Model::Associations::AssociationDatasetMethods
- Sequel::Model::Associations::AssociationReflection
- Sequel::Model::Associations::ClassMethods
- Sequel::Model::Associations::DatasetMethods
- Sequel::Model::Associations::EagerGraphLoader
- Sequel::Model::Associations::InstanceMethods
- Sequel::Model::Associations::ManyToManyAssociationReflection
- Sequel::Model::Associations::ManyToOneAssociationReflection
- Sequel::Model::Associations::OneToManyAssociationReflection
- Sequel::Model::Associations::OneToOneAssociationReflection
- Sequel::Model::ClassMethods
- Sequel::Model::DatasetMethods
- Sequel::Model::Errors
- Sequel::Model::InstanceMethods
- Sequel::MySQL
- Sequel::MySQL::DatabaseMethods
- Sequel::MySQL::DatasetMethods
- Sequel::MySQL::DatasetMethods::CallableStatementMethods
- Sequel::MySQL::DatasetMethods::PreparedStatementMethods
- Sequel::MySQL::DatasetMethods::StoredProcedureMethods
- Sequel::MySQL::PreparedStatements
- Sequel::MySQL::PreparedStatements::DatabaseMethods
- Sequel::Mysql2
- Sequel::Mysql2::Database
- Sequel::Mysql2::Dataset
- Sequel::NamedTimezones
- Sequel::NoExistingObject
- Sequel::NoExistingObject
- Sequel::NotImplemented
- Sequel::ODBC
- Sequel::ODBC::DB2
- Sequel::ODBC::DB2::DatabaseMethods
- Sequel::ODBC::DB2::Dataset
- Sequel::ODBC::Database
- Sequel::ODBC::Dataset
- Sequel::ODBC::MSSQL
- Sequel::ODBC::MSSQL::DatabaseMethods
- Sequel::ODBC::MSSQL::Dataset
- Sequel::OpenBase
- Sequel::OpenBase::Database
- Sequel::OpenBase::Dataset
- Sequel::Oracle
- Sequel::Oracle::Database
- Sequel::Oracle::DatabaseMethods
- Sequel::Oracle::DatasetMethods
- Sequel::Plugins
- Sequel::Plugins::ActiveModel
- Sequel::Plugins::ActiveModel::ClassMethods
- Sequel::Plugins::ActiveModel::InstanceMethods
- Sequel::Plugins::AssociationAutoreloading
- Sequel::Plugins::AssociationAutoreloading::ClassMethods
- Sequel::Plugins::AssociationDependencies
- Sequel::Plugins::AssociationDependencies::ClassMethods
- Sequel::Plugins::AssociationDependencies::InstanceMethods
- Sequel::Plugins::AssociationPks
- Sequel::Plugins::AssociationPks::ClassMethods
- Sequel::Plugins::AssociationPks::InstanceMethods
- Sequel::Plugins::AssociationProxies
- Sequel::Plugins::AssociationProxies::AssociationProxy
- Sequel::Plugins::AssociationProxies::ClassMethods
- Sequel::Plugins::BooleanReaders
- Sequel::Plugins::BooleanReaders::ClassMethods
- Sequel::Plugins::Caching
- Sequel::Plugins::Caching::ClassMethods
- Sequel::Plugins::Caching::InstanceMethods
- Sequel::Plugins::ClassTableInheritance
- Sequel::Plugins::ClassTableInheritance::ClassMethods
- Sequel::Plugins::ClassTableInheritance::InstanceMethods
- Sequel::Plugins::Composition
- Sequel::Plugins::Composition::ClassMethods
- Sequel::Plugins::Composition::InstanceMethods
- Sequel::Plugins::DatasetAssociations
- Sequel::Plugins::DatasetAssociations::ClassMethods
- Sequel::Plugins::DatasetAssociations::DatasetMethods
- Sequel::Plugins::DefaultsSetter
- Sequel::Plugins::DefaultsSetter::ClassMethods
- Sequel::Plugins::DefaultsSetter::InstanceMethods
- Sequel::Plugins::ForceEncoding
- Sequel::Plugins::ForceEncoding::ClassMethods
- Sequel::Plugins::ForceEncoding::InstanceMethods
- Sequel::Plugins::HookClassMethods
- Sequel::Plugins::HookClassMethods::ClassMethods
- Sequel::Plugins::HookClassMethods::InstanceMethods
- Sequel::Plugins::IdentityMap
- Sequel::Plugins::IdentityMap::ClassMethods
- Sequel::Plugins::IdentityMap::InstanceMethods
- Sequel::Plugins::InstanceFilters
- Sequel::Plugins::InstanceFilters::InstanceMethods
- Sequel::Plugins::InstanceHooks
- Sequel::Plugins::InstanceHooks::InstanceMethods
- Sequel::Plugins::JsonSerializer
- Sequel::Plugins::JsonSerializer::ClassMethods
- Sequel::Plugins::JsonSerializer::DatasetMethods
- Sequel::Plugins::JsonSerializer::InstanceMethods
- Sequel::Plugins::JsonSerializer::Literal
- Sequel::Plugins::LazyAttributes
- Sequel::Plugins::LazyAttributes::ClassMethods
- Sequel::Plugins::LazyAttributes::InstanceMethods
- Sequel::Plugins::List
- Sequel::Plugins::List::ClassMethods
- Sequel::Plugins::List::InstanceMethods
- Sequel::Plugins::ManyThroughMany
- Sequel::Plugins::ManyThroughMany::ClassMethods
- Sequel::Plugins::ManyThroughMany::DatasetMethods
- Sequel::Plugins::ManyThroughMany::ManyThroughManyAssociationReflection
- Sequel::Plugins::NestedAttributes
- Sequel::Plugins::NestedAttributes::ClassMethods
- Sequel::Plugins::NestedAttributes::InstanceMethods
- Sequel::Plugins::OptimisticLocking
- Sequel::Plugins::OptimisticLocking::ClassMethods
- Sequel::Plugins::OptimisticLocking::InstanceMethods
- Sequel::Plugins::PreparedStatements
- Sequel::Plugins::PreparedStatements::ClassMethods
- Sequel::Plugins::PreparedStatements::InstanceMethods
- Sequel::Plugins::PreparedStatementsAssociations
- Sequel::Plugins::PreparedStatementsAssociations::ClassMethods
- Sequel::Plugins::PreparedStatementsAssociations::InstanceMethods
- Sequel::Plugins::PreparedStatementsSafe
- Sequel::Plugins::PreparedStatementsSafe::ClassMethods
- Sequel::Plugins::PreparedStatementsSafe::InstanceMethods
- Sequel::Plugins::PreparedStatementsWithPk
- Sequel::Plugins::PreparedStatementsWithPk::ClassMethods
- Sequel::Plugins::PreparedStatementsWithPk::DatasetMethods
- Sequel::Plugins::RcteTree
- Sequel::Plugins::Schema
- Sequel::Plugins::Schema::ClassMethods
- Sequel::Plugins::Serialization
- Sequel::Plugins::Serialization::ClassMethods
- Sequel::Plugins::Serialization::InstanceMethods
- Sequel::Plugins::SerializationModificationDetection
- Sequel::Plugins::SerializationModificationDetection::InstanceMethods
- Sequel::Plugins::Sharding
- Sequel::Plugins::Sharding::ClassMethods
- Sequel::Plugins::Sharding::DatasetMethods
- Sequel::Plugins::Sharding::InstanceMethods
- Sequel::Plugins::SingleTableInheritance
- Sequel::Plugins::SingleTableInheritance::ClassMethods
- Sequel::Plugins::SingleTableInheritance::InstanceMethods
- Sequel::Plugins::SkipCreateRefresh
- Sequel::Plugins::SkipCreateRefresh::InstanceMethods
- Sequel::Plugins::StringStripper
- Sequel::Plugins::StringStripper::InstanceMethods
- Sequel::Plugins::Subclasses
- Sequel::Plugins::Subclasses::ClassMethods
- Sequel::Plugins::TacticalEagerLoading
- Sequel::Plugins::TacticalEagerLoading::DatasetMethods
- Sequel::Plugins::TacticalEagerLoading::InstanceMethods
- Sequel::Plugins::Timestamps
- Sequel::Plugins::Timestamps::ClassMethods
- Sequel::Plugins::Timestamps::InstanceMethods
- Sequel::Plugins::Touch
- Sequel::Plugins::Touch::ClassMethods
- Sequel::Plugins::Touch::InstanceMethods
- Sequel::Plugins::Tree
- Sequel::Plugins::Tree::ClassMethods
- Sequel::Plugins::Tree::InstanceMethods
- Sequel::Plugins::Tree::SingleRoot
- Sequel::Plugins::Tree::SingleRoot::ClassMethods
- Sequel::Plugins::Tree::SingleRoot::InstanceMethods
- Sequel::Plugins::Tree::TreeMultipleRootError
- Sequel::Plugins::TypecastOnLoad
- Sequel::Plugins::TypecastOnLoad::ClassMethods
- Sequel::Plugins::TypecastOnLoad::InstanceMethods
- Sequel::Plugins::UpdatePrimaryKey
- Sequel::Plugins::UpdatePrimaryKey::ClassMethods
- Sequel::Plugins::UpdatePrimaryKey::InstanceMethods
- Sequel::Plugins::ValidationClassMethods
- Sequel::Plugins::ValidationClassMethods::ClassMethods
- Sequel::Plugins::ValidationClassMethods::ClassMethods::Generator
- Sequel::Plugins::ValidationClassMethods::InstanceMethods
- Sequel::Plugins::ValidationHelpers
- Sequel::Plugins::ValidationHelpers::InstanceMethods
- Sequel::Plugins::XmlSerializer
- Sequel::Plugins::XmlSerializer::ClassMethods
- Sequel::Plugins::XmlSerializer::DatasetMethods
- Sequel::Plugins::XmlSerializer::InstanceMethods
- Sequel::PoolTimeout
- Sequel::PoolTimeout
- Sequel::Postgres
- Sequel::Postgres::AdapterMethods
- Sequel::Postgres::DatabaseMethods
- Sequel::Postgres::DatasetMethods
- Sequel::Postgres::DatasetMethods::PreparedStatementMethods
- Sequel::PrettyTable
- Sequel::Progress
- Sequel::Progress::DatabaseMethods
- Sequel::Progress::DatasetMethods
- Sequel::Qualifier
- Sequel::Rollback
- Sequel::Rollback
- Sequel::SQL
- Sequel::SQL::AliasMethods
- Sequel::SQL::AliasedExpression
- Sequel::SQL::BitwiseMethods
- Sequel::SQL::Blob
- Sequel::SQL::BooleanConstant
- Sequel::SQL::BooleanExpression
- Sequel::SQL::BooleanMethods
- Sequel::SQL::CaseExpression
- Sequel::SQL::Cast
- Sequel::SQL::CastMethods
- Sequel::SQL::ColumnAll
- Sequel::SQL::ComplexExpression
- Sequel::SQL::ComplexExpressionMethods
- Sequel::SQL::Constant
- Sequel::SQL::Constants
- Sequel::SQL::Expression
- Sequel::SQL::Function
- Sequel::SQL::GenericComplexExpression
- Sequel::SQL::GenericExpression
- Sequel::SQL::Identifier
- Sequel::SQL::IdentifierMethods
- Sequel::SQL::InequalityMethods
- Sequel::SQL::JoinClause
- Sequel::SQL::JoinOnClause
- Sequel::SQL::JoinUsingClause
- Sequel::SQL::NegativeBooleanConstant
- Sequel::SQL::NoBooleanInputMethods
- Sequel::SQL::NumericExpression
- Sequel::SQL::NumericMethods
- Sequel::SQL::OrderMethods
- Sequel::SQL::OrderedExpression
- Sequel::SQL::PlaceholderLiteralString
- Sequel::SQL::QualifiedIdentifier
- Sequel::SQL::QualifyingMethods
- Sequel::SQL::StringConcatenationMethods
- Sequel::SQL::StringExpression
- Sequel::SQL::StringMethods
- Sequel::SQL::Subscript
- Sequel::SQL::SubscriptMethods
- Sequel::SQL::ValueList
- Sequel::SQL::ValueList
- Sequel::SQL::VirtualRow
- Sequel::SQL::Window
- Sequel::SQL::WindowFunction
- Sequel::SQLTime
- Sequel::SQLite
- Sequel::SQLite::DatabaseMethods
- Sequel::SQLite::DatasetMethods
- Sequel::Schema
- Sequel::Schema::AlterTableGenerator
- Sequel::Schema::Generator
- Sequel::ServerBlock
- Sequel::ShardedSingleConnectionPool
- Sequel::ShardedThreadedConnectionPool
- Sequel::SimpleMigration
- Sequel::SingleConnectionPool
- Sequel::Swift
- Sequel::Swift::Database
- Sequel::Swift::Dataset
- Sequel::Swift::MySQL
- Sequel::Swift::MySQL::DatabaseMethods
- Sequel::Swift::MySQL::Dataset
- Sequel::Swift::Postgres
- Sequel::Swift::Postgres::AdapterMethods
- Sequel::Swift::Postgres::DatabaseMethods
- Sequel::Swift::Postgres::Dataset
- Sequel::Swift::SQLite
- Sequel::Swift::SQLite::DatabaseMethods
- Sequel::Swift::SQLite::Dataset
- Sequel::ThreadLocalTimezones
- Sequel::ThreadedConnectionPool
- Sequel::ThreadedServerBlock
- Sequel::TimestampMigrator
- Sequel::Timezones
- Sequel::TinyTDS
- Sequel::TinyTDS::Database
- Sequel::TinyTDS::Dataset
- Sequel::TinyTDS::Dataset::ArgumentMapper
- Sequel::TinyTDS::Dataset::PreparedStatementMethods
- Sequel::ToDot
- Sequel::UnbindDuplicate
- Sequel::Unbinder
- Sequel::UndefinedAssociation
- Sequel::UnthreadedServerBlock
- Sequel::ValidationFailed
- Dataset
- Dataset::ArgumentMapper
- Dataset::BindArgumentMethods
- Dataset::PreparedStatementMethods
- String
- String::Inflections
- Array
- FalseClass
- Hash
- NilClass
- Numeric
- Object
- PGconn
- PGresult
- Proc
- Symbol
- TrueClass

No matching classes.

# Sequel::Postgres::DatasetMethods

Instance methods for datasets that connect to a PostgreSQL database.

### Constants

ACCESS_SHARE
ACCESS_EXCLUSIVE
BOOL_FALSE
BOOL_TRUE
COMMA_SEPARATOR
DELETE_CLAUSE_METHODS
DELETE_CLAUSE_METHODS_91
EXCLUSIVE
EXPLAIN
EXPLAIN_ANALYZE
FOR_SHARE
INSERT_CLAUSE_METHODS
INSERT_CLAUSE_METHODS_82
INSERT_CLAUSE_METHODS_91
LOCK
NULL
PG_TIMESTAMP_FORMAT
QUERY_PLAN
ROW_EXCLUSIVE
ROW_SHARE
SELECT_CLAUSE_METHODS
SELECT_CLAUSE_METHODS_84
SHARE
SHARE_ROW_EXCLUSIVE
SHARE_UPDATE_EXCLUSIVE
SQL_WITH_RECURSIVE
UPDATE_CLAUSE_METHODS
UPDATE_CLAUSE_METHODS_91
SPACE
FROM
APOS
APOS_RE
DOUBLE_APOS
PAREN_OPEN
PAREN_CLOSE
COMMA
AS
XOR_OP
CRLF
BLOB_RE
WINDOW
EMPTY_STRING

### Public Class Methods

extended(obj) click to toggle source

Add the disable_insert_returning! mutation method

         # File lib/sequel/adapters/shared/postgres.rb, line 737
    737:       def self.extended(obj)
    738:         obj.def_mutation_method(:disable_insert_returning)
    739:       end

included(mod) click to toggle source

Add the disable_insert_returning! mutation method

         # File lib/sequel/adapters/shared/postgres.rb, line 742
    742:       def self.included(mod)
    743:         mod.def_mutation_method(:disable_insert_returning)
    744:       end

### Public Instance Methods

analyze() click to toggle source

Return the results of an ANALYZE query as a string

         # File lib/sequel/adapters/shared/postgres.rb, line 747
    747:       def analyze
    748:         explain(:analyze=>true)
    749:       end

complex_expression_sql_append(sql, op, args) click to toggle source

Handle converting the ruby xor operator (^) into the PostgreSQL xor operator (#).

         # File lib/sequel/adapters/shared/postgres.rb, line 753
    753:       def complex_expression_sql_append(sql, op, args)
    754:         case op
    755:         when :^
    756:           j = XOR_OP
    757:           c = false
    758:           args.each do |a|
    759:             sql << j if c
    760:             literal_append(sql, a)
    761:             c ||= true
    762:           end
    763:         else
    764:           super
    765:         end
    766:       end

disable_insert_returning() click to toggle source

Disable the use of INSERT RETURNING, even if the server supports it

         # File lib/sequel/adapters/shared/postgres.rb, line 769
    769:       def disable_insert_returning
    770:         clone(:disable_insert_returning=>true)
    771:       end

explain(opts={}) click to toggle source

Return the results of an EXPLAIN query as a string

         # File lib/sequel/adapters/shared/postgres.rb, line 774
    774:       def explain(opts={})
    775:         with_sql((opts[:analyze] ? EXPLAIN_ANALYZE : EXPLAIN) + select_sql).map(QUERY_PLAN).join(CRLF)
    776:       end

for_share() click to toggle source

Return a cloned dataset which will use FOR SHARE to lock returned rows.

         # File lib/sequel/adapters/shared/postgres.rb, line 779
    779:       def for_share
    780:         lock_style(:share)
    781:       end

full_text_search(cols, terms, opts = {}) click to toggle source

PostgreSQL specific full text search syntax, using tsearch2 (included in 8.3 by default, and available for earlier versions as an add-on).

         # File lib/sequel/adapters/shared/postgres.rb, line 785
    785:       def full_text_search(cols, terms, opts = {})
    786:         lang = opts[:language] || 'simple'
    787:         terms = terms.join(' | ') if terms.is_a?(Array)
    788:         filter("to_tsvector(?, ?) @@ to_tsquery(?, ?)", lang, full_text_string_join(cols), lang, terms)
    789:       end

insert(*values, &block) click to toggle source

Insert given values into the database.

         # File lib/sequel/adapters/shared/postgres.rb, line 792
    792:       def insert(*values, &block)
    793:         if @opts[:returning]
    794:           super
    795:         elsif !@opts[:sql] && supports_insert_select?
    796:           returning(insert_pk).insert(*values){|r| return r.values.first}
    797:         elsif (f = opts[:from]) && !f.empty?
    798:           v = if values.size == 1
    799:             values.first
    800:           elsif values.size == 2 && values.all?{|v0| v0.is_a?(Array)}
    801:             Hash[*values.first.zip(values.last).flatten]
    802:           else
    803:             values
    804:           end
    805:           execute_insert(insert_sql(*values), :table=>f.first, :values=>v)
    806:         else
    807:           super
    808:         end
    809:       end

insert_select(*values) click to toggle source

Insert a record returning the record inserted

         # File lib/sequel/adapters/shared/postgres.rb, line 812
    812:       def insert_select(*values)
    813:         return unless supports_insert_select?
    814:         returning.insert(*values){|r| return r}
    815:       end

lock(mode, opts={}) click to toggle source

Locks all tables in the dataset’s FROM clause (but not in JOINs) with the specified mode (e.g. ‘EXCLUSIVE’). If a block is given, starts a new transaction, locks the table, and yields. If a block is not given just locks the tables. Note that PostgreSQL will probably raise an error if you lock the table outside of an existing transaction. Returns nil.

         # File lib/sequel/adapters/shared/postgres.rb, line 822
    822:       def lock(mode, opts={})
    823:         if block_given? # perform locking inside a transaction and yield to block
    824:           @db.transaction(opts){lock(mode, opts); yield}
    825:         else
    826:           @db.execute(LOCK % [source_list(@opts[:from]), mode], opts) # lock without a transaction
    827:         end
    828:         nil
    829:       end

multi_insert_sql(columns, values) click to toggle source

For PostgreSQL version > 8.2, allow inserting multiple rows at once.

         # File lib/sequel/adapters/shared/postgres.rb, line 832
    832:       def multi_insert_sql(columns, values)
    833:         return super if server_version < 80200
    834:
    835:         # postgresql 8.2 introduces support for multi-row insert
    836:         sql = LiteralString.new('VALUES ')
    837:         expression_list_append(sql, values.map{|r| Array(r)})
    838:         [insert_sql(columns, sql)]
    839:       end

supports_cte_in_subqueries?() click to toggle source

PostgreSQL supports using the WITH clause in subqueries if it supports using WITH at all (i.e. on PostgreSQL 8.4+).

         # File lib/sequel/adapters/shared/postgres.rb, line 843
    843:       def supports_cte_in_subqueries?
    844:         supports_cte?
    845:       end

supports_distinct_on?() click to toggle source

DISTINCT ON is a PostgreSQL extension

         # File lib/sequel/adapters/shared/postgres.rb, line 848
    848:       def supports_distinct_on?
    849:         true
    850:       end

supports_modifying_joins?() click to toggle source

PostgreSQL supports modifying joined datasets

         # File lib/sequel/adapters/shared/postgres.rb, line 853
    853:       def supports_modifying_joins?
    854:         true
    855:       end

supports_returning?(type) click to toggle source

         # File lib/sequel/adapters/shared/postgres.rb, line 857
    857:       def supports_returning?(type)
    858:         if type == :insert
    859:           server_version >= 80200 && !opts[:disable_insert_returning]
    860:         else
    861:           server_version >= 80200
    862:         end
    863:       end

supports_timestamp_timezones?() click to toggle source

PostgreSQL supports timezones in literal timestamps

         # File lib/sequel/adapters/shared/postgres.rb, line 866
    866:       def supports_timestamp_timezones?
    867:         true
    868:       end

supports_window_functions?() click to toggle source

PostgreSQL 8.4+ supports window functions

         # File lib/sequel/adapters/shared/postgres.rb, line 871
    871:       def supports_window_functions?
    872:         server_version >= 80400
    873:       end

window(name, opts) click to toggle source

Return a clone of the dataset with an addition named window that can be referenced in window functions.

         # File lib/sequel/adapters/shared/postgres.rb, line 876
    876:       def window(name, opts)
    877:         clone(:window=>(@opts[:window]||[]) + [[name, SQL::Window.new(opts)]])
    878:       end

### Protected Instance Methods

_import(columns, values, opts={}) click to toggle source

If returned primary keys are requested, use RETURNING unless already set on the dataset. If RETURNING is already set, use existing returning values. If RETURNING is only set to return a single columns, return an array of just that column. Otherwise, return an array of hashes.

         # File lib/sequel/adapters/shared/postgres.rb, line 886
    886:       def _import(columns, values, opts={})
    887:         if server_version >= 80200
    888:           if opts[:return] == :primary_key && !@opts[:returning]
    889:             returning(insert_pk)._import(columns, values, opts)
    890:           elsif @opts[:returning]
    891:             statements = multi_insert_sql(columns, values)
    892:             @db.transaction(opts.merge(:server=>@opts[:server])) do
    893:               statements.map{|st| returning_fetch_rows(st)}
    894:             end.first.map{|v| v.length == 1 ? v.values.first : v}
    895:           else
    896:             super
    897:           end
    898:         else
    899:           super
    900:         end
    901:       end

### Private Instance Methods

compound_dataset_sql_append(sql, ds) click to toggle source

PostgreSQL requires parentheses around compound datasets if they use CTEs, and using them in other places doesn’t hurt.

         # File lib/sequel/adapters/shared/postgres.rb, line 990
    990:       def compound_dataset_sql_append(sql, ds)
    991:         sql << PAREN_OPEN
    992:         super
    993:         sql << PAREN_CLOSE
    994:       end

delete_clause_methods() click to toggle source

PostgreSQL allows deleting from joined datasets

         # File lib/sequel/adapters/shared/postgres.rb, line 906
    906:       def delete_clause_methods
    907:         server_version >= 90100 ? DELETE_CLAUSE_METHODS_91 : DELETE_CLAUSE_METHODS
    908:       end

delete_from_sql(sql) click to toggle source

Only include the primary table in the main delete clause

         # File lib/sequel/adapters/shared/postgres.rb, line 911
    911:       def delete_from_sql(sql)
    912:         sql << FROM
    913:         source_list_append(sql, @opts[:from][0..0])
    914:       end

delete_using_sql(sql) click to toggle source

Use USING to specify additional tables in a delete query

         # File lib/sequel/adapters/shared/postgres.rb, line 917
    917:       def delete_using_sql(sql)
    918:         join_from_sql(:USING, sql)
    919:       end

full_text_string_join(cols) click to toggle source

Concatenate the expressions with a space in between

          # File lib/sequel/adapters/shared/postgres.rb, line 1029
    1029:       def full_text_string_join(cols)
    1030:         cols = Array(cols).map{|x| SQL::Function.new(:COALESCE, x, EMPTY_STRING)}
    1031:         cols = cols.zip([SPACE] * cols.length).flatten
    1032:         cols.pop
    1033:         SQL::StringExpression.new(:'||', *cols)
    1034:       end

insert_clause_methods() click to toggle source

PostgreSQL allows a RETURNING clause.

         # File lib/sequel/adapters/shared/postgres.rb, line 922
    922:       def insert_clause_methods
    923:         if server_version >= 90100
    924:           INSERT_CLAUSE_METHODS_91
    925:         elsif server_version >= 80200
    926:           INSERT_CLAUSE_METHODS_82
    927:         else
    928:           INSERT_CLAUSE_METHODS
    929:         end
    930:       end

insert_pk() click to toggle source

Return the primary key to use for RETURNING in an INSERT statement

         # File lib/sequel/adapters/shared/postgres.rb, line 933
    933:       def insert_pk
    934:         pk = db.primary_key(opts[:from].first) if opts[:from] && !opts[:from].empty?
    935:         pk ? Sequel::SQL::Identifier.new(pk) : NULL
    936:       end

join_from_sql(type, sql) click to toggle source

For multiple table support, PostgreSQL requires at least two from tables, with joins allowed.

         # File lib/sequel/adapters/shared/postgres.rb, line 940
    940:       def join_from_sql(type, sql)
    941:         if(from = @opts[:from][1..1]).empty?
    942:           raise(Error, 'Need multiple FROM tables if updating/deleting a dataset with JOINs') if @opts[:join]
    943:         else
    944:           sql << SPACE << type.to_s << SPACE
    945:           source_list_append(sql, from)
    946:           select_join_sql(sql)
    947:         end
    948:       end

literal_blob_append(sql, v) click to toggle source

Use a generic blob quoting method, hopefully overridden in one of the subadapter methods

         # File lib/sequel/adapters/shared/postgres.rb, line 951
    951:       def literal_blob_append(sql, v)
    952:         sql << APOS << v.gsub(BLOB_RE){|b| "\\#{("%o" % b[0..1].unpack("C")[0]).rjust(3, '0')}"} << APOS
    953:       end

literal_false() click to toggle source

PostgreSQL uses FALSE for false values

         # File lib/sequel/adapters/shared/postgres.rb, line 956
    956:       def literal_false
    957:         BOOL_FALSE
    958:       end

literal_float(value) click to toggle source

PostgreSQL quotes NaN and Infinity.

         # File lib/sequel/adapters/shared/postgres.rb, line 961
    961:       def literal_float(value)
    962:         if value.finite?
    963:           super
    964:         elsif value.nan?
    965:           "'NaN'"
    966:         elsif value.infinite? == 1
    967:           "'Infinity'"
    968:         else
    969:           "'-Infinity'"
    970:         end
    971:       end

literal_string_append(sql, v) click to toggle source

Assume that SQL standard quoting is on, per Sequel’s defaults

         # File lib/sequel/adapters/shared/postgres.rb, line 974
    974:       def literal_string_append(sql, v)
    975:         sql << APOS << v.gsub(APOS_RE, DOUBLE_APOS) << APOS
    976:       end

literal_true() click to toggle source

PostgreSQL uses FALSE for false values

         # File lib/sequel/adapters/shared/postgres.rb, line 979
    979:       def literal_true
    980:         BOOL_TRUE
    981:       end

select_clause_methods() click to toggle source

The order of clauses in the SELECT SQL statement

         # File lib/sequel/adapters/shared/postgres.rb, line 984
    984:       def select_clause_methods
    985:         server_version >= 80400 ? SELECT_CLAUSE_METHODS_84 : SELECT_CLAUSE_METHODS
    986:       end

select_lock_sql(sql) click to toggle source

Support FOR SHARE locking when using the :share lock style.

         # File lib/sequel/adapters/shared/postgres.rb, line 997
    997:       def select_lock_sql(sql)
    998:         @opts[:lock] == :share ? (sql << FOR_SHARE) : super
    999:       end

select_window_sql(sql) click to toggle source

SQL fragment for named window specifications

          # File lib/sequel/adapters/shared/postgres.rb, line 1002
    1002:       def select_window_sql(sql)
    1003:         if ws = @opts[:window]
    1004:           sql << WINDOW
    1005:           c = false
    1006:           co = COMMA
    1007:           as = AS
    1008:           ws.map do |name, window|
    1009:             sql << co if c
    1010:             literal_append(sql, name)
    1011:             sql << as
    1012:             literal_append(sql, window)
    1013:             c ||= true
    1014:           end
    1015:         end
    1016:       end

select_with_sql_base() click to toggle source

Use WITH RECURSIVE instead of WITH if any of the CTEs is recursive

          # File lib/sequel/adapters/shared/postgres.rb, line 1019
    1019:       def select_with_sql_base
    1020:         opts[:with].any?{|w| w[:recursive]} ? SQL_WITH_RECURSIVE : super
    1021:       end

server_version() click to toggle source

The version of the database server

          # File lib/sequel/adapters/shared/postgres.rb, line 1024
    1024:       def server_version
    1025:         db.server_version(@opts[:server])
    1026:       end

update_clause_methods() click to toggle source

PostgreSQL splits the main table from the joined tables

          # File lib/sequel/adapters/shared/postgres.rb, line 1037
    1037:       def update_clause_methods
    1038:         server_version >= 90100 ? UPDATE_CLAUSE_METHODS_91 : UPDATE_CLAUSE_METHODS
    1039:       end

update_from_sql(sql) click to toggle source

Use FROM to specify additional tables in an update query

          # File lib/sequel/adapters/shared/postgres.rb, line 1042
    1042:       def update_from_sql(sql)
    1043:         join_from_sql(:FROM, sql)
    1044:       end

update_table_sql(sql) click to toggle source

Only include the primary table in the main update clause

          # File lib/sequel/adapters/shared/postgres.rb, line 1047
    1047:       def update_table_sql(sql)
    1048:         sql << SPACE
    1049:         source_list_append(sql, @opts[:from][0..0])
    1050:       end

Disabled; run with --debug to generate this.

[Validate]

Generated with the Darkfish Rdoc Generator 1.1.6.