{"modulePath":"github.com/cockroachdb/cockroachdb-parser","version":"v0.25.2","isLatest":true,"isStandardLibrary":false,"goos":"all","goarch":"all","docs":"# package oidext\n\nPackage oidext contains oids that are not in \\`github.com/lib/pq/oid\\` as they are not shipped by default with postgres. As CRDB does not support extensions, we'll need to automatically assign a few OIDs of our own.\n\n## Constants\n\n```go\nconst (\n\tT_geometry   = oid.Oid(90000)\n\tT__geometry  = oid.Oid(90001)\n\tT_geography  = oid.Oid(90002)\n\tT__geography = oid.Oid(90003)\n\tT_box2d      = oid.Oid(90004)\n\tT__box2d     = oid.Oid(90005)\n\tT_pgvector   = oid.Oid(90006)\n\tT__pgvector  = oid.Oid(90007)\n)\n```\nOIDs in this block are extensions of postgres, thus having no official OID.\n\n```go\nconst (\n\tT_jsonpath  = oid.Oid(4072)\n\tT__jsonpath = oid.Oid(4073)\n)\n```\nOIDs in this block are not extensions of postgres, but are not supported in github.com/lib/pq/oid. See postgres/src/include/catalog/pg\\_type.dat for oids.\n\n```go\nconst CockroachPredefinedOIDMax = 100000\n```\nCockroachPredefinedOIDMax defines the maximum OID allowed for use by non user defined types/functions. OIDs for user defined types/functions will start at CockroachPrefixedOIDMax and increase as new types are created. User defined type/function descriptors have a cluster-wide unique stable ID. CockroachPredefinedOIDMax defines the mapping from this stable ID to a type/function OID. In particular, stable ID + CockroachPredefinedOIDMax = type OID. types.StableTypeIDToOID and types.UserDefinedTypeOIDToID should be used when converting between stable ID's and type/function OIDs.\n\n## Variables\n\n```go\nvar ExtensionTypeName = map[oid.Oid]string{\n\tT_geometry:   \"GEOMETRY\",\n\tT__geometry:  \"_GEOMETRY\",\n\tT_geography:  \"GEOGRAPHY\",\n\tT__geography: \"_GEOGRAPHY\",\n\tT_box2d:      \"BOX2D\",\n\tT__box2d:     \"_BOX2D\",\n\tT_pgvector:   \"VECTOR\",\n\tT__pgvector:  \"_VECTOR\",\n\tT_jsonpath:   \"JSONPATH\",\n\tT__jsonpath:  \"_JSONPATH\",\n}\n```\nExtensionTypeName returns a mapping from extension oids to their type name.\n\n## Functions\n\n```go\nfunc TypeName(o oid.Oid) (string, bool)\n```\nTypeName checks the name for a given type by first looking up oid.TypeName before falling back to looking at the oid extension ExtensionTypeName.\n\n","path":"github.com/cockroachdb/cockroachdb-parser/pkg/sql/oidext","name":"oidext","synopsis":"Package oidext contains oids that are not in `github.com/lib/pq/oid` as they are not shipped by default with postgres.","isRedistributable":true}
