Module: Sequel::Postgres::DatabaseMethods

### Home Classes Methods

### In Files

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

### Methods

- #commit_prepared_transaction
- #create_function
- #create_language
- #create_schema
- #create_trigger
- #database_type
- #do
- #drop_function
- #drop_language
- #drop_schema
- #drop_trigger
- #foreign_key_list
- #indexes
- #locks
- #notify
- #primary_key
- #primary_key_sequence
- #refresh_view
- #reset_conversion_procs
- #reset_primary_key_sequence
- #rollback_prepared_transaction
- #serial_primary_key_options
- #server_version
- #supports_create_table_if_not_exists?
- #supports_deferrable_constraints?
- #supports_deferrable_foreign_key_constraints?
- #supports_drop_table_if_exists?
- #supports_partial_indexes?
- #supports_prepared_transactions?
- #supports_savepoints?
- #supports_transaction_isolation_levels?
- #supports_transactional_ddl?
- #tables
- #type_supported?
- #views

### 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
- 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.2.0.txt
- 4.3.0.txt
- 4.4.0.txt
- 4.5.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::AdapterNotFound
- Sequel::Amalgalite
- Sequel::Amalgalite::Database
- Sequel::Amalgalite::Dataset
- Sequel::Amalgalite::SequelTypeMap
- Sequel::ArbitraryServers
- Sequel::BasicObject
- Sequel::BeforeHookFailed
- Sequel::CheckConstraintViolation
- Sequel::ColumnsIntrospection
- Sequel::ConnectionPool
- Sequel::ConnectionPool::ClassMethods
- Sequel::ConnectionValidator
- Sequel::ConnectionValidator::Retry
- Sequel::ConstraintValidations
- Sequel::ConstraintValidations::AlterTableGeneratorMethods
- Sequel::ConstraintValidations::CreateTableGeneratorMethods
- Sequel::ConstraintValidations::Generator
- Sequel::ConstraintViolation
- Sequel::CoreRefinements
- Sequel::Cubrid
- Sequel::Cubrid::Database
- Sequel::Cubrid::DatabaseMethods
- Sequel::Cubrid::Dataset
- Sequel::Cubrid::DatasetMethods
- 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::DatabaseMethods
- Sequel::DataObjects::SQLite
- Sequel::DataObjects::SQLite::DatabaseMethods
- Sequel::Database
- Sequel::Database::DatasetClass
- Sequel::Database::FromBlock
- Sequel::Database::ResetIdentifierMangling
- Sequel::Database::SplitAlterTable
- Sequel::DatabaseConnectionError
- Sequel::DatabaseDisconnectError
- Sequel::DatabaseError
- Sequel::DatabaseQuery
- Sequel::Dataset
- Sequel::Dataset::ArgumentMapper
- Sequel::Dataset::NullDataset
- Sequel::Dataset::Nullifiable
- Sequel::Dataset::Pagination
- Sequel::Dataset::PreparedStatementMethods
- Sequel::Dataset::Query
- Sequel::Dataset::Replace
- Sequel::Dataset::SplitArrayNil
- Sequel::Dataset::StoredProcedureMethods
- Sequel::Dataset::StoredProcedures
- Sequel::Dataset::UnnumberedArgumentMapper
- Sequel::DatasetPagination
- Sequel::DatasetPrinter
- Sequel::DatasetQuery
- Sequel::Deprecation
- Sequel::EmptyArrayIgnoreNulls
- Sequel::EmulateOffsetWithReverseAndCount
- Sequel::EmulateOffsetWithRowNumber
- Sequel::Error
- Sequel::Error::AdapterNotFound
- Sequel::Error::InvalidOperation
- Sequel::Error::InvalidValue
- Sequel::Error::PoolTimeoutError
- Sequel::Error::Rollback
- Sequel::ErrorSQL
- Sequel::EvalInspect
- Sequel::FilterHaving
- Sequel::Firebird
- Sequel::Firebird::Database
- Sequel::Firebird::DatabaseMethods
- Sequel::Firebird::Dataset
- Sequel::Firebird::DatasetMethods
- Sequel::ForeignKeyConstraintViolation
- 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::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::InvalidValue
- 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::Dataset::PreparedStatementMethods
- Sequel::JDBC::Dataset::StoredProcedureMethods
- Sequel::JDBC::Dataset::TYPE_TRANSLATOR
- 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::Postgres::Dataset::PGArrayConverter
- 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::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::OneToManyAssociationReflection
- Sequel::Model::Associations::OneToOneAssociationReflection
- 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::MySQL::PreparedStatements::DatasetMethods::PreparedStatementMethods
- Sequel::MySQL::PreparedStatements::DatasetMethods::StoredProcedureMethods
- Sequel::Mysql2
- Sequel::Mysql2::Database
- Sequel::Mysql2::Dataset
- Sequel::NamedTimezones
- Sequel::NamedTimezones::DatabaseMethods
- Sequel::NoExistingObject
- Sequel::NoMatchingRow
- Sequel::NotNullConstraintViolation
- Sequel::ODBC
- 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::Dataset
- Sequel::Oracle::Dataset::ArgumentMapper
- Sequel::Oracle::Dataset::BindArgumentMethods
- Sequel::Oracle::Dataset::PreparedStatementMethods
- Sequel::Oracle::DatasetMethods
- Sequel::Plugins
- 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::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::DatasetAssociations
- Sequel::Plugins::DatasetAssociations::ClassMethods
- Sequel::Plugins::DatasetAssociations::DatasetMethods
- Sequel::Plugins::DefaultsSetter
- Sequel::Plugins::DefaultsSetter::ClassMethods
- Sequel::Plugins::DefaultsSetter::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::InstanceFilters
- Sequel::Plugins::InstanceFilters::Error
- 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::ManyToOnePkLookup
- 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::Error
- 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::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::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::SkipCreateRefresh
- Sequel::Plugins::SkipCreateRefresh::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::UpdatePrimaryKey
- 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::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::Dataset::BindArgumentMethods
- Sequel::Postgres::Dataset::PreparedStatementMethods
- Sequel::Postgres::DatasetMethods
- Sequel::Postgres::DatasetMethods::PreparedStatementMethods
- 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::IntervalDatabaseMethods
- Sequel::Postgres::IntervalDatabaseMethods::Parser
- Sequel::Postgres::IntervalDatasetMethods
- Sequel::Postgres::JSONArray
- Sequel::Postgres::JSONDatabaseMethods
- Sequel::Postgres::JSONHash
- 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::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::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::EmulatedFunction
- 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::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::WindowFunction
- Sequel::SQL::Wrapper
- Sequel::SQLTime
- Sequel::SQLite
- Sequel::SQLite::Database
- Sequel::SQLite::DatabaseMethods
- Sequel::SQLite::Dataset
- Sequel::SQLite::Dataset::ArgumentMapper
- Sequel::SQLite::Dataset::BindArgumentMethods
- Sequel::SQLite::Dataset::PreparedStatementMethods
- Sequel::SQLite::DatasetMethods
- Sequel::Schema
- Sequel::Schema::AlterTableGenerator
- Sequel::Schema::CreateTableGenerator
- Sequel::Schema::Generator
- Sequel::SchemaCaching
- Sequel::SchemaDumper
- Sequel::SelectRemove
- Sequel::Sequel3DatasetMethods
- Sequel::SerializationFailure
- 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::TinyTDS::Dataset::PreparedStatementMethods
- Sequel::ToDot
- Sequel::ToDot::DatasetMethods
- Sequel::UnbindDuplicate
- Sequel::Unbinder
- Sequel::UndefinedAssociation
- Sequel::UniqueConstraintViolation
- Sequel::UnthreadedServerBlock
- Sequel::ValidationFailed
- String
- String::Inflections
- Array
- FalseClass
- Hash
- NilClass
- Numeric
- Object
- PGconn
- PGresult
- Range
- Symbol
- TrueClass

