Github   Telegram
Loading...
Searching...
No Matches
Namespaces | Classes | Typedefs | Enumerations | Functions | Variables
storages::postgres Namespace Reference

Top namespace for uPg driver. More...

Namespaces

namespace  io
 uPg input-output.
 

Classes

class  AccessRuleViolation
 
class  AdminShutdown
 
class  AlreadyInTransaction
 
class  ArrayError
 Base error when working with array types. More...
 
class  BoundedRange
 
class  BoundedRangeError
 PostgreSQL range type has at least one end unbound. More...
 
struct  ByteaWrapper
 Wrapper for binary data container. More...
 
class  CannotConnectNow
 
class  CardinalityViolation
 
class  CheckViolation
 
class  Cluster
 Interface for executing queries on a cluster of PostgreSQL servers. More...
 
class  ClusterError
 
struct  ClusterHostTypeHash
 
struct  ClusterSettings
 Settings for storages::postgres::Cluster. More...
 
struct  ClusterStatistics
 Cluster statistics storage. More...
 
class  ClusterUnavailable
 
struct  CommandControl
 
class  CommandError
 Error when invoking a libpq function. More...
 
struct  CompositeFieldDef
 Description of a field in a user-defined composite type, for type checking. More...
 
class  CompositeMemberTypeMismatch
 PostgreSQL composite type has different member type that the C++ mapping suggests. More...
 
class  CompositeSizeMismatch
 PostgreSQL composite type has different count of members from the C++ counterpart. More...
 
class  CompositeTypeDescription
 PostgreSQL composite type description. More...
 
class  ConfigurationFileError
 
class  ConnectionBusy
 An attempt to make a query to server was made while there is another query in flight. More...
 
class  ConnectionError
 
class  ConnectionFailed
 Exception is thrown when a single connection fails to connect. More...
 
class  ConnectionInterrupted
 A network operation was interrupted by task cancellation. More...
 
struct  ConnectionSettings
 
struct  ConnectionStatistics
 Template connection statistics storage. More...
 
class  ConnectionTimeoutError
 A network operation on a connection has timed out. More...
 
class  ConstFieldIterator
 Iterator over fields in a result set's row. More...
 
class  ConstRowIterator
 
class  CrashShutdown
 
class  Database
 Object for accessing PostgreSQL database instance (sharded or not) More...
 
class  DatabaseDropped
 
class  DataException
 Base class for data exceptions Doc: https://www.postgresql.org/docs/12/static/errcodes-appendix.html. More...
 
struct  DBTypeDescription
 Description of a PostgreSQL type. The structure is selected from the pg_catalog.pg_type table (not all, only appropriate fields). See https://www.postgresql.org/docs/12/catalog-pg-type.html. More...
 
struct  DBTypeName
 Identity for a PostgreSQL type name. More...
 
class  DependentPrivilegeDescriptorsStillExist
 
class  DiagnosticsException
 
class  DimensionMismatch
 Array received from postgres has different dimensions from those of C++ container. More...
 
class  DistLockComponentBase
 Base class for postgres-based distlock worker components. More...
 
class  DistLockStrategy
 Postgres distributed locking strategy. More...
 
struct  DsnOptions
 
class  DuplicatePreparedStatement
 
class  EnumerationError
 
class  Error
 Base class for all exceptions that may be thrown by the driver. More...
 
class  ExclusionViolation
 
class  ExternalRoutineException
 
class  ExternalRoutineInvocationException
 
class  FdwError
 
class  FeatureNotSupported
 
class  Field
 Accessor to a single field in a result set's row. More...
 
struct  FieldDescription
 
class  FieldIndexOutOfBounds
 Result set has less columns that the requested index. More...
 
class  FieldNameDoesntExist
 Result set doesn't have field with the requested name. More...
 
struct  FieldTag
 Tag type to disambiguate reading the first value of a row to a user's composite type (PostgreSQL composite type in the row initializes user's type). More...
 
class  FieldTupleMismatch
 A row was requested to be parsed based on field names/indexed, the count of names/indexes doesn't match the tuple size. More...
 
class  FieldValueIsNull
 Data extraction from a null field value to a non-nullable type requested. More...
 
class  ForeignKeyViolation
 
struct  InstanceStatisticsNonatomic
 
struct  InstanceStatisticsTemplate
 Template instance statistics storage. More...
 
struct  InstanceStatsDescriptor
 Instance statistics with description. More...
 
struct  InstanceTopologyStatistics
 Template instance topology statistics storage. More...
 
class  InsufficientResources
 
class  IntegrityConstraintViolation
 Base class for integrity constraint violation errors. Doc: https://www.postgresql.org/docs/12/static/errcodes-appendix.html. More...
 
class  InternalServerError
 
class  InvalidAuthorizationSpecification
 
class  InvalidBinaryBuffer
 Binary buffer contains invalid data. Can occur when parsing binary buffers containing multiple fields. More...
 
class  InvalidConfig
 
class  InvalidCursorState
 
class  InvalidDimensions
 
class  InvalidDSN
 
class  InvalidEnumerationLiteral
 
class  InvalidEnumerationValue
 
class  InvalidGrantor
 
class  InvalidInputBufferSize
 Buffer size is invalid for a fixed-size type. Can occur when a wrong field type is requested for reply. More...
 
class  InvalidInputFormat
 Invalid format for input data. More...
 
class  InvalidObjectName
 Exception class for several Invalid * Name classes. Class 34 - Invalid Cursor Name Class 3D - Invalid Catalogue Name Class 3F - Invalid Schema Name TODO Add documentation (links) on the error classes TODO Split exception classes if needed based on documentation. More...
 
class  InvalidParserCategory
 Field buffer contains different category of data than expected by data parser. More...
 
class  InvalidRepresentation
 Integral representation for a numeric contains invalid data. More...
 
class  InvalidRoleSpecification
 
class  InvalidSqlStatementName
 This exception is thrown in case a prepared statement doesn't exist. More...
 
class  InvalidTransactionState
 
class  InvalidTransactionTermination
 
class  InvalidTupleSizeRequested
 A tuple was requested to be parsed out of a row that doesn't have enough fields. More...
 
class  LocatorException
 
class  LogicError
 Base Postgres logic error. Reports errors that are consequences of erroneous driver usage, such as invalid query syntax, absence of appropriate parsers, out of range errors etc. These can be avoided by fixing code. More...
 
class  Message
 
class  NoBinaryParser
 A field in a result set doesn't have a binary parser. More...
 
class  NonSingleColumResultSet
 A row or result set requested to be treated as a single column, but contains more than one column. More...
 
class  NonSingleRowResultSet
 A result set containing a single row was expected. More...
 
class  NotImplemented
 
class  NotInTransaction
 
class  NotNullViolation
 
struct  Null
 Type to represent a null value. More...
 
class  NumericError
 
class  NumericOverflow
 Value in PostgreSQL binary buffer cannot be represented by a given C++ type. More...
 
class  ObjectNotInPrerequisiteState
 
class  OperatorIntervention
 
class  ParameterStore
 Class for dynamic PostgreSQL parameter list construction. More...
 
class  PlPgSqlError
 
class  PoolError
 Indicates errors during pool operation. More...
 
struct  PoolSettings
 PostgreSQL connection pool options. More...
 
class  Portal
 
class  ProgramLimitExceeded
 
