Documentation ¶
Index ¶
Constants ¶
View Source
const ( // SystemDatabaseName represents a system database name. SystemDatabaseName = "postgres" // SystemSchemaName represents a system schema name. SystemSchemaName = "pg_catalog" // SystemInformationSchema represents a system information schema name. SystemInformationSchema = "information_schema" )
View Source
const ( InformationSchemaColumnsTableCatalog = "table_catalog" InformationSchemaColumnsTableSchema = "table_schema" InformationSchemaColumnsTableName = "table_name" InformationSchemaColumnsColumnName = "column_name" InformationSchemaColumnsOrdinalPosition = "ordinal_position" InformationSchemaColumnsColumnDefault = "column_default" InformationSchemaColumnsIsNullable = "is_nullable" InformationSchemaColumnsDataType = "data_type" InformationSchemaColumnsCharacterMaximumLength = "character_maximum_length" InformationSchemaColumnsCharacterOctetLength = "character_octet_length" InformationSchemaColumnsNumericPrecision = "numeric_precision" InformationSchemaColumnsNumericPrecisionRadix = "numeric_precision_radix" InformationSchemaColumnsNumericScale = "numeric_scale" InformationSchemaColumnsDatetimePrecision = "datetime_precision" InformationSchemaColumnsIntervalType = "interval_type" InformationSchemaColumnsIntervalPrecision = "interval_precision" InformationSchemaColumnsCharacterSetCatalog = "character_set_catalog" InformationSchemaColumnsCharacterSetSchema = "character_set_schema" InformationSchemaColumnsCharacterSetName = "character_set_name" InformationSchemaColumnsCollationCatalog = "collation_catalog" InformationSchemaColumnsCollationSchema = "collation_schema" InformationSchemaColumnsCollationName = "collation_name" InformationSchemaColumnsDomainCatalog = "domain_catalog" InformationSchemaColumnsDomainSchema = "domain_schema" InformationSchemaColumnsDomainName = "domain_name" InformationSchemaColumnsUdtCatalog = "udt_catalog" InformationSchemaColumnsUdtSchema = "udt_schema" InformationSchemaColumnsUdtName = "udt_name" InformationSchemaColumnsScopeCatalog = "scope_catalog" InformationSchemaColumnsScopeSchema = "scope_schema" InformationSchemaColumnsScopeName = "scope_name" InformationSchemaColumnsMaximumCardinality = "maximum_cardinality" InformationSchemaColumnsDtdIdentifier = "dtd_identifier" InformationSchemaColumnsIsSelfReferencing = "is_self_referencing" InformationSchemaColumnsIsIdentity = "is_identity" InformationSchemaColumnsIdentityGeneration = "identity_generation" InformationSchemaColumnsIdentityStart = "identity_start" InformationSchemaColumnsIdentityIncrement = "identity_increment" InformationSchemaColumnsIdentityMaximum = "identity_maximum" InformationSchemaColumnsIdentityMinimum = "identity_minimum" InformationSchemaColumnsIdentityCycle = "identity_cycle" InformationSchemaColumnsIsGenerated = "is_generated" InformationSchemaColumnsGenerationExpression = "generation_expression" InformationSchemaColumnsIsUpdatable = "is_updatable" )
View Source
const ( // InformationSchemaColumns represents a system information schema cloumns tables name. InformationSchemaColumns = SystemInformationSchema + "." + "columns" )
View Source
const TimestampFormat = "2006-01-02 15:04:05"
TimestampFormat represents a timestamp format.
Variables ¶
View Source
var Catalogs = map[string][]byte{
"PgType": pgType,
}
Catalogs is a map of catalog names and catalog bytes. PostgreSQL: Documentation: System Catalogs https://www.postgresql.org/docs/current/catalogs.html
View Source
var ErrNotFound = errors.New("not found")
ErrNotFound represents a not found error.
View Source
var SystemSchemaNames = []string{ SystemSchemaName, SystemInformationSchema, }
SystemSchemaNames represents system schema names.
Functions ¶
This section is empty.
Types ¶
type DataType ¶
type DataType struct {
// contains filtered or unexported fields
}
DataType represents a PostgreSQL data type.
func GetFunctionDataType ¶ added in v1.1.1
GetFunctionDataType returns the data type of the specified function.
func NewDataTypeFrom ¶ added in v1.5.8
NewDataTypeFrom returns a data type for the specified OID.
func (*DataType) FormatCode ¶
func (dt *DataType) FormatCode() FormatCode
FormatCodeFrom returns a format code from the specified data type.
type FormatCode ¶
type FormatCode = int16
FormatCode represents a format code.
const ( // TextFormat represents a text format code. TextFormat FormatCode = 0 // BinaryFormat represents a binary format code. BinaryFormat FormatCode = 1 )
type ObjectID ¶ added in v1.2.0
type ObjectID = int32
ObjectID represents a PostgreSQL object ID.
const ( Bool ObjectID = 16 Bytea ObjectID = 17 Char ObjectID = 18 Name ObjectID = 19 Int8 ObjectID = 20 Int2 ObjectID = 21 Int2vector ObjectID = 22 Int4 ObjectID = 23 Regproc ObjectID = 24 Text ObjectID = 25 Oid ObjectID = 26 Tid ObjectID = 27 Xid ObjectID = 28 Cid ObjectID = 29 Oidvector ObjectID = 30 PgType ObjectID = 71 PgAttribute ObjectID = 75 PgProc ObjectID = 81 PgClass ObjectID = 83 JSON ObjectID = 114 XML ObjectID = 142 PgNodeTree ObjectID = 194 PgNdistinct ObjectID = 3361 PgDependencies ObjectID = 3402 PgMcvList ObjectID = 5017 PgDdlCommand ObjectID = 32 Xid8 ObjectID = 5069 Point ObjectID = 600 Lseg ObjectID = 601 Path ObjectID = 602 Box ObjectID = 603 Polygon ObjectID = 604 Line ObjectID = 628 Float4 ObjectID = 700 Float8 ObjectID = 701 Unknown ObjectID = 705 Circle ObjectID = 718 Money ObjectID = 790 Macaddr ObjectID = 829 Inet ObjectID = 869 Cidr ObjectID = 650 Macaddr8 ObjectID = 774 ACLitem ObjectID = 1033 Bpchar ObjectID = 1042 Varchar ObjectID = 1043 Date ObjectID = 1082 Time ObjectID = 1083 Timestamp ObjectID = 1114 Timestamptz ObjectID = 1184 Interval ObjectID = 1186 Timetz ObjectID = 1266 Bit ObjectID = 1560 Varbit ObjectID = 1562 Numeric ObjectID = 1700 Refcursor ObjectID = 1790 Regprocedure ObjectID = 2202 Regoper ObjectID = 2203 Regoperator ObjectID = 2204 Regclass ObjectID = 2205 Regcollation ObjectID = 4191 Regtype ObjectID = 2206 Regrole ObjectID = 4096 Regnamespace ObjectID = 4089 UUID ObjectID = 2950 PgLsn ObjectID = 3220 TSvector ObjectID = 3614 Gtsvector ObjectID = 3642 TSquery ObjectID = 3615 Regconfig ObjectID = 3734 Regdictionary ObjectID = 3769 JSONb ObjectID = 3802 JSONpath ObjectID = 4072 TxidSnapshot ObjectID = 2970 PgSnapshot ObjectID = 5038 Int4range ObjectID = 3904 Numrange ObjectID = 3906 TSrange ObjectID = 3908 TStzrange ObjectID = 3910 Daterange ObjectID = 3912 Int8range ObjectID = 3926 Int4multirange ObjectID = 4451 Nummultirange ObjectID = 4532 TSmultirange ObjectID = 4533 TStzmultirange ObjectID = 4534 Datemultirange ObjectID = 4535 Int8multirange ObjectID = 4536 Record ObjectID = 2249 Cstring ObjectID = 2275 Any ObjectID = 2276 Anyarray ObjectID = 2277 Void ObjectID = 2278 Trigger ObjectID = 2279 EventTrigger ObjectID = 3838 LanguageHandler ObjectID = 2280 Internal ObjectID = 2281 Anyelement ObjectID = 2283 Anynonarray ObjectID = 2776 Anyenum ObjectID = 3500 FdwHandler ObjectID = 3115 IndexAmHandler ObjectID = 325 TSmHandler ObjectID = 3310 TableAmHandler ObjectID = 269 Anyrange ObjectID = 3831 Anycompatible ObjectID = 5077 Anycompatiblearray ObjectID = 5078 Anycompatiblenonarray ObjectID = 5079 Anycompatiblerange ObjectID = 5080 Anymultirange ObjectID = 4537 Anycompatiblemultirange ObjectID = 4538 PgBrinBloomSummary ObjectID = 4600 PgBrinMinmaxMultiSummary ObjectID = 4601 PgAttrdef ObjectID = 12001 PgConstraint ObjectID = 12003 PgInherits ObjectID = 12005 PgIndex ObjectID = 12007 PgOperator ObjectID = 12009 PgOpfamily ObjectID = 12011 PgOpclass ObjectID = 12013 PgAm ObjectID = 12015 PgAmop ObjectID = 12017 PgAmproc ObjectID = 12019 PgLanguage ObjectID = 12021 PgLargeobjectMetadata ObjectID = 12023 PgLargeobject ObjectID = 12025 PgAggregate ObjectID = 12027 PgStatistic ObjectID = 12029 PgStatisticExt ObjectID = 12031 PgStatisticExtData ObjectID = 12033 PgRewrite ObjectID = 12035 PgTrigger ObjectID = 12037 PgEventTrigger ObjectID = 12039 PgDescription ObjectID = 12041 PgCast ObjectID = 12043 PgEnum ObjectID = 12045 PgNamespace ObjectID = 12047 PgConversion ObjectID = 12049 PgDepend ObjectID = 12051 PgDatabase ObjectID = 1248 PgDBRoleSetting ObjectID = 12054 PgTablespace ObjectID = 12056 PgAuthid ObjectID = 2842 PgAuthMembers ObjectID = 2843 PgShdepend ObjectID = 12060 PgShdescription ObjectID = 12062 PgTSConfig ObjectID = 12064 PgTSConfigMap ObjectID = 12066 PgTSDict ObjectID = 12068 PgTSParser ObjectID = 12070 PgTSTemplate ObjectID = 12072 PgExtension ObjectID = 12074 PgForeignDataWrapper ObjectID = 12076 PgForeignServer ObjectID = 12078 PgUserMapping ObjectID = 12080 PgForeignTable ObjectID = 12082 PgPolicy ObjectID = 12084 PgReplicationOrigin ObjectID = 12086 PgDefaultACL ObjectID = 12088 PgInitPrivs ObjectID = 12090 PgSeclabel ObjectID = 12092 PgShseclabel ObjectID = 4066 PgCollation ObjectID = 12095 PgPartitionedTable ObjectID = 12097 PgRange ObjectID = 12099 PgTransform ObjectID = 12101 PgSequence ObjectID = 12103 PgPublication ObjectID = 12105 PgPublicationRel ObjectID = 12107 PgSubscription ObjectID = 6101 PgSubscriptionRel ObjectID = 12110 PgRoles ObjectID = 12219 PgShadow ObjectID = 12224 PgGroup ObjectID = 12229 PgUser ObjectID = 12233 PgPolicies ObjectID = 12237 PgRules ObjectID = 12242 PgViews ObjectID = 12247 PgTables ObjectID = 12252 PgMatviews ObjectID = 12257 PgIndexes ObjectID = 12262 PgSequences ObjectID = 12267 PgStats ObjectID = 12272 PgStatsExt ObjectID = 12277 PgStatsExtExprs ObjectID = 12282 PgPublicationTables ObjectID = 12287 PgLocks ObjectID = 12292 PgCursors ObjectID = 12296 PgAvailableExtensions ObjectID = 12300 PgAvailableExtensionVersions ObjectID = 12304 PgPreparedXacts ObjectID = 12309 PgPreparedStatements ObjectID = 12314 PgSeclabels ObjectID = 12318 PgSettings ObjectID = 12323 PgFileSettings ObjectID = 12329 PgHbaFileRules ObjectID = 12333 PgTimezoneAbbrevs ObjectID = 12337 PgTimezoneNames ObjectID = 12341 PgConfig ObjectID = 12345 PgShmemAllocations ObjectID = 12349 PgBackendMemoryContexts ObjectID = 12353 PgStatAllTables ObjectID = 12357 PgStatXactAllTables ObjectID = 12362 PgStatSysTables ObjectID = 12367 PgStatXactSysTables ObjectID = 12372 PgStatUserTables ObjectID = 12376 PgStatXactUserTables ObjectID = 12381 PgStatioAllTables ObjectID = 12385 PgStatioSysTables ObjectID = 12390 PgStatioUserTables ObjectID = 12394 PgStatAllIndexes ObjectID = 12398 PgStatSysIndexes ObjectID = 12403 PgStatUserIndexes ObjectID = 12407 PgStatioAllIndexes ObjectID = 12411 PgStatioSysIndexes ObjectID = 12416 PgStatioUserIndexes ObjectID = 12420 PgStatioAllSequences ObjectID = 12424 PgStatioSysSequences ObjectID = 12429 PgStatioUserSequences ObjectID = 12433 PgStatActivity ObjectID = 12437 PgStatReplication ObjectID = 12442 PgStatSlru ObjectID = 12447 PgStatWalReceiver ObjectID = 12451 PgStatSubscription ObjectID = 12455 PgStatSsl ObjectID = 12460 PgStatGssapi ObjectID = 12464 PgReplicationSlots ObjectID = 12468 PgStatReplicationSlots ObjectID = 12473 PgStatDatabase ObjectID = 12477 PgStatDatabaseConflicts ObjectID = 12482 PgStatUserFunctions ObjectID = 12486 PgStatXactUserFunctions ObjectID = 12491 PgStatArchiver ObjectID = 12496 PgStatBgwriter ObjectID = 12500 PgStatWal ObjectID = 12504 PgStatProgressAnalyze ObjectID = 12508 PgStatProgressVacuum ObjectID = 12513 PgStatProgressCluster ObjectID = 12518 PgStatProgressCreateIndex ObjectID = 12523 PgStatProgressBasebackup ObjectID = 12528 PgStatProgressCopy ObjectID = 12533 PgUserMappings ObjectID = 12538 PgReplicationOriginStatus ObjectID = 12543 CardinalNumber ObjectID = 13690 CharacterData ObjectID = 13693 SQLIdentifier ObjectID = 13695 InformationSchemaCatalogName ObjectID = 13698 TimeStamp ObjectID = 13701 YesOrNo ObjectID = 13703 ApplicableRoles ObjectID = 13707 AdministrableRoleAuthorizations ObjectID = 13712 Attributes ObjectID = 13716 CharacterSets ObjectID = 13721 CheckConstraintRoutineUsage ObjectID = 13726 CheckConstraints ObjectID = 13731 Collations ObjectID = 13736 CollationCharacterSetApplicability ObjectID = 13741 ColumnColumnUsage ObjectID = 13746 ColumnDomainUsage ObjectID = 13751 ColumnPrivileges ObjectID = 13756 ColumnUdtUsage ObjectID = 13761 Columns ObjectID = 13766 ConstraintColumnUsage ObjectID = 13771 ConstraintTableUsage ObjectID = 13776 DomainConstraints ObjectID = 13781 DomainUdtUsage ObjectID = 13786 Domains ObjectID = 13791 EnabledRoles ObjectID = 13796 KeyColumnUsage ObjectID = 13800 Parameters ObjectID = 13805 ReferentialConstraints ObjectID = 13810 RoleColumnGrants ObjectID = 13815 RoutineColumnUsage ObjectID = 13819 RoutinePrivileges ObjectID = 13824 RoleRoutineGrants ObjectID = 13829 RoutineRoutineUsage ObjectID = 13833 RoutineSequenceUsage ObjectID = 13838 RoutineTableUsage ObjectID = 13843 Routines ObjectID = 13848 Schemata ObjectID = 13853 Sequences ObjectID = 13857 SQLFeatures ObjectID = 13862 SQLImplementationInfo ObjectID = 13867 SQLParts ObjectID = 13872 SQLSizing ObjectID = 13877 TableConstraints ObjectID = 13882 TablePrivileges ObjectID = 13887 RoleTableGrants ObjectID = 13892 Tables ObjectID = 13896 Transforms ObjectID = 13901 TriggeredUpdateColumns ObjectID = 13906 Triggers ObjectID = 13911 UdtPrivileges ObjectID = 13916 RoleUdtGrants ObjectID = 13921 UsagePrivileges ObjectID = 13925 RoleUsageGrants ObjectID = 13930 UserDefinedTypes ObjectID = 13934 ViewColumnUsage ObjectID = 13939 ViewRoutineUsage ObjectID = 13944 ViewTableUsage ObjectID = 13949 Views ObjectID = 13954 DataTypePrivileges ObjectID = 13959 ElementTypes ObjectID = 13964 ColumnOptions ObjectID = 13974 ForeignDataWrapperOptions ObjectID = 13982 ForeignDataWrappers ObjectID = 13986 ForeignServerOptions ObjectID = 13995 ForeignServers ObjectID = 13999 ForeignTableOptions ObjectID = 14008 ForeignTables ObjectID = 14012 UserMappingOptions ObjectID = 14021 UserMappings ObjectID = 14026 )
Source Files ¶
Click to show internal directories.
Click to hide internal directories.