No matching classes.

# Sequel::Postgres::DatabaseMethods

Methods shared by Database instances that connect to PostgreSQL.

### Constants

DATABASE_ERROR_REGEXPS
EXCLUSION_CONSTRAINT_SQL_STATE
FOREIGN_KEY_LIST_ON_DELETE_MAP
ON_COMMIT
POSTGRES_DEFAULT_RE
PREPARED_ARG_PLACEHOLDER
RE_CURRVAL_ERROR
SELECT_CUSTOM_SEQUENCE_SQL

  SQL fragment for custom sequences (ones not created by serial primary key), Returning the schema and literal form of the sequence name, by parsing the column defaults table.

SELECT_PK_SQL

  SQL fragment for determining primary key column for the given table. Only returns the first primary key if the table has a composite primary key.

SELECT_SERIAL_SEQUENCE_SQL

  SQL fragment for getting sequence associated with table's primary key, assuming it was a serial primary key column.

UNLOGGED
VALID_CLIENT_MIN_MESSAGES

### Attributes

conversion_procs[R]

A hash of conversion procs, keyed by type integer (oid) and having callable values for the conversion proc for that type.

### Public Instance Methods

commit_prepared_transaction(transaction_id) click to toggle source

Commit an existing prepared transaction with the given transaction identifier string.

    # File lib/sequel/adapters/shared/postgres.rb, line 159
    def commit_prepared_transaction(transaction_id)
      run("COMMIT PREPARED #{literal(transaction_id)}")
    end