class  Query
 Holds a query, its name and logging mode. More...
 
class  QueryCancelled
 
class  Range
 
class  RestrictViolation
 
class  ResultSet
 PostgreSQL result set. More...
 
class  ResultSetError
 
class  ReverseConstFieldIterator
 Reverse iterator over fields in a result set's row. More...
 
class  ReverseConstRowIterator
 
class  Row
 
class  RowDescription
 A wrapper for PGresult to access field descriptions. More...
 
class  RowIndexOutOfBounds
 Result set has less rows than the requested row index. More...
 
struct  RowTag
 Tag type to disambiguate reading the row to a user's row type (values of the row initialize user's type data members). More...
 
class  RuntimeError
 Base Postgres runtime error. Reports errors that are consequences of erroneous data, misconfiguration, network errors etc. More...
 
class  SavepointException
 
class  ServerConnectionError
 Connection error reported by PostgreSQL server. Doc: https://www.postgresql.org/docs/12/static/errcodes-appendix.html Class 08 - Connection exception. More...
 
class  ServerError
 Error that was reported by PosgtreSQL server Contains the message sent by the server. Templated class because the errors can be both runtime and logic. More...
 
class  SnapshotFailure
 
class  SqlRoutineException
 
class  SqlStatementNotYetComplete
 
struct  StatementMetricsSettings
 PostgreSQL statements metrics options. More...
 
class  SyntaxError
 
class  SystemError
 
struct  TopologySettings
 
class  Transaction
 PostgreSQL transaction. More...
 
class  TransactionError
 
struct  TransactionOptions
 PostgreSQL transaction options. More...
 
class  TransactionRollback
 
struct  TransactionStatistics
 Template transaction statistics storage. More...
 
class  TriggeredActionException
 
class  TriggeredDataChangeViolation
 Class 27 - Triggered Data Change Violation. More...
 
class  TypeCannotBeNull
 A value of a non-nullable type requested to be set null. Can occur if io::traits::IsNullable for the type is specialised as true_type, but io::traits::GetSetNull is not specialized appropriately. More...
 
class  TypedResultSet
 
struct  UnboundedType
 
class  UniqueViolation
 
class  UnknownBufferCategory
 While checking result set types, failed to determine the buffer category for a type oid. The context string is formed by the ResultSet and will have the form of 'result set field foo type my_schema.bar field baz array element'. More...
 
class  UnsupportedInterval
 
class  UserTypeError
 Base error when working with mapped types. More...
 
class  UserTypes
 Container for connection-specific user data types. More...
 
class  ValueIsNaN
 
class  WithCheckOptionViolation
 Class 44 - WITH CHECK OPTION Violation. More...
 

Typedefs

using ClusterHostTypeFlags = ::utils::Flags< ClusterHostType >
 
using DatabasePtr = std::shared_ptr< Database >
 
using Dsn = ::utils::NonLoggable< class DsnTag, std::string >
 
using DsnList = std::vector< Dsn >
 
template<unsigned Precision = 50>
using MultiPrecision = boost::multiprecision::number< boost::multiprecision::cpp_dec_float< Precision > >
 
using ClockType = std::chrono::system_clock
 
using TimePoint = ClockType::time_point
 Corresponds to TIMESTAMP WITHOUT TIME ZONE (value in absolute time (no TZ offset)). More...
 
using TimePointTz = ::utils::StrongTypedef< struct TimestampWithTz, TimePoint, ::utils::StrongTypedefOps::kCompareTransparent >
 Corresponds to TIMESTAMP WITH TIME ZONE (value in absolute time (no TZ offset)). Time zones are applied automatically. More...
 
using IntervalType = std::chrono::microseconds
 
using Date = ::utils::datetime::Date
 Corresponds to DATE. More...
 
using PlainJson = ::utils::StrongTypedef< struct PlainJsonTag, formats::json::Value, ::utils::StrongTypedefOps::kCompareTransparent >
 
using Oid = unsigned int
 PostgreSQL Oid type. More...
 
using RangeBounds = ::utils::Flags< RangeBound >
 
using IntegerRange = Range< Integer >
 
using BigintRange = Range< Bigint >
 
using BoundedIntegerRange = BoundedRange< Integer >
 
using BoundedBigintRange = BoundedRange< Bigint >
 
using OptionalCommandControl = std::optional< CommandControl >
 storages::postgres::CommandControl that may not be set More...
 
using CommandControlByMethodMap = std::unordered_map< std::string, CommandControl >
 
using CommandControlByHandlerMap = std::unordered_map< std::string, CommandControlByMethodMap >
 
using CommandControlByQueryMap = std::unordered_map< std::string, CommandControl >
 
using PortalName = ::utils::StrongTypedef< struct PortalNameTag, std::string >
 
using ClusterPtr = std::shared_ptr< Cluster >
 Smart pointer to the storages::postgres::Cluster. More...
 
using TimeoutDuration = std::chrono::milliseconds
 
using Percentile = ::utils::statistics::Percentile< 2048 >
 
using MinMaxAvg = ::utils::statistics::MinMaxAvg< uint32_t >
 
using InstanceStatistics = InstanceStatisticsTemplate< ::utils::statistics::RelaxedCounter< uint32_t >, ::utils::statistics::RecentPeriod< Percentile, Percentile, detail::SteadyClock >, ::utils::statistics::RecentPeriod< MinMaxAvg, MinMaxAvg, detail::SteadyClock > >
 
using InstanceStatisticsNonatomicBase = InstanceStatisticsTemplate< uint32_t, Percentile, MinMaxAvg >
 
using ClusterStatisticsPtr = std::unique_ptr< ClusterStatistics >
 
Generic driver errors
using ServerLogicError = ServerError< LogicError >
 
using ServerRuntimeError = ServerError< RuntimeError >
 

Enumerations

enum class  ClusterHostType {
  Cluster roles ,
  kNone = 0x00 ,
  kMaster = 0x01 ,
  kSyncSlave = 0x02 ,
  kSlave = 0x04 ,
  kSlaveOrMaster = kMaster | kSlave ,
  Host selection strategies ,
  kRoundRobin = 0x08 ,
  kNearest = 0x10
}
 
enum class  RangeBound {
  kNone = 0x00 ,
  kLower = 0x01 ,
  kUpper = 0x02 ,
  kBoth = kLower | kUpper
}
 
enum class  IsolationLevel {
  kReadCommitted ,
  kRepeatableRead ,
  kSerializable ,
  kReadUncommitted
}
 SQL transaction isolation level. More...
 
enum class  PipelineMode {
  kDisabled ,
  kEnabled
}
 
enum class  InitMode {
  kSync = 0 ,
  kAsync
}
 Initialization modes. More...
 
