cockroach: github.com/cockroachdb/cockroach/pkg/sql/oidext Index | Files

package oidext

import "github.com/cockroachdb/cockroach/pkg/sql/oidext"

Package 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.

Index

Package Files

oidext.go

Constants

const (
    T_geometry   = oid.Oid(90000)
    T__geometry  = oid.Oid(90001)
    T_geography  = oid.Oid(90002)
    T__geography = oid.Oid(90003)
)

OIDs in this block are extensions of postgres, thus having no official OID.

const CockroachPredefinedOIDMax = 100000

CockroachPredefinedOIDMax defines the maximum OID allowed for use by non user defined types. OIDs for user defined types will start at CockroachPrefixedOIDMax and increase as new types are created. User defined type descriptors have a cluster-wide unique stable ID. CockroachPredefinedOIDMax defines the mapping from this stable ID to a type OID. In particular, stable ID + CockroachPredefinedOIDMax = type OID. types.StableTypeIDToOID and types.UserDefinedTypeOIDToID should be used when converting between stable ID's and type OIDs.

Variables

var ExtensionTypeName = map[oid.Oid]string{
    T_geometry:   "GEOMETRY",
    T__geometry:  "_GEOMETRY",
    T_geography:  "GEOGRAPHY",
    T__geography: "_GEOGRAPHY",
}

ExtensionTypeName returns a mapping from extension oids to their type name.

func TypeName Uses

func TypeName(o oid.Oid) (string, bool)

TypeName checks the name for a given type by first looking up oid.TypeName before falling back to looking at the oid extension ExtensionTypeName.

Package oidext imports 1 packages (graph) and is imported by 4 packages. Updated 2020-06-02. Refresh now. Tools for package owners.