create_function(name, definition, opts=OPTS) click to toggle source

Creates the function in the database. Arguments:

- name : name of the function to create

- definition : string definition of the function, or object file for a dynamically loaded C function.

- opts : options hash:

  - :args : function arguments, can be either a symbol or string specifying a type or an array of 1-3 elements:

    - element 1 : argument data type

    - element 2 : argument name

    - element 3 : argument mode (e.g. in, out, inout)

  - :behavior : Should be IMMUTABLE, STABLE, or VOLATILE. PostgreSQL assumes VOLATILE by default.

  - :cost : The estimated cost of the function, used by the query planner.

  - :language : The language the function uses. SQL is the default.

  - :link_symbol : For a dynamically loaded see function, the function's link symbol if different from the definition argument.

  - :returns : The data type returned by the function. If you are using OUT or INOUT argument modes, this is ignored. Otherwise, if this is not specified, void is used by default to specify the function is not supposed to return a value.

  - :rows : The estimated number of rows the function will return. Only use if the function returns SETOF something.

  - :security_definer : Makes the privileges of the function the same as the privileges of the user who defined the function instead of the privileges of the user who runs the function. There are security implications when doing this, see the PostgreSQL documentation.

  - :set : Configuration variables to set while the function is being run, can be a hash or an array of two pairs. search_path is often used here if :security_definer is used.

  - :strict : Makes the function return NULL when any argument is NULL.

    # File lib/sequel/adapters/shared/postgres.rb, line 183
    def create_function(name, definition, opts=OPTS)
      self << create_function_sql(name, definition, opts)
    end

create_language(name, opts=OPTS) click to toggle source

Create the procedural language in the database. Arguments:

- name : Name of the procedural language (e.g. plpgsql)

- opts : options hash:

  - :handler : The name of a previously registered function used as a call handler for this language.

  - :replace : Replace the installed language if it already exists (on PostgreSQL 9.0+).

  - :trusted : Marks the language being created as trusted, allowing unprivileged users to create functions using this language.

  - :validator : The name of previously registered function used as a validator of functions defined in this language.

    # File lib/sequel/adapters/shared/postgres.rb, line 194
    def create_language(name, opts=OPTS)
      self << create_language_sql(name, opts)
    end

create_schema(name, opts=OPTS) click to toggle source

Create a schema in the database. Arguments:

- name : Name of the schema (e.g. admin)

- opts : options hash:

  - :if_not_exists : Don't raise an error if the schema already exists (PostgreSQL 9.3+)

  - :owner : The owner to set for the schema (defaults to current user if not specified)

    # File lib/sequel/adapters/shared/postgres.rb, line 203
    def create_schema(name, opts=OPTS)
      self << create_schema_sql(name, opts)
    end

create_trigger(table, name, function, opts=OPTS) click to toggle source

Create a trigger in the database. Arguments:

- table : the table on which this trigger operates

- name : the name of this trigger