enum class  SqlStateClass : std::int64_t {
  kSuccessfulCompletion = 0x01 ,
  kWarning = 0x02 ,
  kNoData = 0x10 ,
  kSqlStatementNotYetComplete = 0x20 ,
  kConnectionException = 0x40 ,
  kTriggeredActionException = 0x80 ,
  kFeatureNotSupported = 0x100 ,
  kInvalidTransactionInitiation = 0x200 ,
  kLocatorException = 0x400 ,
  kInvalidGrantor = 0x800 ,
  kInvalidRoleSpecification = 0x1000 ,
  kDiagnosticsException = 0x2000 ,
  kCaseNotFound = 0x4000 ,
  kCardinalityViolation = 0x8000 ,
  kDataException = 0x10000 ,
  kIntegrityConstraintViolation = 0x20000 ,
  kInvalidCursorState = 0x40000 ,
  kInvalidTransactionState = 0x80000 ,
  kInvalidSqlStatementName = 0x100000 ,
  kTriggeredDataChangeViolation = 0x200000 ,
  kInvalidAuthorizationSpecification = 0x400000 ,
  kDependentPrivilegeDescriptorsStillExist = 0x800000 ,
  kInvalidTransactionTermination = 0x1000000 ,
  kSqlRoutineException = 0x2000000 ,
  kInvalidCursorName = 0x4000000 ,
  kExternalRoutineException = 0x8000000 ,
  kExternalRoutineInvocationException = 0x10000000 ,
  kSavepointException = 0x20000000 ,
  kInvalidCatalogName = 0x40000000 ,
  kInvalidSchemaName = 0x80000000 ,
  kTransactionRollback = 0x100000000 ,
  kSyntaxErrorOrAccessRuleViolation = 0x200000000 ,
  kWithCheckOptionViolation = 0x400000000 ,
  kInsufficientResources = 0x800000000 ,
  kProgramLimitExceeded = 0x1000000000 ,
  kObjectNotInPrerequisiteState = 0x2000000000 ,
  kOperatorIntervention = 0x4000000000 ,
  kSystemError = 0x8000000000 ,
  kSnapshotTooOld = 0x10000000000 ,
  kConfigFileError = 0x20000000000 ,
  kFdwError = 0x40000000000 ,
  kPlpgsqlError = 0x80000000000 ,
  kInternalError = 0x100000000000
}
 
