Module: Sequel::Postgres::DatasetMethods

### Home Classes Methods

### In Files

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

### Namespace

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

### Methods

- #_import
- #analyze
- #complex_expression_sql_append
- #disable_insert_returning
- #explain
- #for_share
- #full_text_search
- #insert
- #insert_conflict
- #insert_ignore
- #insert_select
- #insert_select_sql
- #lock
- #supports_cte?
- #supports_cte_in_subqueries?
- #supports_distinct_on?
- #supports_group_cube?
- #supports_group_rollup?
- #supports_grouping_sets?
- #supports_insert_conflict?
- #supports_insert_select?
- #supports_lateral_subqueries?
- #supports_modifying_joins?
- #supports_regexp?
- #supports_returning?
- #supports_timestamp_timezones?
- #supports_window_functions?
- #truncate
- #window

### Files

- CHANGELOG
- MIT-LICENSE
- README.rdoc
- active_record.rdoc
- advanced_associations.rdoc
- association_basics.rdoc
- bin_sequel.rdoc
- cheat_sheet.rdoc
- code_order.rdoc
- core_extensions.rdoc
- dataset_basics.rdoc
- dataset_filtering.rdoc
- extensions.rdoc
- mass_assignment.rdoc
- migration.rdoc
- model_hooks.rdoc
- model_plugins.rdoc
- mssql_stored_procedures.rdoc
- object_model.rdoc
- opening_databases.rdoc
- postgresql.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.34.0.txt
- 3.35.0.txt
- 3.36.0.txt
- 3.37.0.txt
- 3.38.0.txt
- 3.39.0.txt
- 3.4.0.txt
- 3.40.0.txt
- 3.41.0.txt
- 3.42.0.txt
- 3.43.0.txt
- 3.44.0.txt
- 3.45.0.txt
- 3.46.0.txt
- 3.47.0.txt
- 3.48.0.txt
- 3.5.0.txt
- 3.6.0.txt
- 3.7.0.txt
- 3.8.0.txt
- 3.9.0.txt
- 4.0.0.txt
- 4.1.0.txt
- 4.10.0.txt
- 4.11.0.txt
- 4.12.0.txt
- 4.13.0.txt
- 4.14.0.txt
- 4.15.0.txt
- 4.16.0.txt
- 4.17.0.txt
- 4.18.0.txt
- 4.19.0.txt
- 4.2.0.txt
- 4.20.0.txt
- 4.21.0.txt
- 4.22.0.txt
- 4.23.0.txt
- 4.24.0.txt
- 4.25.0.txt
- 4.26.0.txt
- 4.3.0.txt
- 4.4.0.txt
- 4.5.0.txt
- 4.6.0.txt
- 4.7.0.txt
- 4.8.0.txt
- 4.9.0.txt
- schema_modification.rdoc
- security.rdoc
- sharding.rdoc
- sql.rdoc
- testing.rdoc
- thread_safety.rdoc
- transactions.rdoc
- validations.rdoc
- virtual_rows.rdoc

### Class/Module Index

Quicksearch