- function : the function to call for this trigger, which should return type trigger.

- opts : options hash:

  - :after : Calls the trigger after execution instead of before.

  - :args : An argument or array of arguments to pass to the function.

  - :each_row : Calls the trigger for each row instead of for each statement.

  - :events : Can be :insert, :update, :delete, or an array of any of those. Calls the trigger whenever that type of statement is used. By default, the trigger is called for insert, update, or delete.

    # File lib/sequel/adapters/shared/postgres.rb, line 217
    def create_trigger(table, name, function, opts=OPTS)
      self << create_trigger_sql(table, name, function, opts)
    end

database_type() click to toggle source

PostgreSQL uses the :postgres database type.

    # File lib/sequel/adapters/shared/postgres.rb, line 222
    def database_type
      :postgres
    end

do(code, opts=OPTS) click to toggle source

Use PostgreSQL's DO syntax to execute an anonymous code block. The code should be the literal code string to use in the underlying procedural language. Options:

:language | The procedural language the code is written in. The PostgreSQL default is plpgsql. Can be specified as a string or a symbol.

    # File lib/sequel/adapters/shared/postgres.rb, line 231
    def do(code, opts=OPTS)
      language = opts[:language]
      run "DO #{"LANGUAGE #{literal(language.to_s)} " if language}#{literal(code)}"
    end

drop_function(name, opts=OPTS) click to toggle source

Drops the function from the database. Arguments:

- name : name of the function to drop

- opts : options hash:

  - :args : The arguments for the function. See create_function_sql.

  - :cascade : Drop other objects depending on this function.

  - :if_exists : Don't raise an error if the function doesn't exist.

    # File lib/sequel/adapters/shared/postgres.rb, line 242
    def drop_function(name, opts=OPTS)
      self << drop_function_sql(name, opts)
    end

drop_language(name, opts=OPTS) click to toggle source

Drops a procedural language from the database. Arguments:

- name : name of the procedural language to drop

- opts : options hash:

  - :cascade : Drop other objects depending on this function.

  - :if_exists : Don't raise an error if the function doesn't exist.

    # File lib/sequel/adapters/shared/postgres.rb, line 251
    def drop_language(name, opts=OPTS)
      self << drop_language_sql(name, opts)
    end

drop_schema(name, opts=OPTS) click to toggle source

Drops a schema from the database. Arguments:

- name : name of the schema to drop

- opts : options hash:

  - :cascade : Drop all objects in this schema.

  - :if_exists : Don't raise an error if the schema doesn't exist.

    # File lib/sequel/adapters/shared/postgres.rb, line 260
    def drop_schema(name, opts=OPTS)
      self << drop_schema_sql(name, opts)
    end

drop_trigger(table, name, opts=OPTS) click to toggle source

Drops a trigger from the database. Arguments:

- table : table from which to drop the trigger

- name : name of the trigger to drop

- opts : options hash:

  - :cascade : Drop other objects depending on this function.

  - :if_exists : Don't raise an error if the function doesn't exist.

    # File lib/sequel/adapters/shared/postgres.rb, line 270
    def drop_trigger(table, name, opts=OPTS)
      self << drop_trigger_sql(table, name, opts)
    end

foreign_key_list(table, opts=OPTS) click to toggle source