enum class  SqlState : std::int64_t {
  kUnknownState ,
  Class 00 — Successful Completion ,
  kSuccessfulCompletion ,
  Class 01 — Warning ,
  kWarning = static_cast<std::int64_t>(SqlStateClass::kWarning) ,
  kDynamicResultSetsReturned ,
  kImplicitZeroBitPadding ,
  kNullValueEliminatedInSetFunction ,
  kPrivilegeNotGranted ,
  kPrivilegeNotRevoked ,
  kStringDataRightTruncationWarn ,
  kDeprecatedFeature ,
  Class 02 — No Data(this is also a warning class per the SQL ,
  kNoData = static_cast<std::int64_t>(SqlStateClass::kNoData) ,
  kNoAdditionalDynamicResultSetsReturned ,
  Class 03 — SQL Statement Not Yet Complete ,
  kSqlStatementNotYetComplete ,
  Class 08 — Connection Exception ,
  kConnectionException ,
  kConnectionDoesNotExist ,
  kConnectionFailure ,
  kSqlclientUnableToEstablishSqlconnection ,
  kSqlserverRejectedEstablishmentOfSqlconnection ,
  kTransactionResolutionUnknown ,
  kProtocolViolation ,
  Class 09 — Triggered Action Exception ,
  kTriggeredActionException ,
  Class 0A — Feature Not Supported ,
  kFeatureNotSupported ,
  Class 0B — Invalid Transaction Initiation ,
  kInvalidTransactionInitiation ,
  Class 0F — Locator Exception ,
  kLocatorException ,
  kInvalidLocatorSpecification ,
  Class 0L — Invalid Grantor ,
  kInvalidGrantor ,
  kInvalidGrantOperation ,
  Class 0P — Invalid Role Specification ,
  kInvalidRoleSpecification ,
  Class 0Z — Diagnostics Exception ,
  kDiagnosticsException ,
  kStackedDiagnosticsAccessedWithoutActiveHandler ,
  Class 20 — Case Not Found ,
  kCaseNotFound ,
  Class 21 — Cardinality Violation ,
  kCardinalityViolation ,
  Class 22 — Data Exception ,
  kDataException ,
  kArraySubscriptError ,
  kCharacterNotInRepertoire ,
  kDatetimeFieldOverflow ,
  kDivisionByZero ,
  kErrorInAssignment ,
  kEscapeCharacterConflict ,
  kIndicatorOverflow ,
  kIntervalFieldOverflow ,
  kInvalidArgumentForLogarithm ,
  kInvalidArgumentForNtileFunction ,
  kInvalidArgumentForNthValueFunction ,
  kInvalidArgumentForPowerFunction ,
  kInvalidArgumentForWidthBucketFunction ,
  kInvalidCharacterValueForCast ,
  kInvalidDatetimeFormat ,
  kInvalidEscapeCharacter ,
  kInvalidEscapeOctet ,
  kInvalidEscapeSequence ,
  kNonstandardUseOfEscapeCharacter ,
  kInvalidIndicatorParameterValue ,
  kInvalidParameterValue ,
  kInvalidPrecedingOrFollowingSize ,
  kInvalidRegularExpression ,
  kInvalidRowCountInLimitClause ,
  kInvalidRowCountInResultOffsetClause ,
  kInvalidTablesampleArgument ,
  kInvalidTablesampleRepeat ,
  kInvalidTimeZoneDisplacementValue ,
  kInvalidUseOfEscapeCharacter ,
  kMostSpecificTypeMismatch ,
  kNullValueNotAllowed ,
  kNullValueNoIndicatorParameter ,
  kNumericValueOutOfRange ,
  kSequenceGeneratorLimitExceeded ,
  kStringDataLengthMismatch ,
  kStringDataRightTruncation ,
  kSubstringError ,
  kTrimError ,
  kUnterminatedCString ,
  kZeroLengthCharacterString ,
  kFloatingPointException ,
  kInvalidTextRepresentation ,
  kInvalidBinaryRepresentation ,
  kBadCopyFileFormat ,
  kUntranslatableCharacter ,
  kNotAnXmlDocument ,
  kInvalidXmlDocument ,
  kInvalidXmlContent ,
  kInvalidXmlComment ,
  kInvalidXmlProcessingInstruction ,
  kDuplicateJsonObjectKeyValue ,
  kInvalidJsonText ,
  kInvalidSqlJsonSubscript ,
  kMoreThanOneSqlJsonItem ,
  kNoSqlJsonItem ,
  kNonNumericSqlJsonItem ,
  kNonUniqueKeysInAJsonObject ,
  kSingletonSqlJsonItemRequired ,
  kSqlJsonArrayNotFound ,
  kSqlJsonMemberNotFound ,
  kSqlJsonNumberNotFound ,
  kSqlJsonObjectNotFound ,
  kTooManyJsonArrayElements ,
  kTooManyJsonObjectMembers ,
  kSqlJsonScalarRequired ,
  Class 23 — Integrity Constraint Violation ,
  kIntegrityConstraintViolation ,
  kRestrictViolation ,
  kNotNullViolation ,
  kForeignKeyViolation ,
  kUniqueViolation ,
  kCheckViolation ,
  kExclusionViolation ,
  Class 24 — Invalid Cursor State ,
  kInvalidCursorState ,
  Class 25 — Invalid Transaction State ,
  kInvalidTransactionState ,
  kActiveSqlTransaction ,
  kBranchTransactionAlreadyActive ,
  kHeldCursorRequiresSameIsolationLevel ,
  kInappropriateAccessModeForBranchTransaction ,
  kInappropriateIsolationLevelForBranchTransaction ,
  kNoActiveSqlTransactionForBranchTransaction ,
  kReadOnlySqlTransaction ,
  kSchemaAndDataStatementMixingNotSupported ,
  kNoActiveSqlTransaction ,
  kInFailedSqlTransaction ,
  kIdleInTransactionSessionTimeout ,
  Class 26 — Invalid SQL Statement Name ,
  kInvalidSqlStatementName ,
  Class 27 — Triggered Data Change Violation ,
  kTriggeredDataChangeViolation ,
  Class 28 — Invalid Authorization Specification ,
  kInvalidAuthorizationSpecification ,
  kInvalidPassword ,
  Class 2B — Dependent Privilege Descriptors Still Exist ,
  kDependentPrivilegeDescriptorsStillExist ,
  kDependentObjectsStillExist ,
  Class 2D — Invalid Transaction Termination ,
  kInvalidTransactionTermination ,
  Class 2F — SQL Routine Exception ,
  kSqlRoutineException ,
  kFunctionExecutedNoReturnStatement ,
  kModifyingSqlDataNotPermitted ,
  kProhibitedSqlStatementAttempted ,
  kReadingSqlDataNotPermitted ,
  Class 34 — Invalid Cursor Name ,
  kInvalidCursorName ,
  Class 38 — External Routine Exception ,
  kExternalRoutineException ,
  kContainingSqlNotPermitted ,
  kModifyingSqlDataNotPermittedEx ,
  kProhibitedSqlStatementAttemptedEx ,
  kReadingSqlDataNotPermittedEx ,
  Class 39 — External Routine Invocation Exception ,
  kExternalRoutineInvocationException ,
  kInvalidSqlstateReturned ,
  kNullValueNotAllowedEx ,
  kTriggerProtocolViolated ,
  kSrfProtocolViolated ,
  kEventTriggerProtocolViolated ,
  Class 3B — Savepoint Exception ,
  kSavepointException ,
  kInvalidSavepointSpecification ,
  Class 3D — Invalid Catalog Name ,
  kInvalidCatalogName ,
  Class 3F — Invalid Schema Name ,
  kInvalidSchemaName ,
  Class 40 — Transaction Rollback ,
  kTransactionRollback ,
  kTransactionIntegrityConstraintViolation ,
  kSerializationFailure ,
  kStatementCompletionUnknown ,
  kDeadlockDetected ,
  Class 42 — Syntax Error or Access Rule Violation ,
  kSyntaxErrorOrAccessRuleViolation ,
  kSyntaxError ,
  kInsufficientPrivilege ,
  kCannotCoerce ,
  kGroupingError ,
  kWindowingError ,
  kInvalidRecursion ,
  kInvalidForeignKey ,
  kInvalidName ,
  kNameTooLong ,
  kReservedName ,
  kDatatypeMismatch ,
  kIndeterminateDatatype ,
  kCollationMismatch ,
  kIndeterminateCollation ,
  kWrongObjectType ,
  kGeneratedAlways ,
  kUndefinedColumn ,
  kUndefinedFunction ,
  kUndefinedTable ,
  kUndefinedParameter ,
  kUndefinedObject ,
  kDuplicateColumn ,
  kDuplicateCursor ,
  kDuplicateDatabase ,
  kDuplicateFunction ,
  kDuplicatePreparedStatement ,
  kDuplicateSchema ,
  kDuplicateTable ,
  kDuplicateAlias ,
  kDuplicateObject ,
  kAmbiguousColumn ,
  kAmbiguousFunction ,
  kAmbiguousParameter ,
  kAmbiguousAlias ,
  kInvalidColumnReference ,
  kInvalidColumnDefinition ,
  kInvalidCursorDefinition ,
  kInvalidDatabaseDefinition ,
  kInvalidFunctionDefinition ,
  kInvalidPreparedStatementDefinition ,
  kInvalidSchemaDefinition ,
  kInvalidTableDefinition ,
  kInvalidObjectDefinition ,
  Class 44 — WITH CHECK OPTION Violation ,
  kWithCheckOptionViolation ,
  Class 53 — Insufficient Resources ,
  kInsufficientResources ,
  kDiskFull ,
  kOutOfMemory ,
  kTooManyConnections ,
  kConfigurationLimitExceeded ,
  Class 54 — Program Limit Exceeded ,
  kProgramLimitExceeded ,
  kStatementTooComplex ,
  kTooManyColumns ,
  kTooManyArguments ,
  Class 55 — Object Not In Prerequisite State ,
  kObjectNotInPrerequisiteState ,
  kObjectInUse ,
  kCantChangeRuntimeParam ,
  kLockNotAvailable ,
  kUnsafeNewEnumValueUsage ,
  Class 57 — Operator Intervention ,
  kOperatorIntervention ,
  kQueryCancelled ,
  kAdminShutdown ,
  kCrashShutdown ,
  kCannotConnectNow ,
  kDatabaseDropped ,
  Class 58 — System Error(errors external to Postgres itself) ,
  kSystemError ,
  kIoError ,
  kUndefinedFile ,
  kDuplicateFile ,
  Class 72 — Snapshot Failure ,
  kSnapshotTooOld ,
  Class F0 — Configuration File Error ,
  kConfigFileError ,
  kLockFileExists ,
  Class HV — Foreign Data Wrapper Error(SQL/MED) ,
  kFdwError = static_cast<std::int64_t>(SqlStateClass::kFdwError) ,
  kFdwColumnNameNotFound ,
  kFdwDynamicParameterValueNeeded ,
  kFdwFunctionSequenceError ,
  kFdwInconsistentDescriptorInformation ,
  kFdwInvalidAttributeValue ,
  kFdwInvalidColumnName ,
  kFdwInvalidColumnNumber ,
  kFdwInvalidDataType ,
  kFdwInvalidDataTypeDescriptors ,
  kFdwInvalidDescriptorFieldIdentifier ,
  kFdwInvalidHandle ,
  kFdwInvalidOptionIndex ,
  kFdwInvalidOptionName ,
  kFdwInvalidStringLengthOrBufferLength ,
  kFdwInvalidStringFormat ,
  kFdwInvalidUseOfNullPointer ,
  kFdwTooManyHandles ,
  kFdwOutOfMemory ,
  kFdwNoSchemas ,
  kFdwOptionNameNotFound ,
  kFdwReplyHandle ,
  kFdwSchemaNotFound ,
  kFdwTableNotFound ,
  kFdwUnableToCreateExecution ,
  kFdwUnableToCreateReply ,
  kFdwUnableToEstablishConnection ,
  Class P0 — PL/pgSQL Error ,
  kPlpgsqlError ,
  kRaiseException ,
  kNoDataFound ,
  kTooManyRows ,
  kAssertFailure ,
  Class XX — Internal Error ,
  kInternalError ,
  kDataCorrupted ,
  kIndexCorrupted
}
 

Functions

std::string ToString (ClusterHostType)
 
std::string ToString (ClusterHostTypeFlags)
 
logging::LogHelperoperator<< (logging::LogHelper &, ClusterHostType)
 
logging::LogHelperoperator<< (logging::LogHelper &, ClusterHostTypeFlags)
 
DsnList SplitByHost (const Dsn &dsn)
 
std::string MakeDsnNick (const Dsn &dsn, bool escape)
 
DsnOptions OptionsFromDsn (const Dsn &dsn)
 
std::string GetHostPort (const Dsn &dsn)
 Return <host>[:<port>] string for a single-host DSN.
 
std::string DsnCutPassword (const Dsn &dsn)
 Return DSN string without 'password' field.
 
std::string DsnMaskPassword (const Dsn &dsn)
 Return DSN string with password contents masked.
 
std::string EscapeHostName (const std::string &hostname, char escape_char='_')
 
Dsn ResolveDsnHostaddrs (const Dsn &dsn, clients::dns::Resolver &resolver, engine::Deadline deadline)
 
template<typename ByteContainer >
detail::ByteaRefWrapper< const ByteContainer & > Bytea (const ByteContainer &bytes)
 Helper function for writing binary data. More...
 
template<typename ByteContainer >
detail::ByteaRefWrapper< ByteContainer & > Bytea (ByteContainer &bytes)
 Helper function for reading binary data. More...
 
TimePoint PostgresEpochTimePoint ()
 Postgres epoch timestamp (2000-01-01 00:00 UTC)
 
Date PostgresEpochDate ()
 Postgres epoch date (2000-01-01)
 
template<typename T >
auto MakeRange (T &&lower, T &&upper, RangeBounds bounds=RangeBound::kLower)
 
template<typename T >
auto MakeRange (T &&lower, UnboundedType, RangeBounds bounds=RangeBound::kLower)
 
template<typename T >
auto MakeRange (UnboundedType, T &&upper, RangeBounds bounds=RangeBound::kNone)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const Range< T > &val)
 
