You are an expert in writing code in many different languages. Your goal is to perform code completion for the following code, keeping in mind the rest of the code and the file meta data.
    Metadata details:
    filename: oid.go
    path of file: ./repos/cockroach/pkg/sql/types
    
    the code of the file until where you have to start completion: // Copyright 2017 The Cockroach Authors.
//
// Use of this software is governed by the Business Source License
// included in the file licenses/BSL.txt.
//
// As of the Change Date specified in that file, in accordance with
// the Business Source License, use of this software will be governed
// by the Apache License, Version 2.0, included in the file
// licenses/APL.txt.

package types

import (
	"github.com/cockroachdb/cockroach/pkg/sql/oidext"
	"github.com/cockroachdb/errors"
	"github.com/lib/pq/oid"
)

// Convenience list of pre-constructed OID-related types.
var (
	// Oid is the type of a Postgres Object ID value.
	Oid = &T{InternalType: InternalType{
		Family: OidFamily, Oid: oid.T_oid, Locale: &emptyLocale}}

	// Regclass is the type of a Postgres regclass OID variant (T_regclass).
	RegClass = &T{InternalType: InternalType{
		Family: OidFamily, Oid: oid.T_regclass, Locale: &emptyLocale}}

	// RegNamespace is the type of a Postgres regnamespace OID variant
	// (T_regnamespace).
	RegNamespace = &T{InternalType: InternalType{
		Family: OidFamily, Oid: oid.T_regnamespace, Locale: &emptyLocale}}

	// RegProc is the type of a Postgres regproc OID variant (T_regproc).
	RegProc = &T{InternalType: InternalType{
		Family: OidFamily, Oid: oid.T_regproc, Locale: &emptyLocale}}

	// RegProcedure is the type of a Postgres regprocedure OID variant
	// (T_regprocedure).
	RegProcedure = &T{In
    
func CalcArrayOid(elemTyp *T) oid.Oid {
	o := elemTyp.Oid()
	switch elemTyp.Family() {
	case ArrayFamily:
		// Postgres nested arrays return the OID of the nested array (i.e. the
		// OID doesn't change no matter how many levels of nesting there are),
		// except in the special-case of the vector types.
		switch o {
		case oid.T_int2vector, oid.T_oidvector:
			// Vector types have their own array OID types.
		default:
			return o
		}

	case UnknownFamily:
		// Postgres doesn't have an OID for an array of unknown values, since
		// it's not possible to create that in Postgres. But CRDB does allow that,
		// so return 0 for that case (since there's no T__unknown). This is what
		// previous versions of CRDB returned for this case.
		return unknownArrayOid

	case EnumFamily:
		return elemTyp.UserDefinedArrayOID()

	case TupleFamily:
		if elemTyp.UserDefined() {
			if elemTyp.TypeMeta.ImplicitRecordType {
				// We're currently not creating array types for implicitly-defined
				// per-table record types. So, we cheat a little, and return, as the OID
				// for an array of these things, the OID for a generic array of records.
				return oid.T__record
			}
			return elemTyp.UserDefinedArrayOID()
		}
	}

	// Map the OID of the array element type to the corresponding array OID.
	// This should always be possible for all other OIDs (checked in oid.go
	// init method).
	if o == oid.T_json {
		o = oid.T__json
	} else {
		o = oidToArrayOid[o]
	}
	if o == 0 {
		panic(errors.AssertionFailedf("oid %d couldn't be mapped to array oid", elemTyp.Oid()))
	}
	return o
}