Return full foreign key information using the pg system tables, including :name, :on_delete, :on_update, and :deferrable entries in the hashes.

    # File lib/sequel/adapters/shared/postgres.rb, line 276
    def foreign_key_list(table, opts=OPTS)
      m = output_identifier_meth
      schema, _ = opts.fetch(:schema, schema_and_table(table))
      range = 0...32

      base_ds = metadata_dataset.
        from(:pg_constraint___co).
        join(:pg_class___cl, :oid=>:conrelid).
        where(:cl__relkind=>'r', :co__contype=>'f', :cl__oid=>regclass_oid(table))

      # We split the parsing into two separate queries, which are merged manually later.
      # This is because PostgreSQL stores both the referencing and referenced columns in
      # arrays, and I don't know a simple way to not create a cross product, as PostgreSQL
      # doesn't appear to have a function that takes an array and element and gives you
      # the index of that element in the array.

      ds = base_ds.
        join(:pg_attribute___att, :attrelid=>:oid, :attnum=>SQL::Function.new(:ANY, :co__conkey)).
        order(:co__conname, SQL::CaseExpression.new(range.map{|x| [SQL::Subscript.new(:co__conkey, [x]), x]}, 32, :att__attnum)).
        select(:co__conname___name, :att__attname___column, :co__confupdtype___on_update, :co__confdeltype___on_delete,
               SQL::BooleanExpression.new(:AND, :co__condeferrable, :co__condeferred).as(:deferrable))

      ref_ds = base_ds.
        join(:pg_class___cl2, :oid=>:co__confrelid).
        join(:pg_attribute___att2, :attrelid=>:oid, :attnum=>SQL::Function.new(:ANY, :co__confkey)).
        order(:co__conname, SQL::CaseExpression.new(range.map{|x| [SQL::Subscript.new(:co__conkey, [x]), x]}, 32, :att2__attnum)).
        select(:co__conname___name, :cl2__relname___table, :att2__attname___refcolumn)

      # If a schema is given, we only search in that schema, and the returned :table
      # entry is schema qualified as well.
      if schema
        ref_ds = ref_ds.join(:pg_namespace___nsp2, :oid=>:cl2__relnamespace).
          select_more(:nsp2__nspname___schema)
      end

      h = {}
      fklod_map = FOREIGN_KEY_LIST_ON_DELETE_MAP
      ds.each do |row|
        if r = h[row[:name]]
          r[:columns] << m.call(row[:column])
        else
          h[row[:name]] = {:name=>m.call(row[:name]), :columns=>[m.call(row[:column])], :on_update=>fklod_map[row[:on_update]], :on_delete=>fklod_map[row[:on_delete]], :deferrable=>row[:deferrable]}
        end
      end
      ref_ds.each do |row|
        r = h[row[:name]]
        r[:table] ||= schema ? SQL::QualifiedIdentifier.new(m.call(row[:schema]), m.call(row[:table])) : m.call(row[:table])
        r[:key] ||= []
        r[:key] << m.call(row[:refcolumn])
      end
      h.values
    end

indexes(table, opts=OPTS) click to toggle source

Use the pg_* system tables to determine indexes on a table

    # File lib/sequel/adapters/shared/postgres.rb, line 330
    def indexes(table, opts=OPTS)
      m = output_identifier_meth
      range = 0...32
      attnums = server_version >= 80100 ? SQL::Function.new(:ANY, :ind__indkey) : range.map{|x| SQL::Subscript.new(:ind__indkey, [x])}
      ds = metadata_dataset.
        from(:pg_class___tab).
        join(:pg_index___ind, :indrelid=>:oid).
        join(:pg_class___indc, :oid=>:indexrelid).
        join(:pg_attribute___att, :attrelid=>:tab__oid, :attnum=>attnums).
        left_join(:pg_constraint___con, :conname=>:indc__relname).
        filter(:indc__relkind=>'i', :ind__indisprimary=>false, :indexprs=>nil, :indpred=>nil, :indisvalid=>true, :tab__oid=>regclass_oid(table, opts)).
        order(:indc__relname, SQL::CaseExpression.new(range.map{|x| [SQL::Subscript.new(:ind__indkey, [x]), x]}, 32, :att__attnum)).
        select(:indc__relname___name, :ind__indisunique___unique, :att__attname___column, :con__condeferrable___deferrable)

      ds.filter!(:indisready=>true, :indcheckxmin=>false) if server_version >= 80300

      indexes = {}
      ds.each do |r|
        i = indexes[m.call(r[:name])] ||= {:columns=>[], :unique=>r[:unique], :deferrable=>r[:deferrable]}
        i[:columns] << m.call(r[:column])
      end
      indexes
    end

locks() click to toggle source

Dataset containing all current database locks

    # File lib/sequel/adapters/shared/postgres.rb, line 355
    def locks
      dataset.from(:pg_class).join(:pg_locks, :relation=>:relfilenode).select(:pg_class__relname, Sequel::SQL::ColumnAll.new(:pg_locks))
    end

notify(channel, opts=OPTS) click to toggle source