template<typename T >
std::ostream & operator<< (std::ostream &os, const BoundedRange< T > &val)
 
void LogRegisteredTypesOnce ()
 
std::ostream & operator<< (std::ostream &, IsolationLevel)
 
constexpr bool operator== (const TransactionOptions &lhs, const TransactionOptions &rhs)
 
const std::string & BeginStatement (const TransactionOptions &)
 
OptionalCommandControl GetHandlerOptionalCommandControl (const CommandControlByHandlerMap &map, const std::string &path, const std::string &method)
 
OptionalCommandControl GetQueryOptionalCommandControl (const CommandControlByQueryMap &map, const std::string &query_name)
 
SqlStateClass GetSqlStateClass (SqlState)
 
SqlState SqlStateFromString (std::string_view)
 
bool IsWhitelistedState (SqlState)
 

Variables

constexpr ClusterHostTypeFlags kClusterHostRolesMask
 
constexpr ClusterHostTypeFlags kClusterHostStrategyMask
 
constexpr TimePoint kTimestampPositiveInfinity = TimePoint::max()
 
constexpr TimePoint kTimestampNegativeInfinity = TimePoint::min()
 
constexpr Date kDatePositiveInfinity = Date::SysDays::max()
 
constexpr Date kDateNegativeInfinity = Date::SysDays::min()
 
constexpr Oid kInvalidOid = 0
 
constexpr UnboundedType kUnbounded {}
 
constexpr RowTag kRowTag
 
constexpr FieldTag kFieldTag
 
template<typename T >
constexpr Null< T > null {}
 Template variable to use with query parameters. More...
 
static constexpr size_t kDefaultPoolMinSize = 4
 Default initial pool connection count. More...
 
static constexpr size_t kDefaultPoolMaxSize = 15
 Default pool connections limit. More...
 
static constexpr size_t kDefaultPoolMaxQueueSize = 200
 Default size of queue for clients waiting for connections. More...
 
static constexpr size_t kDefaultConnectingLimit = 0
 Default limit for concurrent establishing connections number. More...
 
static constexpr size_t kDefaultMaxPreparedCacheSize = 5000
 Default size limit for prepared statements cache. More...
 

Type aliases for integral types

using Smallint = std::int16_t
 
using Integer = std::int32_t
 
using Bigint = std::int64_t
 
using Float4 = float
 
using Float8 = double
 
std::string ToString (DBTypeDescription::TypeClass)
 

Detailed Description

Top namespace for uPg driver.

For more information see uPg Driver

Typedef Documentation

◆ Bigint

using storages::postgres::Bigint = typedef std::int64_t

Definition at line 25 of file pg_types.hpp.

◆ BigintRange

using storages::postgres::BigintRange = typedef Range<Bigint>

Definition at line 297 of file range_types.hpp.

◆ BoundedBigintRange

Definition at line 333 of file range_types.hpp.

◆ BoundedIntegerRange

Definition at line 332 of file range_types.hpp.

◆ ClockType

using storages::postgres::ClockType = typedef std::chrono::system_clock

Definition at line 21 of file chrono.hpp.

◆ ClusterHostTypeFlags

Definition at line 50 of file cluster_types.hpp.

◆ ClusterPtr

using storages::postgres::ClusterPtr = typedef std::shared_ptr<Cluster>

Smart pointer to the storages::postgres::Cluster.

Definition at line 21 of file postgres_fwd.hpp.

◆ ClusterStatisticsPtr

using storages::postgres::ClusterStatisticsPtr = typedef std::unique_ptr<ClusterStatistics>

Definition at line 228 of file statistics.hpp.

◆ CommandControlByHandlerMap

using storages::postgres::CommandControlByHandlerMap = typedef std::unordered_map<std::string, CommandControlByMethodMap>

Definition at line 140 of file options.hpp.

◆ CommandControlByMethodMap

using storages::postgres::CommandControlByMethodMap = typedef std::unordered_map<std::string, CommandControl>

Definition at line 138 of file options.hpp.

◆ CommandControlByQueryMap

using storages::postgres::CommandControlByQueryMap = typedef std::unordered_map<std::string, CommandControl>

Definition at line 142 of file options.hpp.

◆ DatabasePtr

using storages::postgres::DatabasePtr = typedef std::shared_ptr<Database>

Definition at line 13 of file database_fwd.hpp.

◆ Date

Corresponds to DATE.

Definition at line 19 of file date.hpp.

◆ Dsn

using storages::postgres::Dsn = typedef ::utils::NonLoggable<class DsnTag, std::string>

Definition at line 17 of file dsn.hpp.

◆ DsnList

using storages::postgres::DsnList = typedef std::vector<Dsn>

Definition at line 18 of file dsn.hpp.

◆ Float4

using storages::postgres::Float4 = typedef float

Definition at line 29 of file pg_types.hpp.

◆ Float8

using storages::postgres::Float8 = typedef double

Definition at line 30 of file pg_types.hpp.

◆ InstanceStatistics

Definition at line 123 of file statistics.hpp.

◆ InstanceStatisticsNonatomicBase

Definition at line 130 of file statistics.hpp.

◆ Integer

using storages::postgres::Integer = typedef std::int32_t

Definition at line 24 of file pg_types.hpp.

◆ IntegerRange

using storages::postgres::IntegerRange = typedef Range<Integer>

Definition at line 296 of file range_types.hpp.

◆ IntervalType

using storages::postgres::IntervalType = typedef std::chrono::microseconds

Definition at line 32 of file chrono.hpp.

◆ MinMaxAvg

Definition at line 122 of file statistics.hpp.

◆ MultiPrecision

template<unsigned Precision = 50>
using storages::postgres::MultiPrecision = typedef boost::multiprecision::number< boost::multiprecision::cpp_dec_float<Precision> >