- Sequel
- Sequel::ADO
- Sequel::ADO::Access
- Sequel::ADO::Access::AdoSchema
- Sequel::ADO::Access::AdoSchema::Column
- Sequel::ADO::Access::DatabaseMethods
- Sequel::ADO::Access::Dataset
- 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::Amalgalite
- Sequel::Amalgalite::Database
- Sequel::Amalgalite::Dataset
- Sequel::Amalgalite::SequelTypeMap
- Sequel::ArbitraryServers
- Sequel::BasicObject
- Sequel::BeforeHookFailed
- Sequel::ColumnsIntrospection
- Sequel::ConnectionPool
- Sequel::ConnectionPool::ClassMethods
- Sequel::ConnectionValidator
- Sequel::ConnectionValidator::Retry
- Sequel::ConstraintValidations
- Sequel::ConstraintValidations::AlterTableGeneratorMethods
- Sequel::ConstraintValidations::CreateTableGeneratorMethods
- Sequel::ConstraintValidations::Generator
- Sequel::CoreRefinements
- Sequel::Cubrid
- Sequel::Cubrid::Database
- Sequel::Cubrid::DatabaseMethods
- Sequel::Cubrid::Dataset
- Sequel::Cubrid::DatasetMethods
- Sequel::CurrentDateTimeTimestamp
- Sequel::CurrentDateTimeTimestamp::DatasetMethods
- Sequel::CurrentDateTimeTimestamp::DateTime
- Sequel::CurrentDateTimeTimestamp::Time
- Sequel::DB2
- Sequel::DB2::DatabaseMethods
- Sequel::DB2::DatasetMethods
- 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::DatabaseMethods
- Sequel::DataObjects::SQLite
- Sequel::DataObjects::SQLite::DatabaseMethods
- Sequel::Database
- Sequel::Database::DatasetClass
- Sequel::Database::FromBlock
- Sequel::Database::ResetIdentifierMangling
- Sequel::Database::SplitAlterTable
- Sequel::DatabaseError
- Sequel::DatabaseQuery
- Sequel::Dataset
- Sequel::Dataset::ArgumentMapper
- Sequel::Dataset::DatasetSourceAlias
- Sequel::Dataset::NullDataset
- Sequel::Dataset::Nullifiable
- Sequel::Dataset::Pagination
- Sequel::Dataset::PlaceholderLiteralizer
- Sequel::Dataset::PlaceholderLiteralizer::Argument
- Sequel::Dataset::PlaceholderLiteralizer::Recorder
- Sequel::Dataset::PreparedStatementMethods
- Sequel::Dataset::Query
- Sequel::Dataset::Replace
- Sequel::Dataset::RoundTimestamps
- Sequel::Dataset::SplitArrayNil
- Sequel::Dataset::StoredProcedureMethods
- Sequel::Dataset::StoredProcedures
- Sequel::Dataset::UnnumberedArgumentMapper
- Sequel::DatasetPagination
- Sequel::DatasetPrinter
- Sequel::DatasetQuery
- Sequel::Deprecation
- Sequel::EmptyArrayConsiderNulls
- Sequel::EmulateOffsetWithReverseAndCount
- Sequel::EmulateOffsetWithRowNumber
- Sequel::Error
- Sequel::ErrorSQL
- Sequel::EvalInspect
- Sequel::FilterHaving
- Sequel::Firebird
- Sequel::Firebird::DatabaseMethods
- Sequel::Firebird::DatasetMethods
- Sequel::GraphEach
- Sequel::HashAliases
- Sequel::HookFailed
- Sequel::IBMDB
- Sequel::IBMDB::Connection
- Sequel::IBMDB::Connection::Error
- Sequel::IBMDB::Database
- Sequel::IBMDB::Dataset
- Sequel::IBMDB::Dataset::CallableStatementMethods
- Sequel::IBMDB::Statement
- Sequel::Inflections
- Sequel::Informix
- Sequel::Informix::DatabaseMethods
- Sequel::Informix::DatasetMethods
- Sequel::IntegerMigrator
- Sequel::JDBC
- Sequel::JDBC::AS400
- Sequel::JDBC::AS400::DatabaseMethods
- Sequel::JDBC::AS400::Dataset
- Sequel::JDBC::Cubrid
- Sequel::JDBC::Cubrid::DatabaseMethods
- Sequel::JDBC::DB2
- Sequel::JDBC::DB2::DatabaseMethods
- Sequel::JDBC::DB2::Dataset
- Sequel::JDBC::Database
- Sequel::JDBC::Dataset
- Sequel::JDBC::Derby
- Sequel::JDBC::Derby::DatabaseMethods
- Sequel::JDBC::Derby::Dataset
- Sequel::JDBC::Firebird
- Sequel::JDBC::Firebird::DatabaseMethods
- 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::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::Oracle
- Sequel::JDBC::Oracle::DatabaseMethods
- Sequel::JDBC::Oracle::Dataset
- Sequel::JDBC::Postgres
- Sequel::JDBC::Postgres::DatabaseMethods
- Sequel::JDBC::Postgres::Dataset
- Sequel::JDBC::Progress
- Sequel::JDBC::Progress::DatabaseMethods
- Sequel::JDBC::SQLServer
- Sequel::JDBC::SQLServer::DatabaseMethods
- Sequel::JDBC::SQLServer::DatabaseMethods::MetadataDatasetMethods
- Sequel::JDBC::SQLite
- Sequel::JDBC::SQLite::DatabaseMethods
- Sequel::JDBC::SqlAnywhere
- Sequel::JDBC::SqlAnywhere::DatabaseMethods
- Sequel::JDBC::SqlAnywhere::Dataset
- Sequel::JDBC::Transactions
- Sequel::JDBC::TypeConvertor
- Sequel::LiteralString
- Sequel::LooserTypecasting
- Sequel::MSSQL
- Sequel::MSSQL::DatabaseMethods
- Sequel::MSSQL::DatasetMethods
- Sequel::MSSQL::EmulateLateralWithApply
- Sequel::Metaprogramming
- Sequel::Migration
- Sequel::MigrationAlterTableReverser
- Sequel::MigrationDSL
- Sequel::MigrationReverser
- Sequel::Migrator
- Sequel::Migrator::Error
- Sequel::Migrator::NotCurrentError
- 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::OneThroughOneAssociationReflection
- Sequel::Model::Associations::OneToManyAssociationReflection
- Sequel::Model::Associations::OneToOneAssociationReflection
- Sequel::Model::Associations::SingularAssociationReflection
- Sequel::Model::ClassMethods
- Sequel::Model::DatasetMethods
- Sequel::Model::DatasetModule
- Sequel::Model::Errors
- Sequel::Model::InstanceMethods
- Sequel::MySQL
- Sequel::MySQL::Database
- Sequel::MySQL::DatabaseMethods
- Sequel::MySQL::Dataset
- Sequel::MySQL::DatasetMethods
- Sequel::MySQL::PreparedStatements
- Sequel::MySQL::PreparedStatements::DatabaseMethods
- Sequel::MySQL::PreparedStatements::DatasetMethods
- Sequel::MySQL::PreparedStatements::DatasetMethods::CallableStatementMethods
- Sequel::Mysql2
- Sequel::Mysql2::Database
- Sequel::Mysql2::Dataset
- Sequel::NamedTimezones
- Sequel::NamedTimezones::DatabaseMethods
- Sequel::NoMatchingRow
- Sequel::ODBC
- Sequel::ODBC::Database
- Sequel::ODBC::Dataset
- Sequel::ODBC::MSSQL
- Sequel::ODBC::MSSQL::DatabaseMethods
- Sequel::ODBC::MSSQL::Dataset
- Sequel::Oracle
- Sequel::Oracle::Database
- Sequel::Oracle::DatabaseMethods
- Sequel::Oracle::Dataset
- Sequel::Oracle::Dataset::ArgumentMapper
- Sequel::Oracle::DatasetMethods
- Sequel::Plugins
- Sequel::Plugins::AccessedColumns
- Sequel::Plugins::AccessedColumns::InstanceMethods
- Sequel::Plugins::ActiveModel
- Sequel::Plugins::ActiveModel::ClassMethods
- Sequel::Plugins::ActiveModel::Errors
- Sequel::Plugins::ActiveModel::InstanceMethods
- Sequel::Plugins::AfterInitialize
- Sequel::Plugins::AfterInitialize::ClassMethods
- Sequel::Plugins::AfterInitialize::InstanceMethods
- Sequel::Plugins::AssociationAutoreloading
- 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::AutoValidations
- Sequel::Plugins::AutoValidations::ClassMethods
- Sequel::Plugins::AutoValidations::InstanceMethods
- Sequel::Plugins::BlacklistSecurity
- Sequel::Plugins::BlacklistSecurity::ClassMethods
- Sequel::Plugins::BlacklistSecurity::InstanceMethods
- Sequel::Plugins::BlacklistSecurity::InstanceMethods::ExceptionList
- 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::ColumnConflicts
- Sequel::Plugins::ColumnConflicts::ClassMethods
- Sequel::Plugins::ColumnConflicts::InstanceMethods
- Sequel::Plugins::ColumnSelect
- Sequel::Plugins::ColumnSelect::ClassMethods
- Sequel::Plugins::Composition
- Sequel::Plugins::Composition::ClassMethods
- Sequel::Plugins::Composition::InstanceMethods
- Sequel::Plugins::ConstraintValidations
- Sequel::Plugins::ConstraintValidations::ClassMethods
- Sequel::Plugins::ConstraintValidations::DatabaseMethods
- Sequel::Plugins::ConstraintValidations::InstanceMethods
- Sequel::Plugins::CsvSerializer
- Sequel::Plugins::CsvSerializer::ClassMethods
- Sequel::Plugins::CsvSerializer::DatasetMethods
- Sequel::Plugins::CsvSerializer::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::DelayAddAssociation
- Sequel::Plugins::DelayAddAssociation::InstanceMethods
- Sequel::Plugins::Dirty
- Sequel::Plugins::Dirty::InstanceMethods
- Sequel::Plugins::EagerEach
- Sequel::Plugins::EagerEach::DatasetMethods
- Sequel::Plugins::ErrorSplitter
- Sequel::Plugins::ErrorSplitter::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::InputTransformer
- Sequel::Plugins::InputTransformer::ClassMethods
- Sequel::Plugins::InputTransformer::InstanceMethods
- Sequel::Plugins::InsertReturningSelect
- Sequel::Plugins::InsertReturningSelect::ClassMethods
- Sequel::Plugins::InsertReturningSelect::InstanceMethods
- Sequel::Plugins::InstanceFilters
- Sequel::Plugins::InstanceFilters::InstanceMethods
- Sequel::Plugins::InstanceHooks
- Sequel::Plugins::InstanceHooks::InstanceMethods
- Sequel::Plugins::InvertedSubsets
- Sequel::Plugins::InvertedSubsets::ClassMethods
- 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::ManyThroughMany::OneThroughManyAssociationReflection
- Sequel::Plugins::ManyToOnePkLookup
- Sequel::Plugins::ModificationDetection
- Sequel::Plugins::ModificationDetection::ClassMethods
- Sequel::Plugins::ModificationDetection::InstanceMethods
- Sequel::Plugins::MssqlOptimisticLocking
- Sequel::Plugins::MssqlOptimisticLocking::ClassMethods
- Sequel::Plugins::MssqlOptimisticLocking::InstanceMethods
- Sequel::Plugins::NestedAttributes
- Sequel::Plugins::NestedAttributes::ClassMethods
- Sequel::Plugins::NestedAttributes::InstanceMethods
- Sequel::Plugins::OptimisticLocking
- Sequel::Plugins::OptimisticLocking::ClassMethods
- Sequel::Plugins::OptimisticLocking::InstanceMethods
- Sequel::Plugins::PgArrayAssociations
- Sequel::Plugins::PgArrayAssociations::ClassMethods
- Sequel::Plugins::PgArrayAssociations::DatasetMethods
- Sequel::Plugins::PgArrayAssociations::ManyToPgArrayAssociationReflection
- Sequel::Plugins::PgArrayAssociations::PgArrayToManyAssociationReflection
- Sequel::Plugins::PgRow
- Sequel::Plugins::PgRow::ClassMethods
- Sequel::Plugins::PgRow::DatabaseMethods
- Sequel::Plugins::PgRow::InstanceMethods
- Sequel::Plugins::PgTypecastOnLoad
- Sequel::Plugins::PgTypecastOnLoad::ClassMethods
- Sequel::Plugins::PgTypecastOnLoad::InstanceMethods
- Sequel::Plugins::PreparedStatements
- Sequel::Plugins::PreparedStatements::ClassMethods
- Sequel::Plugins::PreparedStatements::InstanceMethods
- Sequel::Plugins::PreparedStatementsAssociations
- 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::Scissors
- Sequel::Plugins::Scissors::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::SingularTableNames
- Sequel::Plugins::SingularTableNames::ClassMethods
- Sequel::Plugins::SkipCreateRefresh
- Sequel::Plugins::SkipCreateRefresh::InstanceMethods
- Sequel::Plugins::SplitValues
- Sequel::Plugins::SplitValues::ClassMethods
- Sequel::Plugins::SplitValues::InstanceMethods
- Sequel::Plugins::StaticCache
- Sequel::Plugins::StaticCache::ClassMethods
- Sequel::Plugins::StaticCache::InstanceMethods
- Sequel::Plugins::StringStripper
- Sequel::Plugins::StringStripper::ClassMethods
- Sequel::Plugins::Subclasses
- Sequel::Plugins::Subclasses::ClassMethods
- Sequel::Plugins::TableSelect
- Sequel::Plugins::TableSelect::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::UnlimitedUpdate
- Sequel::Plugins::UnlimitedUpdate::InstanceMethods
- Sequel::Plugins::UpdateOrCreate
- Sequel::Plugins::UpdateOrCreate::ClassMethods
- Sequel::Plugins::UpdatePrimaryKey
- Sequel::Plugins::UpdatePrimaryKey::InstanceMethods
- Sequel::Plugins::UpdateRefresh
- Sequel::Plugins::UpdateRefresh::ClassMethods
- Sequel::Plugins::UpdateRefresh::InstanceMethods
- Sequel::Plugins::ValidateAssociated
- Sequel::Plugins::ValidateAssociated::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::Postgres
- Sequel::Postgres::Adapter
- Sequel::Postgres::AlterTableGenerator
- Sequel::Postgres::ArrayOp
- Sequel::Postgres::ArrayOpMethods
- Sequel::Postgres::CreateTableGenerator
- Sequel::Postgres::Database
- Sequel::Postgres::DatabaseMethods
- Sequel::Postgres::Dataset
- Sequel::Postgres::Dataset::ArgumentMapper
- Sequel::Postgres::DatasetMethods
- Sequel::Postgres::DatasetMethods::PreparedStatementMethods
- Sequel::Postgres::EnumDatabaseMethods
- Sequel::Postgres::ExclusionConstraintViolation
- Sequel::Postgres::HStore
- Sequel::Postgres::HStore::DatabaseMethods
- Sequel::Postgres::HStore::Parser
- Sequel::Postgres::HStoreOp
- Sequel::Postgres::HStoreOpMethods
- Sequel::Postgres::InetDatabaseMethods
- Sequel::Postgres::InetDatasetMethods
- Sequel::Postgres::InetOp
- Sequel::Postgres::InetOpMethods
- Sequel::Postgres::IntervalDatabaseMethods
- Sequel::Postgres::IntervalDatabaseMethods::Parser
- Sequel::Postgres::IntervalDatasetMethods
- Sequel::Postgres::JSONArray
- Sequel::Postgres::JSONArrayBase
- Sequel::Postgres::JSONBArray
- Sequel::Postgres::JSONBHash
- Sequel::Postgres::JSONBOp
- Sequel::Postgres::JSONBaseOp
- Sequel::Postgres::JSONDatabaseMethods
- Sequel::Postgres::JSONHash
- Sequel::Postgres::JSONHashBase
- Sequel::Postgres::JSONOp
- Sequel::Postgres::JSONOpMethods
- Sequel::Postgres::LooseCount
- Sequel::Postgres::PGArray
- Sequel::Postgres::PGArray::Creator
- Sequel::Postgres::PGArray::DatabaseMethods
- Sequel::Postgres::PGArray::JSONCreator
- Sequel::Postgres::PGArray::Parser
- Sequel::Postgres::PGRange
- Sequel::Postgres::PGRange::DatabaseMethods
- Sequel::Postgres::PGRange::DatasetMethods
- Sequel::Postgres::PGRange::Parser
- Sequel::Postgres::PGRow
- Sequel::Postgres::PGRow::ArrayRow
- Sequel::Postgres::PGRow::DatabaseMethods
- Sequel::Postgres::PGRow::HashRow
- Sequel::Postgres::PGRow::Parser
- Sequel::Postgres::PGRow::Splitter
- Sequel::Postgres::PGRowOp
- Sequel::Postgres::PGRowOp::ExpressionMethods
- Sequel::Postgres::RangeOp
- Sequel::Postgres::RangeOpMethods
- Sequel::Postgres::StaticCacheUpdater
- Sequel::PrettyTable
- Sequel::Progress
- Sequel::Progress::DatabaseMethods
- Sequel::Progress::DatasetMethods
- Sequel::Qualifier
- Sequel::QueryLiterals
- 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::Builders
- 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::DateAdd
- Sequel::SQL::DateAdd::DatasetMethods
- Sequel::SQL::DelayedEvaluation
- Sequel::SQL::Expression
- Sequel::SQL::Function
- Sequel::SQL::GenericExpression
- Sequel::SQL::Identifier
- Sequel::SQL::InequalityMethods
- Sequel::SQL::JoinClause
- Sequel::SQL::JoinOnClause
- Sequel::SQL::JoinUsingClause
- Sequel::SQL::NegativeBooleanConstant
- Sequel::SQL::NumericExpression
- Sequel::SQL::NumericMethods
- Sequel::SQL::OperatorBuilders
- Sequel::SQL::OrderMethods
- Sequel::SQL::OrderedExpression
- Sequel::SQL::PatternMatchMethods
- 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::VirtualRow
- Sequel::SQL::Window
- Sequel::SQL::Wrapper
- Sequel::SQLTime
- Sequel::SQLite
- Sequel::SQLite::Database
- Sequel::SQLite::DatabaseMethods
- Sequel::SQLite::Dataset
- Sequel::SQLite::Dataset::ArgumentMapper
- Sequel::SQLite::DatasetMethods
- Sequel::Schema
- Sequel::Schema::AlterTableGenerator
- Sequel::Schema::CreateTableGenerator
- Sequel::Schema::Generator
- Sequel::SchemaCaching
- Sequel::SchemaDumper
- Sequel::SelectRemove
- Sequel::Sequel3DatasetMethods
- Sequel::ServerBlock
- Sequel::SetOverrides
- Sequel::ShardedSingleConnectionPool
- Sequel::ShardedThreadedConnectionPool
- Sequel::SimpleMigration
- Sequel::SingleConnectionPool
- Sequel::SqlAnywhere
- Sequel::SqlAnywhere::Database
- Sequel::SqlAnywhere::DatabaseMethods
- Sequel::SqlAnywhere::Dataset
- Sequel::SqlAnywhere::DatasetMethods
- Sequel::SqlAnywhere::SQLAnywhereException
- 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::DatabaseMethods
- 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::ToDot
- Sequel::ToDot::DatasetMethods
- Sequel::Unbinder
- Sequel::UnthreadedServerBlock
- Sequel::ValidationFailed
- String
- String::Inflections
- Array
- FalseClass
- Hash
- NilClass
- Numeric
- Object
- PGconn
- PGresult
- Range
- Symbol
- TrueClass