Notifies the given channel. See the PostgreSQL NOTIFY documentation. Options:

:payload | The payload string to use for the NOTIFY statement. Only supported in PostgreSQL 9.0+.
:server | The server to which to send the NOTIFY statement, if the sharding support is being used.

    # File lib/sequel/adapters/shared/postgres.rb, line 365
    def notify(channel, opts=OPTS)
      sql = "NOTIFY "
      dataset.send(:identifier_append, sql, channel)
      if payload = opts[:payload]
        sql << ", "
        dataset.literal_append(sql, payload.to_s)
      end
      execute_ddl(sql, opts)
    end

primary_key(table, opts=OPTS) click to toggle source

Return primary key for the given table.

    # File lib/sequel/adapters/shared/postgres.rb, line 376
    def primary_key(table, opts=OPTS)
      quoted_table = quote_schema_table(table)
      Sequel.synchronize{return @primary_keys[quoted_table] if @primary_keys.has_key?(quoted_table)}
      sql = "#{SELECT_PK_SQL} AND pg_class.oid = #{literal(regclass_oid(table, opts))}"
      value = fetch(sql).single_value
      Sequel.synchronize{@primary_keys[quoted_table] = value}
    end

primary_key_sequence(table, opts=OPTS) click to toggle source

Return the sequence providing the default for the primary key for the given table.

    # File lib/sequel/adapters/shared/postgres.rb, line 385
    def primary_key_sequence(table, opts=OPTS)
      quoted_table = quote_schema_table(table)
      Sequel.synchronize{return @primary_key_sequences[quoted_table] if @primary_key_sequences.has_key?(quoted_table)}
      sql = "#{SELECT_SERIAL_SEQUENCE_SQL} AND t.oid = #{literal(regclass_oid(table, opts))}"
      if pks = fetch(sql).single_record
        value = literal(SQL::QualifiedIdentifier.new(pks[:schema], pks[:sequence]))
        Sequel.synchronize{@primary_key_sequences[quoted_table] = value}
      else
        sql = "#{SELECT_CUSTOM_SEQUENCE_SQL} AND t.oid = #{literal(regclass_oid(table, opts))}"
        if pks = fetch(sql).single_record
          value = literal(SQL::QualifiedIdentifier.new(pks[:schema], LiteralString.new(pks[:sequence])))
          Sequel.synchronize{@primary_key_sequences[quoted_table] = value}
        end
      end
    end

refresh_view(name, opts=OPTS) click to toggle source

Refresh the materialized view with the given name.

    DB.refresh_view(:items_view)
    # REFRESH MATERIALIZED VIEW items_view

    # File lib/sequel/adapters/shared/postgres.rb, line 405
    def refresh_view(name, opts=OPTS)
      run "REFRESH MATERIALIZED VIEW #{quote_schema_table(name)}"
    end

reset_conversion_procs() click to toggle source

Reset the database's conversion procs, requires a server query if there any named types.

    # File lib/sequel/adapters/shared/postgres.rb, line 411
    def reset_conversion_procs
      @conversion_procs = get_conversion_procs
    end

reset_primary_key_sequence(table) click to toggle source

Reset the primary key sequence for the given table, basing it on the maximum current value of the table's primary key.

    # File lib/sequel/adapters/shared/postgres.rb, line 417
    def reset_primary_key_sequence(table)
      return unless seq = primary_key_sequence(table)
      pk = SQL::Identifier.new(primary_key(table))
      db = self
      seq_ds = db.from(LiteralString.new(seq))
      s, t = schema_and_table(table)
      table = Sequel.qualify(s, t) if s
      get{setval(seq, db[table].select{coalesce(max(pk)+seq_ds.select{:increment_by}, seq_ds.select(:min_value))}, false)}
    end

rollback_prepared_transaction(transaction_id) click to toggle source

Rollback an existing prepared transaction with the given transaction identifier string.

    # File lib/sequel/adapters/shared/postgres.rb, line 429
    def rollback_prepared_transaction(transaction_id)
      run("ROLLBACK PREPARED #{literal(transaction_id)}")
    end

serial_primary_key_options() click to toggle source