Definition at line 19 of file boost_multiprecision.hpp.

◆ Oid

using storages::postgres::Oid = typedef unsigned int

PostgreSQL Oid type.

Definition at line 18 of file pg_types.hpp.

◆ OptionalCommandControl

storages::postgres::CommandControl that may not be set

Definition at line 136 of file options.hpp.

◆ Percentile

Definition at line 121 of file statistics.hpp.

◆ PlainJson

Definition at line 24 of file json_types.hpp.

◆ PortalName

using storages::postgres::PortalName = typedef ::utils::StrongTypedef<struct PortalNameTag, std::string>

Definition at line 22 of file portal.hpp.

◆ RangeBounds

using storages::postgres::RangeBounds = typedef ::utils::Flags<RangeBound>

Definition at line 103 of file range_types.hpp.

◆ ServerLogicError

Definition at line 203 of file exceptions.hpp.

◆ ServerRuntimeError

Definition at line 204 of file exceptions.hpp.

◆ Smallint

using storages::postgres::Smallint = typedef std::int16_t

Definition at line 23 of file pg_types.hpp.

◆ TimeoutDuration

using storages::postgres::TimeoutDuration = typedef std::chrono::milliseconds

Definition at line 33 of file postgres_fwd.hpp.

◆ TimePoint

using storages::postgres::TimePoint = typedef ClockType::time_point

Corresponds to TIMESTAMP WITHOUT TIME ZONE (value in absolute time (no TZ offset)).

Definition at line 25 of file chrono.hpp.

◆ TimePointTz

Corresponds to TIMESTAMP WITH TIME ZONE (value in absolute time (no TZ offset)). Time zones are applied automatically.

Definition at line 29 of file chrono.hpp.

Enumeration Type Documentation

◆ ClusterHostType

Enumerator
kMaster 

Connect to cluster's master. Only this connection may be used for read-write transactions.

kSyncSlave 

Connect to cluster's sync slave. May fallback to master. Can be used only for read only transactions.

Warning
Not available for clusters with quorum commit, prefer kSlave or kMaster.
kSlave 

Connect to one of cluster's slaves. May fallback to master. Can be used only for read only transactions.

kSlaveOrMaster 

Connect to either a master or to a slave, whatever the host selection strategy chooses. Can be used only for read only transactions.

kRoundRobin 

Chooses a host using the round-robin algorithm.

kNearest 

Chooses a host with the lowest RTT.

Definition at line 18 of file cluster_types.hpp.

◆ InitMode

enum class storages::postgres::InitMode
strong

Initialization modes.

Definition at line 265 of file options.hpp.

◆ IsolationLevel

SQL transaction isolation level.

[Isolation levels]

See also
https://www.postgresql.org/docs/current/static/sql-set-transaction.html
Enumerator
kReadCommitted 

READ COMMITTED.

kRepeatableRead 

REPEATABLE READ.

kSerializable 

SERIALIZABLE.

kReadUncommitted 

READ UNCOMMITTED

Warning
In Postgres READ UNCOMMITTED is treated as READ COMMITTED

Definition at line 21 of file options.hpp.

◆ PipelineMode

Pipeline mode configuration

Dynamic option POSTGRES_CONNECTION_PIPELINE_ENABLED

Definition at line 197 of file options.hpp.

◆ RangeBound

enum class storages::postgres::RangeBound
strong

Definition at line 96 of file range_types.hpp.

◆ SqlState

enum class storages::postgres::SqlState : std::int64_t
strong

PostgreSQL error codes Docs: https://www.postgresql.org/docs/12/static/errcodes-appendix.html Enumeration was generated by userver/scripts/postgres/pg_sql_codes.py

Enumerator
kSuccessfulCompletion 

00000

kWarning 

01000

kDynamicResultSetsReturned 

0100C

kImplicitZeroBitPadding 

01008

kNullValueEliminatedInSetFunction 

01003

kPrivilegeNotGranted 

01007

kPrivilegeNotRevoked 

01006

kStringDataRightTruncationWarn 

01004

kDeprecatedFeature 

01P01

kNoData 

02000

kNoAdditionalDynamicResultSetsReturned 

02001

kSqlStatementNotYetComplete 

03000

kConnectionException 

08000

kConnectionDoesNotExist 

08003

kConnectionFailure 

08006

kSqlclientUnableToEstablishSqlconnection 

08001

kSqlserverRejectedEstablishmentOfSqlconnection 

08004

kTransactionResolutionUnknown 

08007

kProtocolViolation 

08P01

kTriggeredActionException 

09000

kFeatureNotSupported 

0A000

kInvalidTransactionInitiation 

0B000

kLocatorException 

0F000

kInvalidLocatorSpecification 

0F001

kInvalidGrantor 

0L000

kInvalidGrantOperation 

0LP01

kInvalidRoleSpecification 

0P000

kDiagnosticsException 

0Z000

kStackedDiagnosticsAccessedWithoutActiveHandler 

0Z002

kCaseNotFound 

20000

kCardinalityViolation 

21000

kDataException 

22000

kArraySubscriptError 

2202E

kCharacterNotInRepertoire 

22021

kDatetimeFieldOverflow 

22008

kDivisionByZero 

22012

kErrorInAssignment 

22005

kEscapeCharacterConflict 

2200B

kIndicatorOverflow 

22022

kIntervalFieldOverflow 

22015

kInvalidArgumentForLogarithm 

2201E

kInvalidArgumentForNtileFunction 

22014

kInvalidArgumentForNthValueFunction 

22016

kInvalidArgumentForPowerFunction 

2201F

kInvalidArgumentForWidthBucketFunction 

2201G

kInvalidCharacterValueForCast 

22018

kInvalidDatetimeFormat 

22007

kInvalidEscapeCharacter 

22019

kInvalidEscapeOctet 

2200D

kInvalidEscapeSequence 

22025

kNonstandardUseOfEscapeCharacter 

22P06

kInvalidIndicatorParameterValue 

22010

kInvalidParameterValue 

22023

kInvalidPrecedingOrFollowingSize 

22013

kInvalidRegularExpression 

2201B

kInvalidRowCountInLimitClause 

2201W

kInvalidRowCountInResultOffsetClause 

2201X

kInvalidTablesampleArgument 

2202H

kInvalidTablesampleRepeat 

2202G

kInvalidTimeZoneDisplacementValue 

22009

kInvalidUseOfEscapeCharacter 

2200C

kMostSpecificTypeMismatch 

2200G

kNullValueNotAllowed 

22004

kNullValueNoIndicatorParameter 

22002

kNumericValueOutOfRange 

22003

kSequenceGeneratorLimitExceeded 

2200H

kStringDataLengthMismatch 

22026

kStringDataRightTruncation 

22001

kSubstringError 

22011

kTrimError 

22027

kUnterminatedCString 

22024

kZeroLengthCharacterString 

2200F

kFloatingPointException 

22P01

kInvalidTextRepresentation 

22P02

kInvalidBinaryRepresentation 

22P03

kBadCopyFileFormat 

22P04

kUntranslatableCharacter 

22P05

kNotAnXmlDocument 

2200L

kInvalidXmlDocument 

2200M

kInvalidXmlContent 

2200N

kInvalidXmlComment 

2200S

kInvalidXmlProcessingInstruction 

2200T

kDuplicateJsonObjectKeyValue 