No matching classes.

# Sequel::Postgres::DatasetMethods

Instance methods for datasets that connect to a PostgreSQL database.

### Constants

ACCESS_EXCLUSIVE
ACCESS_SHARE
APOS
APOS_RE
AS
BACKSLASH
BLOB_RE
BOOL_FALSE
BOOL_TRUE
COMMA
COMMA_SEPARATOR
CRLF
DOUBLE_APOS
EMPTY_STRING
ESCAPE
EXCLUSIVE
EXPLAIN
EXPLAIN_ANALYZE
FOR_SHARE
FROM
LOCK_MODES
NULL
PAREN_CLOSE
PAREN_OPEN
PG_TIMESTAMP_FORMAT
QUERY_PLAN
ROW_EXCLUSIVE
ROW_SHARE
SELECT_VALUES
SHARE
SHARE_ROW_EXCLUSIVE
SHARE_UPDATE_EXCLUSIVE
SPACE
SQL_WITH_RECURSIVE
WINDOW
XOR_OP

### Public Instance Methods

analyze() click to toggle source

Return the results of an EXPLAIN ANALYZE query as a string

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

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

Handle converting the ruby xor operator (^) into the PostgreSQL xor operator (#), and use the ILIKE and NOT ILIKE operators.

    # File lib/sequel/adapters/shared/postgres.rb, line 1246
    def complex_expression_sql_append(sql, op, args)
      case op
      when :^
        j = XOR_OP
        c = false
        args.each do |a|
          sql << j if c
          literal_append(sql, a)
          c ||= true
        end
      when :ILIKE, :'NOT ILIKE'
        sql << PAREN_OPEN
        literal_append(sql, args.at(0))
        sql << SPACE << op.to_s << SPACE
        literal_append(sql, args.at(1))
        sql << ESCAPE
        literal_append(sql, BACKSLASH)
        sql << PAREN_CLOSE
      else
        super
      end
    end

disable_insert_returning() click to toggle source

Disables automatic use of INSERT ... RETURNING. You can still use returning manually to force the use of RETURNING when inserting.

This is designed for cases where INSERT RETURNING cannot be used, such as when you are using partitioning with trigger functions or conditional rules, or when you are using a PostgreSQL version less than 8.2, or a PostgreSQL derivative that does not support returning.

Note that when this method is used, insert will not return the primary key of the inserted row, you will have to get the primary key of the inserted row before inserting via nextval, or after inserting via currval or lastval (making sure to use the same database connection for currval or lastval).

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

explain(opts=OPTS) click to toggle source

Return the results of an EXPLAIN query as a string

    # File lib/sequel/adapters/shared/postgres.rb, line 1288
    def explain(opts=OPTS)
      with_sql((opts[:analyze] ? EXPLAIN_ANALYZE : EXPLAIN) + select_sql).map(QUERY_PLAN).join(CRLF)
    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 1293
    def for_share
      lock_style(:share)
    end

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

Run a full text search on PostgreSQL. By default, searching for the inclusion of any of the terms in any of the cols.

Options:

:language | The language to use for the search (default: 'simple')
:plain | Whether a plain search should be used (default: false). In this case, terms should be a single string, and it will do a search where cols contains all of the words in terms. This ignores search operators in terms.
:phrase | Similar to :plain, but also adding an ILIKE filter to ensure that returned rows also include the exact phrase used.
:rank | Set to true to order by the rank, so that closer matches are returned first.
:tsquery | Specifies the terms argument is already a valid SQL expression returning a tsquery, and can be used directly in the query.
:tsvector | Specifies the cols argument is already a valid SQL expression returning a tsvector, and can be used directly in the query.

    # File lib/sequel/adapters/shared/postgres.rb, line 1312
    def full_text_search(cols, terms, opts = OPTS)
      lang = Sequel.cast(opts[:language] || 'simple', :regconfig)

      unless opts[:tsvector]
        phrase_cols = full_text_string_join(cols)
        cols = Sequel.function(:to_tsvector, lang, phrase_cols)
      end

      unless opts[:tsquery]
        phrase_terms = terms.is_a?(Array) ? terms.join(' | ') : terms
        query_func = (opts[:phrase] || opts[:plain]) ? :plainto_tsquery : :to_tsquery
        terms = Sequel.function(query_func, lang, phrase_terms)
      end

      ds = where(Sequel.lit(["(", " @@ ", ")"], cols, terms))

      if opts[:phrase]
        raise Error, "can't use :phrase with either :tsvector or :tsquery arguments to full_text_search together" if opts[:tsvector] || opts[:tsquery]
        ds = ds.grep(phrase_cols, "%#{escape_like(phrase_terms)}%", :case_insensitive=>true)
      end

      if opts[:rank]
        ds = ds.order{ts_rank_cd(cols, terms)}
      end

      ds
    end

insert(*values) click to toggle source

Insert given values into the database.

    # File lib/sequel/adapters/shared/postgres.rb, line 1341
    def insert(*values)
      if @opts[:returning]
        # Already know which columns to return, let the standard code handle it
        super
      elsif @opts[:sql] || @opts[:disable_insert_returning]
        # Raw SQL used or RETURNING disabled, just use the default behavior
        # and return nil since sequence is not known.
        super
        nil
      else
        # Force the use of RETURNING with the primary key value,
        # unless it has been disabled.
        returning(insert_pk).insert(*values){|r| return r.values.first}
      end
    end

insert_conflict(opts=OPTS) click to toggle source

Handle uniqueness violations when inserting, by updating the conflicting row, using ON CONFLICT. With no options, uses ON CONFLICT DO NOTHING. Options:

:constraint | An explicit constraint name, has precendence over :target.
:target | The column name or expression to handle uniqueness violations on.
:update | A hash of columns and values to set. Uses ON CONFLICT DO UPDATE.
:update_where | A WHERE condition to use for the update.

Examples:

    DB[:table].insert_conflict.insert(:a=>1, :b=>2)
    # INSERT INTO TABLE (a, b) VALUES (1, 2)
    # ON CONFLICT DO NOTHING

    DB[:table].insert_conflict(:constraint=>:table_a_uidx).insert(:a=>1, :b=>2)
    # INSERT INTO TABLE (a, b) VALUES (1, 2)
    # ON CONFLICT ON CONSTRAINT table_a_uidx DO NOTHING

    DB[:table].insert_conflict(:target=>:a).insert(:a=>1, :b=>2)
    # INSERT INTO TABLE (a, b) VALUES (1, 2)
    # ON CONFLICT (a) DO NOTHING

    DB[:table].insert_conflict(:target=>:a, :update=>{:b=>:excluded__b}).insert(:a=>1, :b=>2)
    # INSERT INTO TABLE (a, b) VALUES (1, 2)
    # ON CONFLICT (a) DO UPDATE SET b = excluded.b

    DB[:table].insert_conflict(:constraint=>:table_a_uidx,
      :update=>{:b=>:excluded__b}, :update_where=>{:table__status_id=>1}).insert(:a=>1, :b=>2)
    # INSERT INTO TABLE (a, b) VALUES (1, 2)
    # ON CONFLICT ON CONSTRAINT table_a_uidx
    # DO UPDATE SET b = excluded.b WHERE (table.status_id = 1)

    # File lib/sequel/adapters/shared/postgres.rb, line 1387
    def insert_conflict(opts=OPTS)
      clone(:insert_conflict => opts)
    end

insert_ignore() click to toggle source

Ignore uniqueness/exclusion violations when inserting, using ON CONFLICT DO NOTHING. Exists mostly for compatibility to MySQL's insert_ignore. Example:

    DB[:table].insert_ignore.insert(:a=>1, :b=>2)
    # INSERT INTO TABLE (a, b) VALUES (1, 2)
    # ON CONFLICT DO NOTHING

    # File lib/sequel/adapters/shared/postgres.rb, line 1397
    def insert_ignore
      insert_conflict
    end

insert_select(*values) click to toggle source

Insert a record returning the record inserted. Always returns nil without inserting a query if disable_insert_returning is used.

    # File lib/sequel/adapters/shared/postgres.rb, line 1403
    def insert_select(*values)
      return unless supports_insert_select?
      server?(:default).with_sql_first(insert_select_sql(*values))
    end

insert_select_sql(*values) click to toggle source

The SQL to use for an insert_select, adds a RETURNING clause to the insert unless the RETURNING clause is already present.

    # File lib/sequel/adapters/shared/postgres.rb, line 1410
    def insert_select_sql(*values)
      ds = opts[:returning] ? self : returning
      ds.insert_sql(*values)
    end

lock(mode, opts=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 1420
    def lock(mode, opts=OPTS)
      if block_given? # perform locking inside a transaction and yield to block
        @db.transaction(opts){lock(mode, opts); yield}
      else
        sql = 'LOCK TABLE '
        source_list_append(sql, @opts[:from])
        mode = mode.to_s.upcase.strip
        unless LOCK_MODES.include?(mode)
          raise Error, "Unsupported lock mode: #{mode}"
        end
        sql << " IN #{mode} MODE"
        @db.execute(sql, opts)
      end
      nil
    end

supports_cte?(type=:select) click to toggle source

    # File lib/sequel/adapters/shared/postgres.rb, line 1436
    def supports_cte?(type=:select)
      if type == :select
        server_version >= 80400
      else
        server_version >= 90100
      end
    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 1446
    def supports_cte_in_subqueries?
      supports_cte?
    end

supports_distinct_on?() click to toggle source

DISTINCT ON is a PostgreSQL extension

    # File lib/sequel/adapters/shared/postgres.rb, line 1451
    def supports_distinct_on?
      true
    end

supports_group_cube?() click to toggle source

PostgreSQL 9.5+ supports GROUP CUBE

    # File lib/sequel/adapters/shared/postgres.rb, line 1456
    def supports_group_cube?
      server_version >= 90500
    end

supports_group_rollup?() click to toggle source

PostgreSQL 9.5+ supports GROUP ROLLUP

    # File lib/sequel/adapters/shared/postgres.rb, line 1461
    def supports_group_rollup?
      server_version >= 90500
    end

supports_grouping_sets?() click to toggle source

PostgreSQL 9.5+ supports GROUPING SETS

    # File lib/sequel/adapters/shared/postgres.rb, line 1466
    def supports_grouping_sets?
      server_version >= 90500
    end

supports_insert_conflict?() click to toggle source

PostgreSQL 9.5+ supports the ON CONFLICT clause to INSERT.

    # File lib/sequel/adapters/shared/postgres.rb, line 1476
    def supports_insert_conflict?
      server_version >= 90500
    end

supports_insert_select?() click to toggle source

True unless insert returning has been disabled for this dataset.

    # File lib/sequel/adapters/shared/postgres.rb, line 1471
    def supports_insert_select?
      !@opts[:disable_insert_returning]
    end

supports_lateral_subqueries?() click to toggle source

PostgreSQL 9.3rc1+ supports lateral subqueries

    # File lib/sequel/adapters/shared/postgres.rb, line 1481
    def supports_lateral_subqueries?
      server_version >= 90300
    end

supports_modifying_joins?() click to toggle source

PostgreSQL supports modifying joined datasets

    # File lib/sequel/adapters/shared/postgres.rb, line 1486
    def supports_modifying_joins?
      true
    end

supports_regexp?() click to toggle source

PostgreSQL supports pattern matching via regular expressions

    # File lib/sequel/adapters/shared/postgres.rb, line 1496
    def supports_regexp?
      true
    end

supports_returning?(type) click to toggle source

Returning is always supported.

    # File lib/sequel/adapters/shared/postgres.rb, line 1491
    def supports_returning?(type)
      true
    end

supports_timestamp_timezones?() click to toggle source

PostgreSQL supports timezones in literal timestamps

    # File lib/sequel/adapters/shared/postgres.rb, line 1501
    def supports_timestamp_timezones?
      true
    end

supports_window_functions?() click to toggle source

PostgreSQL 8.4+ supports window functions

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

truncate(opts = OPTS) click to toggle source

Truncates the dataset. Returns nil.

Options:

:cascade | whether to use the CASCADE option, useful when truncating tables with foreign keys.
:only | truncate using ONLY, so child tables are unaffected
:restart | use RESTART IDENTITY to restart any related sequences

:only and :restart only work correctly on PostgreSQL 8.4+.

Usage:

    DB[:table].truncate # TRUNCATE TABLE "table"
    # => nil
    DB[:table].truncate(:cascade => true, :only=>true, :restart=>true) # TRUNCATE TABLE ONLY "table" RESTART IDENTITY CASCADE
    # => nil

    # File lib/sequel/adapters/shared/postgres.rb, line 1525
    def truncate(opts = OPTS)
      if opts.empty?
        super()
      else
        clone(:truncate_opts=>opts).truncate
      end
    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 1534
    def window(name, opts)
      clone(:window=>(@opts[:window]||[]) + [[name, SQL::Window.new(opts)]])
    end

### Protected Instance Methods

_import(columns, values, opts=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 1544
    def _import(columns, values, opts=OPTS)
      if @opts[:returning]
        statements = multi_insert_sql(columns, values)
        @db.transaction(Hash[opts].merge!(:server=>@opts[:server])) do
          statements.map{|st| returning_fetch_rows(st)}
        end.first.map{|v| v.length == 1 ? v.values.first : v}
      elsif opts[:return] == :primary_key
        returning(insert_pk)._import(columns, values, opts)
      else
        super
      end
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.