PostgreSQL uses SERIAL psuedo-type instead of AUTOINCREMENT for managing incrementing primary keys.

    # File lib/sequel/adapters/shared/postgres.rb, line 435
    def serial_primary_key_options
      {:primary_key => true, :serial => true, :type=>Integer}
    end

server_version(server=nil) click to toggle source

The version of the PostgreSQL server, used for determining capability.

    # File lib/sequel/adapters/shared/postgres.rb, line 440
    def server_version(server=nil)
      return @server_version if @server_version
      @server_version = synchronize(server) do |conn|
        (conn.server_version rescue nil) if conn.respond_to?(:server_version)
      end
      unless @server_version
        @server_version = if m = /PostgreSQL (\d+)\.(\d+)(?:(?:rc\d+)|\.(\d+))?/.match(fetch('SELECT version()').single_value)
          (m[1].to_i * 10000) + (m[2].to_i * 100) + m[3].to_i
        else
          0
        end
      end
      warn 'Sequel no longer supports PostgreSQL <8.2, some things may not work' if @server_version < 80200
      @server_version
    end

supports_create_table_if_not_exists?() click to toggle source

PostgreSQL supports CREATE TABLE IF NOT EXISTS on 9.1+

    # File lib/sequel/adapters/shared/postgres.rb, line 457
    def supports_create_table_if_not_exists?
      server_version >= 90100
    end

supports_deferrable_constraints?() click to toggle source

PostgreSQL 9.0+ supports some types of deferrable constraints beyond foreign key constraints.

    # File lib/sequel/adapters/shared/postgres.rb, line 462
    def supports_deferrable_constraints?
      server_version >= 90000
    end

supports_deferrable_foreign_key_constraints?() click to toggle source

PostgreSQL supports deferrable foreign key constraints.

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

supports_drop_table_if_exists?() click to toggle source

PostgreSQL supports DROP TABLE IF EXISTS

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

supports_partial_indexes?() click to toggle source

PostgreSQL supports partial indexes.

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

supports_prepared_transactions?() click to toggle source

PostgreSQL supports prepared transactions (two-phase commit) if max_prepared_transactions is greater than 0.

    # File lib/sequel/adapters/shared/postgres.rb, line 483
    def supports_prepared_transactions?
      return @supports_prepared_transactions if defined?(@supports_prepared_transactions)
      @supports_prepared_transactions = self['SHOW max_prepared_transactions'].get.to_i > 0
    end

supports_savepoints?() click to toggle source

PostgreSQL supports savepoints

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

supports_transaction_isolation_levels?() click to toggle source

PostgreSQL supports transaction isolation levels

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

supports_transactional_ddl?() click to toggle source

PostgreSQL supports transaction DDL statements.

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

tables(opts=OPTS, &block) click to toggle source

Array of symbols specifying table names in the current database. The dataset used is yielded to the block if one is provided, otherwise, an array of symbols of table names is returned.

Options:

:qualify | Return the tables as Sequel::SQL::QualifiedIdentifier instances, using the schema the table is located in as the qualifier.
:schema | The schema to search
:server | The server to use

    # File lib/sequel/adapters/shared/postgres.rb, line 512
    def tables(opts=OPTS, &block)
      pg_class_relname('r', opts, &block)
    end

type_supported?(type) click to toggle source

Check whether the given type name string/symbol (e.g. :hstore) is supported by the database.

    # File lib/sequel/adapters/shared/postgres.rb, line 518
    def type_supported?(type)
      @supported_types ||= {}
      @supported_types.fetch(type){@supported_types[type] = (from(:pg_type).filter(:typtype=>'b', :typname=>type.to_s).count > 0)}
    end

views(opts=OPTS) click to toggle source

Array of symbols specifying view names in the current database.

Options:

:qualify | Return the views as Sequel::SQL::QualifiedIdentifier instances, using the schema the view is located in as the qualifier.
:schema | The schema to search
:server | The server to use

    # File lib/sequel/adapters/shared/postgres.rb, line 530
    def views(opts=OPTS)
      pg_class_relname('v', opts)
    end

[Validate]

Generated with the Darkfish Rdoc Generator 2.