22030

kInvalidJsonText 

22032

kInvalidSqlJsonSubscript 

22033

kMoreThanOneSqlJsonItem 

22034

kNoSqlJsonItem 

22035

kNonNumericSqlJsonItem 

22036

kNonUniqueKeysInAJsonObject 

22037

kSingletonSqlJsonItemRequired 

22038

kSqlJsonArrayNotFound 

22039

kSqlJsonMemberNotFound 

2203A

kSqlJsonNumberNotFound 

2203B

kSqlJsonObjectNotFound 

2203C

kTooManyJsonArrayElements 

2203D

kTooManyJsonObjectMembers 

2203E

kSqlJsonScalarRequired 

2203F

kIntegrityConstraintViolation 

23000

kRestrictViolation 

23001

kNotNullViolation 

23502

kForeignKeyViolation 

23503

kUniqueViolation 

23505

kCheckViolation 

23514

kExclusionViolation 

23P01

kInvalidCursorState 

24000

kInvalidTransactionState 

25000

kActiveSqlTransaction 

25001

kBranchTransactionAlreadyActive 

25002

kHeldCursorRequiresSameIsolationLevel 

25008

kInappropriateAccessModeForBranchTransaction 

25003

kInappropriateIsolationLevelForBranchTransaction 

25004

kNoActiveSqlTransactionForBranchTransaction 

25005

kReadOnlySqlTransaction 

25006

kSchemaAndDataStatementMixingNotSupported 

25007

kNoActiveSqlTransaction 

25P01

kInFailedSqlTransaction 

25P02

kIdleInTransactionSessionTimeout 

25P03

kInvalidSqlStatementName 

26000

kTriggeredDataChangeViolation 

27000

kInvalidAuthorizationSpecification 

28000

kInvalidPassword 

28P01

kDependentPrivilegeDescriptorsStillExist 

2B000

kDependentObjectsStillExist 

2BP01

kInvalidTransactionTermination 

2D000

kSqlRoutineException 

2F000

kFunctionExecutedNoReturnStatement 

2F005

kModifyingSqlDataNotPermitted 

2F002

kProhibitedSqlStatementAttempted 

2F003

kReadingSqlDataNotPermitted 

2F004

kInvalidCursorName 

34000

kExternalRoutineException 

38000

kContainingSqlNotPermitted 

38001

kModifyingSqlDataNotPermittedEx 

38002

kProhibitedSqlStatementAttemptedEx 

38003

kReadingSqlDataNotPermittedEx 

38004

kExternalRoutineInvocationException 

39000

kInvalidSqlstateReturned 

39001

kNullValueNotAllowedEx 

39004

kTriggerProtocolViolated 

39P01

kSrfProtocolViolated 

39P02

kEventTriggerProtocolViolated 

39P03

kSavepointException 

3B000

kInvalidSavepointSpecification 

3B001

kInvalidCatalogName 

3D000

kInvalidSchemaName 

3F000

kTransactionRollback 

40000

kTransactionIntegrityConstraintViolation 

40002

kSerializationFailure 

40001

kStatementCompletionUnknown 

40003

kDeadlockDetected 

40P01

kSyntaxErrorOrAccessRuleViolation 

42000

kSyntaxError 

42601

kInsufficientPrivilege 

42501

kCannotCoerce 

42846

kGroupingError 

42803

kWindowingError 

42P20

kInvalidRecursion 

42P19

kInvalidForeignKey 

42830

kInvalidName 

42602

kNameTooLong 

42622

kReservedName 

42939

kDatatypeMismatch 

42804

kIndeterminateDatatype 

42P18

kCollationMismatch 

42P21

kIndeterminateCollation 

42P22

kWrongObjectType 

42809

kGeneratedAlways 

428C9

kUndefinedColumn 

42703

kUndefinedFunction 

42883

kUndefinedTable 

42P01

kUndefinedParameter 

42P02

kUndefinedObject 

42704

kDuplicateColumn 

42701

kDuplicateCursor 

42P03

kDuplicateDatabase 

42P04

kDuplicateFunction 

42723

kDuplicatePreparedStatement 

42P05

kDuplicateSchema 

42P06

kDuplicateTable 

42P07

kDuplicateAlias 

42712

kDuplicateObject 

42710

kAmbiguousColumn 

42702

kAmbiguousFunction 

42725

kAmbiguousParameter 

42P08

kAmbiguousAlias 

42P09

kInvalidColumnReference 

42P10

kInvalidColumnDefinition 

42611

kInvalidCursorDefinition 

42P11

kInvalidDatabaseDefinition 

42P12

kInvalidFunctionDefinition 

42P13

kInvalidPreparedStatementDefinition 

42P14

kInvalidSchemaDefinition 

42P15

kInvalidTableDefinition 

42P16

kInvalidObjectDefinition 

42P17

kWithCheckOptionViolation 

44000

kInsufficientResources 

53000

kDiskFull 

53100

kOutOfMemory 

53200

kTooManyConnections 

53300

kConfigurationLimitExceeded 

53400

kProgramLimitExceeded 

54000

kStatementTooComplex 

54001

kTooManyColumns 

54011

kTooManyArguments 

54023

kObjectNotInPrerequisiteState 

55000

kObjectInUse 

55006

kCantChangeRuntimeParam 

55P02

kLockNotAvailable 

55P03

kUnsafeNewEnumValueUsage 

55P04

kOperatorIntervention 

57000

kQueryCancelled 

57014

kAdminShutdown 

57P01

kCrashShutdown 

57P02

kCannotConnectNow 

57P03

kDatabaseDropped 

57P04

kSystemError 

58000

kIoError 

58030

kUndefinedFile 

58P01

kDuplicateFile 

58P02

kSnapshotTooOld 

72000

kConfigFileError 

F0000.

kLockFileExists 

F0001.

kFdwError 

HV000.

kFdwColumnNameNotFound 

HV005.

kFdwDynamicParameterValueNeeded 

HV002.

kFdwFunctionSequenceError 

HV010.

kFdwInconsistentDescriptorInformation 

HV021.

kFdwInvalidAttributeValue 

HV024.

kFdwInvalidColumnName 

HV007.

kFdwInvalidColumnNumber 

HV008.

kFdwInvalidDataType 

HV004.

kFdwInvalidDataTypeDescriptors 

HV006.

kFdwInvalidDescriptorFieldIdentifier 

HV091.

kFdwInvalidHandle 

HV00B.

kFdwInvalidOptionIndex 

HV00C.

kFdwInvalidOptionName 

HV00D.

kFdwInvalidStringLengthOrBufferLength 

HV090.

kFdwInvalidStringFormat 

HV00A.

kFdwInvalidUseOfNullPointer 

HV009.

kFdwTooManyHandles 

HV014.

kFdwOutOfMemory 

HV001.

kFdwNoSchemas 

HV00P.

kFdwOptionNameNotFound 

HV00J.

kFdwReplyHandle 

HV00K.

kFdwSchemaNotFound 

HV00Q.

kFdwTableNotFound 

HV00R.

kFdwUnableToCreateExecution 

HV00L.

kFdwUnableToCreateReply 

HV00M.

kFdwUnableToEstablishConnection 

HV00N.

kPlpgsqlError 

P0000.

kRaiseException 

P0001.

kNoDataFound 

P0002.

kTooManyRows 

