Documentation ¶
Index ¶
Constants ¶
const ( CrdbInternalID = math.MaxUint32 - iota CrdbInternalBackwardDependenciesTableID CrdbInternalBuildInfoTableID CrdbInternalBuiltinFunctionsTableID CrdbInternalBuiltinFunctionCommentsTableID CrdbInternalCatalogCommentsTableID CrdbInternalCatalogDescriptorTableID CrdbInternalCatalogNamespaceTableID CrdbInternalCatalogZonesTableID CrdbInternalClusterContendedIndexesViewID CrdbInternalClusterContendedKeysViewID CrdbInternalClusterContendedTablesViewID CrdbInternalClusterContentionEventsTableID CrdbInternalClusterDistSQLFlowsTableID CrdbInternalClusterExecutionInsightsTableID CrdbInternalClusterTxnExecutionInsightsTableID CrdbInternalNodeTxnExecutionInsightsTableID CrdbInternalClusterLocksTableID CrdbInternalClusterQueriesTableID CrdbInternalClusterTransactionsTableID CrdbInternalClusterSessionsTableID CrdbInternalClusterSettingsTableID CrdbInternalClusterStmtStatsTableID CrdbInternalClusterTxnStatsTableID CrdbInternalCreateFunctionStmtsTableID CrdbInternalCreateProcedureStmtsTableID CrdbInternalCreateSchemaStmtsTableID CrdbInternalCreateStmtsTableID CrdbInternalCreateTypeStmtsTableID CrdbInternalDatabasesTableID CrdbInternalFeatureUsageID CrdbInternalForwardDependenciesTableID CrdbInternalKVNodeLivenessTableID CrdbInternalGossipNodesTableID CrdbInternalGossipAlertsTableID CrdbInternalGossipLivenessTableID CrdbInternalGossipNetworkTableID CrdbInternalTransactionContentionEvents CrdbInternalIndexColumnsTableID CrdbInternalIndexSpansTableID CrdbInternalIndexUsageStatisticsTableID CrdbInternalInflightTraceSpanTableID CrdbInternalJobsTableID CrdbInternalSystemJobsTableID CrdbInternalKVNodeStatusTableID CrdbInternalKVStoreStatusTableID CrdbInternalLeasesTableID CrdbInternalLocalContentionEventsTableID CrdbInternalLocalDistSQLFlowsTableID CrdbInternalNodeExecutionInsightsTableID CrdbInternalLocalQueriesTableID CrdbInternalLocalTransactionsTableID CrdbInternalLocalSessionsTableID CrdbInternalLocalMetricsTableID CrdbInternalNodeMemoryMonitorsTableID CrdbInternalNodeStmtStatsTableID CrdbInternalNodeTxnStatsTableID CrdbInternalPartitionsTableID CrdbInternalRangesNoLeasesTableID CrdbInternalRangesViewID CrdbInternalRuntimeInfoTableID CrdbInternalSchemaChangesTableID CrdbInternalSessionTraceTableID CrdbInternalSessionVariablesTableID CrdbInternalStmtActivityTableID CrdbInternalStmtStatsTableID CrdbInternalStmtStatsPersistedTableID CrdbInternalStmtStatsPersistedV22_2TableID CrdbInternalTableColumnsTableID CrdbInternalTableIndexesTableID CrdbInternalTableSpansTableID CrdbInternalTablesTableID CrdbInternalTablesTableLastStatsID CrdbInternalTransactionStatsTableID CrdbInternalTxnActivityTableID CrdbInternalTxnStatsTableID CrdbInternalTxnStatsPersistedTableID CrdbInternalTxnStatsPersistedV22_2TableID CrdbInternalZonesTableID CrdbInternalInvalidDescriptorsTableID CrdbInternalClusterDatabasePrivilegesTableID CrdbInternalCrossDbRefrences CrdbInternalLostTableDescriptors CrdbInternalClusterInflightTracesTable CrdbInternalRegionsTable CrdbInternalDefaultPrivilegesTable CrdbInternalActiveRangeFeedsTable CrdbInternalTenantUsageDetailsViewID CrdbInternalPgCatalogTableIsImplementedTableID CrdbInternalSuperRegions CrdbInternalDroppedRelationsViewID CrdbInternalShowTenantCapabilitiesCacheTableID CrdbInternalInheritedRoleMembersTableID CrdbInternalKVSystemPrivilegesViewID CrdbInternalKVFlowControllerID CrdbInternalKVFlowHandlesID CrdbInternalKVFlowTokenDeductions CrdbInternalRepairableCatalogCorruptionsViewID CrdbInternalKVProtectedTS InformationSchemaID InformationSchemaAdministrableRoleAuthorizationsID InformationSchemaApplicableRolesID InformationSchemaAttributesTableID InformationSchemaCharacterSets InformationSchemaCheckConstraintRoutineUsageTableID InformationSchemaCheckConstraints InformationSchemaCollationCharacterSetApplicability InformationSchemaCollations InformationSchemaColumnColumnUsageTableID InformationSchemaColumnDomainUsageTableID InformationSchemaColumnOptionsTableID InformationSchemaColumnPrivilegesID InformationSchemaColumnStatisticsTableID InformationSchemaColumnUDTUsageID InformationSchemaColumnsExtensionsTableID InformationSchemaColumnsTableID InformationSchemaConstraintColumnUsageTableID InformationSchemaConstraintTableUsageTableID InformationSchemaDataTypePrivilegesTableID InformationSchemaDomainConstraintsTableID InformationSchemaDomainUdtUsageTableID InformationSchemaDomainsTableID InformationSchemaElementTypesTableID InformationSchemaEnabledRolesID InformationSchemaEnginesTableID InformationSchemaEventsTableID InformationSchemaFilesTableID InformationSchemaForeignDataWrapperOptionsTableID InformationSchemaForeignDataWrappersTableID InformationSchemaForeignServerOptionsTableID InformationSchemaForeignServersTableID InformationSchemaForeignTableOptionsTableID InformationSchemaForeignTablesTableID InformationSchemaInformationSchemaCatalogNameTableID InformationSchemaKeyColumnUsageTableID InformationSchemaKeywordsTableID InformationSchemaOptimizerTraceTableID InformationSchemaParametersTableID InformationSchemaPartitionsTableID InformationSchemaPluginsTableID InformationSchemaProcesslistTableID InformationSchemaProfilingTableID InformationSchemaReferentialConstraintsTableID InformationSchemaResourceGroupsTableID InformationSchemaRoleColumnGrantsTableID InformationSchemaRoleRoutineGrantsTableID InformationSchemaRoleTableGrantsID InformationSchemaRoleUdtGrantsTableID InformationSchemaRoleUsageGrantsTableID InformationSchemaRoutinePrivilegesTableID InformationSchemaRoutineTableID InformationSchemaSQLFeaturesTableID InformationSchemaSQLImplementationInfoTableID InformationSchemaSQLPartsTableID InformationSchemaSQLSizingTableID InformationSchemaSchemataExtensionsTableID InformationSchemaSchemataTableID InformationSchemaSchemataTablePrivilegesID InformationSchemaSequencesID InformationSchemaSessionVariables InformationSchemaStGeometryColumnsTableID InformationSchemaStSpatialReferenceSystemsTableID InformationSchemaStUnitsOfMeasureTableID InformationSchemaStatisticsTableID InformationSchemaTableConstraintTableID InformationSchemaTableConstraintsExtensionsTableID InformationSchemaTablePrivilegesID InformationSchemaTablesExtensionsTableID InformationSchemaTablesTableID InformationSchemaTablespacesExtensionsTableID InformationSchemaTablespacesTableID InformationSchemaTransformsTableID InformationSchemaTriggeredUpdateColumnsTableID InformationSchemaTriggersTableID InformationSchemaTypePrivilegesID InformationSchemaUdtPrivilegesTableID InformationSchemaUsagePrivilegesTableID InformationSchemaUserAttributesTableID InformationSchemaUserDefinedTypesTableID InformationSchemaUserMappingOptionsTableID InformationSchemaUserMappingsTableID InformationSchemaUserPrivilegesID InformationSchemaViewColumnUsageTableID InformationSchemaViewRoutineUsageTableID InformationSchemaViewTableUsageTableID InformationSchemaViewsTableID PgCatalogID PgCatalogAggregateTableID PgCatalogAmTableID PgCatalogAmopTableID PgCatalogAmprocTableID PgCatalogAttrDefTableID PgCatalogAttributeTableID PgCatalogAuthIDTableID PgCatalogAuthMembersTableID PgCatalogAvailableExtensionVersionsTableID PgCatalogAvailableExtensionsTableID PgCatalogCastTableID PgCatalogClassTableID PgCatalogCollationTableID PgCatalogConfigTableID PgCatalogConstraintTableID PgCatalogConversionTableID PgCatalogCursorsTableID PgCatalogDatabaseTableID PgCatalogDbRoleSettingTableID PgCatalogDefaultACLTableID PgCatalogDependTableID PgCatalogDescriptionTableID PgCatalogEnumTableID PgCatalogEventTriggerTableID PgCatalogExtensionTableID PgCatalogFileSettingsTableID PgCatalogForeignDataWrapperTableID PgCatalogForeignServerTableID PgCatalogForeignTableTableID PgCatalogGroupTableID PgCatalogHbaFileRulesTableID PgCatalogIndexTableID PgCatalogIndexesTableID PgCatalogInheritsTableID PgCatalogInitPrivsTableID PgCatalogLanguageTableID PgCatalogLargeobjectMetadataTableID PgCatalogLargeobjectTableID PgCatalogLocksTableID PgCatalogMatViewsTableID PgCatalogNamespaceTableID PgCatalogOpclassTableID PgCatalogOperatorTableID PgCatalogOpfamilyTableID PgCatalogPartitionedTableTableID PgCatalogPoliciesTableID PgCatalogPolicyTableID PgCatalogPreparedStatementsTableID PgCatalogPreparedXactsTableID PgCatalogProcTableID PgCatalogPublicationRelTableID PgCatalogPublicationTableID PgCatalogPublicationTablesTableID PgCatalogRangeTableID PgCatalogReplicationOriginStatusTableID PgCatalogReplicationOriginTableID PgCatalogReplicationSlotsTableID PgCatalogRewriteTableID PgCatalogRolesTableID PgCatalogRulesTableID PgCatalogSecLabelsTableID PgCatalogSecurityLabelTableID PgCatalogSequenceTableID PgCatalogSequencesTableID PgCatalogSettingsTableID PgCatalogShadowTableID PgCatalogShdependTableID PgCatalogShmemAllocationsTableID PgCatalogStatActivityTableID PgCatalogStatAllIndexesTableID PgCatalogStatAllTablesTableID PgCatalogStatArchiverTableID PgCatalogStatBgwriterTableID PgCatalogStatDatabaseConflictsTableID PgCatalogStatDatabaseTableID PgCatalogStatGssapiTableID PgCatalogStatProgressAnalyzeTableID PgCatalogStatProgressBasebackupTableID PgCatalogStatProgressClusterTableID PgCatalogStatProgressCreateIndexTableID PgCatalogStatProgressVacuumTableID PgCatalogStatReplicationTableID PgCatalogStatSlruTableID PgCatalogStatSslTableID PgCatalogStatSubscriptionTableID PgCatalogStatSysIndexesTableID PgCatalogStatSysTablesTableID PgCatalogStatUserFunctionsTableID PgCatalogStatUserIndexesTableID PgCatalogStatUserTablesTableID PgCatalogStatWalReceiverTableID PgCatalogStatXactAllTablesTableID PgCatalogStatXactSysTablesTableID PgCatalogStatXactUserFunctionsTableID PgCatalogStatXactUserTablesTableID PgCatalogStatioAllIndexesTableID PgCatalogStatioAllSequencesTableID PgCatalogStatioAllTablesTableID PgCatalogStatioSysIndexesTableID PgCatalogStatioSysSequencesTableID PgCatalogStatioSysTablesTableID PgCatalogStatioUserIndexesTableID PgCatalogStatioUserSequencesTableID PgCatalogStatioUserTablesTableID PgCatalogStatisticExtDataTableID PgCatalogStatisticExtTableID PgCatalogStatisticTableID PgCatalogStatsExtTableID PgCatalogStatsTableID PgCatalogSubscriptionRelTableID PgCatalogSubscriptionTableID PgCatalogTablesTableID PgCatalogTablespaceTableID PgCatalogTimezoneAbbrevsTableID PgCatalogTimezoneNamesTableID PgCatalogTransformTableID PgCatalogTriggerTableID PgCatalogTsConfigMapTableID PgCatalogTsConfigTableID PgCatalogTsDictTableID PgCatalogTsParserTableID PgCatalogTsTemplateTableID PgCatalogTypeTableID PgCatalogUserMappingTableID PgCatalogUserMappingsTableID PgCatalogUserTableID PgCatalogViewsTableID PgExtensionSchemaID PgExtensionGeographyColumnsTableID PgExtensionGeometryColumnsTableID PgExtensionSpatialRefSysTableID MinVirtualID = PgExtensionSpatialRefSysTableID )
Oid for virtual database and table.
const ( // NamespaceTableFamilyID is the column family of the namespace table which is // actually written to. NamespaceTableFamilyID = 4 // NamespaceTablePrimaryIndexID is the id of the primary index of the // namespace table. NamespaceTablePrimaryIndexID = 1 // PreMigrationNamespaceTableName is the name that was used on the descriptor // of the current namespace table before the DeprecatedNamespaceTable was // migrated away. PreMigrationNamespaceTableName = "namespace2" )
const CRDBInternalSchemaName = "crdb_internal"
CRDBInternalSchemaName is the name of the crdb_internal system schema.
const DelegatedAppNamePrefix = "$$ "
DelegatedAppNamePrefix is added to a regular client application name for SQL queries that are ran internally on behalf of other SQL queries inside that application. This is not the same as ReportableAppNamePrefix; in particular the application name with DelegatedAppNamePrefix should be scrubbed in reporting.
const InformationSchemaName = "information_schema"
InformationSchemaName is the name of the information_schema system schema.
const InternalAppNamePrefix = ReportableAppNamePrefix + "internal"
InternalAppNamePrefix indicates that the application name identifies an internal task / query / job to CockroachDB. Different application names are used to classify queries in different categories.
const InternalSQLAppName = "cockroach sql"
InternalSQLAppName is the application_name used by the cockroach CLI by default
const PgCatalogName = "pg_catalog"
PgCatalogName is the name of the pg_catalog system schema.
const PgExtensionSchemaName = "pg_extension"
PgExtensionSchemaName is the alias for schemas which are usually "public" in postgres when installing an extension, but must be stored as a separate schema in CRDB.
const PgSchemaPrefix = "pg_"
PgSchemaPrefix is a prefix for Postgres system schemas. Users cannot create schemas with this prefix.
const PgTempSchemaName = "pg_temp"
PgTempSchemaName is the alias for temporary schemas across sessions.
const PublicSchemaID = 29
PublicSchemaID redefines keys.PublicSchemaID to avoid an import. It exists to deal with time-travel queries from moments before the time when all databases other than system were given a public schema.
const PublicSchemaName = "public"
PublicSchemaName is the name of the public schema.
const ReportableAppNamePrefix = "$ "
ReportableAppNamePrefix indicates that the application name can be reported in telemetry without scrubbing. (Note this only applies to the application name itself. Query data is still scrubbed as usual.)
const SystemDatabaseName = "system"
SystemDatabaseName is the name of the system database.
const SystemTenantName = "system"
SystemTenantName is the tenant name of the system tenant.
const UserSchemaName = "$user"
UserSchemaName is the alias for schema names for users.
Variables ¶
var StaticSchemaIDMap = map[uint32]string{ PgCatalogID: PgCatalogName, InformationSchemaID: InformationSchemaName, CrdbInternalID: CRDBInternalSchemaName, PgExtensionSchemaID: PgExtensionSchemaName, }
StaticSchemaIDMap is a map of statically known schema IDs on versions PublicSchemasWithDescriptors and onwards.
var StaticSchemaIDMapVirtualPublicSchema = map[uint32]string{ PublicSchemaID: PublicSchemaName, PgCatalogID: PgCatalogName, InformationSchemaID: InformationSchemaName, CrdbInternalID: CRDBInternalSchemaName, PgExtensionSchemaID: PgExtensionSchemaName, }
StaticSchemaIDMapVirtualPublicSchema is a map of statically known schema IDs on versions prior to PublicSchemasWithDescriptors.
var VirtualSchemaNames = map[string]struct{}{ PgCatalogName: {}, InformationSchemaName: {}, CRDBInternalSchemaName: {}, PgExtensionSchemaName: {}, }
VirtualSchemaNames is a set of all virtual schema names.
Functions ¶
func GetStaticSchemaIDMap ¶
GetStaticSchemaIDMap returns a map of schema ids to schema names for the static schemas.
Types ¶
type ConstraintType ¶
type ConstraintType string
ConstraintType is used to identify the type of a constraint.
const ( // ConstraintTypePK identifies a PRIMARY KEY constraint. ConstraintTypePK ConstraintType = "PRIMARY KEY" // ConstraintTypeFK identifies a FOREIGN KEY constraint. ConstraintTypeFK ConstraintType = "FOREIGN KEY" // ConstraintTypeUnique identifies a UNIQUE constraint. ConstraintTypeUnique ConstraintType = "UNIQUE" // ConstraintTypeCheck identifies a CHECK constraint. ConstraintTypeCheck ConstraintType = "CHECK" // ConstraintTypeUniqueWithoutIndex identifies a UNIQUE_WITHOUT_INDEX constraint. ConstraintTypeUniqueWithoutIndex ConstraintType = "UNIQUE WITHOUT INDEX" )
func (ConstraintType) SafeValue ¶
func (ConstraintType) SafeValue()
SafeValue implements the redact.SafeValue interface.
type SystemTableName ¶
type SystemTableName string
SystemTableName is a type for system table names.
const ( NamespaceTableName SystemTableName = "namespace" DescriptorTableName SystemTableName = "descriptor" UsersTableName SystemTableName = "users" ZonesTableName SystemTableName = "zones" SettingsTableName SystemTableName = "settings" DescIDSequenceTableName SystemTableName = "descriptor_id_seq" TenantIDSequenceTableName SystemTableName = "tenant_id_seq" TenantsTableName SystemTableName = "tenants" LeaseTableName SystemTableName = "lease" EventLogTableName SystemTableName = "eventlog" RangeEventTableName SystemTableName = "rangelog" UITableName SystemTableName = "ui" JobsTableName SystemTableName = "jobs" WebSessionsTableName SystemTableName = "web_sessions" TableStatisticsTableName SystemTableName = "table_statistics" LocationsTableName SystemTableName = "locations" RoleMembersTableName SystemTableName = "role_members" CommentsTableName SystemTableName = "comments" ReportsMetaTableName SystemTableName = "reports_meta" ReplicationConstraintStatsTableName SystemTableName = "replication_constraint_stats" ReplicationCriticalLocalitiesTableName SystemTableName = "replication_critical_localities" ReplicationStatsTableName SystemTableName = "replication_stats" ProtectedTimestampsMetaTableName SystemTableName = "protected_ts_meta" ProtectedTimestampsRecordsTableName SystemTableName = "protected_ts_records" RoleOptionsTableName SystemTableName = "role_options" StatementBundleChunksTableName SystemTableName = "statement_bundle_chunks" StatementDiagnosticsRequestsTableName SystemTableName = "statement_diagnostics_requests" StatementDiagnosticsTableName SystemTableName = "statement_diagnostics" ScheduledJobsTableName SystemTableName = "scheduled_jobs" SqllivenessTableName SystemTableName = "sqlliveness" MigrationsTableName SystemTableName = "migrations" JoinTokensTableName SystemTableName = "join_tokens" StatementStatisticsTableName SystemTableName = "statement_statistics" TransactionStatisticsTableName SystemTableName = "transaction_statistics" StatementActivityTableName SystemTableName = "statement_activity" TransactionActivityTableName SystemTableName = "transaction_activity" DatabaseRoleSettingsTableName SystemTableName = "database_role_settings" TenantUsageTableName SystemTableName = "tenant_usage" SQLInstancesTableName SystemTableName = "sql_instances" SpanConfigurationsTableName SystemTableName = "span_configurations" TaskPayloadsTableName SystemTableName = "task_payloads" TenantSettingsTableName SystemTableName = "tenant_settings" TenantTasksTableName SystemTableName = "tenant_tasks" SpanCountTableName SystemTableName = "span_count" SystemPrivilegeTableName SystemTableName = "privileges" SystemExternalConnectionsTableName SystemTableName = "external_connections" RoleIDSequenceName SystemTableName = "role_id_seq" SystemJobInfoTableName SystemTableName = "job_info" SpanStatsUniqueKeys SystemTableName = "span_stats_unique_keys" SpanStatsBuckets SystemTableName = "span_stats_buckets" SpanStatsSamples SystemTableName = "span_stats_samples" SpanStatsTenantBoundaries SystemTableName = "span_stats_tenant_boundaries" RegionalLiveness SystemTableName = "region_liveness" MVCCStatistics SystemTableName = "mvcc_statistics" StmtExecInsightsTableName SystemTableName = "statement_execution_insights" TxnExecInsightsTableName SystemTableName = "transaction_execution_insights" )
Names of tables in the system database.