P0003.

kAssertFailure 

P0004.

kInternalError 

XX000.

kDataCorrupted 

XX001.

kIndexCorrupted 

XX002.

Definition at line 65 of file sql_state.hpp.

◆ SqlStateClass

enum class storages::postgres::SqlStateClass : std::int64_t
strong

Docs: https://www.postgresql.org/docs/12/static/errcodes-appendix.html Enumeration was generated by userver/scripts/postgres/pg_sql_codes.py

Definition at line 16 of file sql_state.hpp.

Function Documentation

◆ Bytea() [1/2]

template<typename ByteContainer >
detail::ByteaRefWrapper< ByteContainer & > storages::postgres::Bytea ( ByteContainer &  bytes)

Helper function for reading binary data.

Definition at line 95 of file bytea.hpp.

◆ Bytea() [2/2]

template<typename ByteContainer >
detail::ByteaRefWrapper< const ByteContainer & > storages::postgres::Bytea ( const ByteContainer &  bytes)

Helper function for writing binary data.

Definition at line 88 of file bytea.hpp.

◆ MakeDsnNick()

std::string storages::postgres::MakeDsnNick ( const Dsn dsn,
bool  escape 
)

Create a string <user>@<host>:<port>/<dbname> of a single-host DSN or escape all the punctuation with _ for test

◆ MakeRange() [1/3]

template<typename T >
auto storages::postgres::MakeRange ( T &&  lower,
T &&  upper,
RangeBounds  bounds = RangeBound::kLower 
)

Definition at line 276 of file range_types.hpp.

◆ MakeRange() [2/3]

template<typename T >
auto storages::postgres::MakeRange ( T &&  lower,
UnboundedType  ,
RangeBounds  bounds = RangeBound::kLower 
)

Definition at line 283 of file range_types.hpp.

◆ MakeRange() [3/3]

template<typename T >
auto storages::postgres::MakeRange ( UnboundedType  ,
T &&  upper,
RangeBounds  bounds = RangeBound::kNone 
)

Definition at line 290 of file range_types.hpp.

◆ operator<<() [1/3]

std::ostream & storages::postgres::operator<< ( std::ostream &  ,
IsolationLevel   
)

[Isolation levels]

◆ operator<<() [2/3]

template<typename T >
std::ostream & storages::postgres::operator<< ( std::ostream &  os,
const BoundedRange< T > &  val 
)

Definition at line 651 of file range_types.hpp.

◆ operator<<() [3/3]

template<typename T >
std::ostream & storages::postgres::operator<< ( std::ostream &  os,
const Range< T > &  val 
)

Definition at line 562 of file range_types.hpp.

◆ operator==()

constexpr bool storages::postgres::operator== ( const TransactionOptions lhs,
const TransactionOptions rhs 
)
inlineconstexpr

Definition at line 77 of file options.hpp.

◆ OptionsFromDsn()

DsnOptions storages::postgres::OptionsFromDsn ( const Dsn dsn)

Read options from a DSN First unique option is used if found, otherwise default is taken

◆ ResolveDsnHostaddrs()

Dsn storages::postgres::ResolveDsnHostaddrs ( const Dsn dsn,
clients::dns::Resolver resolver,
engine::Deadline  deadline 
)

Return DSN string with hosts resolved as hostaddr values If given DSN has no host or already contains hostaddr, does nothing

Variable Documentation

◆ kClusterHostRolesMask

constexpr ClusterHostTypeFlags storages::postgres::kClusterHostRolesMask
constexpr
Initial value:
{
ClusterHostType::kMaster, ClusterHostType::kSyncSlave,
ClusterHostType::kSlave}

Definition at line 52 of file cluster_types.hpp.

◆ kClusterHostStrategyMask

constexpr ClusterHostTypeFlags storages::postgres::kClusterHostStrategyMask
constexpr
Initial value:
{
ClusterHostType::kRoundRobin, ClusterHostType::kNearest}

Definition at line 56 of file cluster_types.hpp.

◆ kDateNegativeInfinity

constexpr Date storages::postgres::kDateNegativeInfinity = Date::SysDays::min()
inlineconstexpr

Constant equivalent to PostgreSQL '-infinity'::date, a date that is earlier than all other dates. https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-SPECIAL-TABLE

Definition at line 32 of file date.hpp.

◆ kDatePositiveInfinity

constexpr Date storages::postgres::kDatePositiveInfinity = Date::SysDays::max()
inlineconstexpr

Constant equivalent to PostgreSQL 'infinity'::date, a date that is later than all other dates. https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-SPECIAL-TABLE

Definition at line 27 of file date.hpp.

◆ kDefaultConnectingLimit

constexpr size_t storages::postgres::kDefaultConnectingLimit = 0
staticconstexpr

Default limit for concurrent establishing connections number.

Definition at line 166 of file options.hpp.

◆ kDefaultMaxPreparedCacheSize

constexpr size_t storages::postgres::kDefaultMaxPreparedCacheSize = 5000
staticconstexpr

Default size limit for prepared statements cache.

Definition at line 192 of file options.hpp.

◆ kDefaultPoolMaxQueueSize

constexpr size_t storages::postgres::kDefaultPoolMaxQueueSize = 200
staticconstexpr

Default size of queue for clients waiting for connections.

Definition at line 163 of file options.hpp.

◆ kDefaultPoolMaxSize

constexpr size_t storages::postgres::kDefaultPoolMaxSize = 15
staticconstexpr

Default pool connections limit.

Definition at line 160 of file options.hpp.

◆ kDefaultPoolMinSize

constexpr size_t storages::postgres::kDefaultPoolMinSize = 4
staticconstexpr

Default initial pool connection count.

Definition at line 157 of file options.hpp.

◆ kFieldTag

constexpr FieldTag storages::postgres::kFieldTag
constexpr

Definition at line 28 of file row_types.hpp.

◆ kInvalidOid

constexpr Oid storages::postgres::kInvalidOid = 0
inlineconstexpr

Definition at line 19 of file pg_types.hpp.

◆ kRowTag

constexpr RowTag storages::postgres::kRowTag
constexpr

Definition at line 27 of file row_types.hpp.

◆ kTimestampNegativeInfinity

constexpr TimePoint storages::postgres::kTimestampNegativeInfinity = TimePoint::min()
inlineconstexpr

Constant equivalent to PostgreSQL '-infinity'::timestamp, a time point that is earlier than all other time points https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-SPECIAL-TABLE

Definition at line 44 of file chrono.hpp.

◆ kTimestampPositiveInfinity

constexpr TimePoint storages::postgres::kTimestampPositiveInfinity = TimePoint::max()
inlineconstexpr

Constant equivalent to PostgreSQL 'infinity'::timestamp, a time point that is later than all other time points https://www.postgresql.org/docs/current/datatype-datetime.html#DATATYPE-DATETIME-SPECIAL-TABLE

Definition at line 40 of file chrono.hpp.

◆ kUnbounded

constexpr UnboundedType storages::postgres::kUnbounded {}
constexpr

Definition at line 94 of file range_types.hpp.

◆ null

template<typename T >
constexpr Null<T> storages::postgres::null {}
inlineconstexpr

Template variable to use with query parameters.

trx->Execute("update a_table set val = $1 where val = $2", null<int>, 0)

Definition at line 23 of file null.hpp.