package pq

import (
	
	
	

	
)

const headerSize = 4

The object ID of the data type.
The data type size (see pg_type.typlen). Note that negative values denote variable-width types.
The type modifier (see pg_attribute.atttypmod). The meaning of the modifier is type-specific.
	Mod int
}

func ( fieldDesc) () reflect.Type {
	switch .OID {
	case oid.T_int8:
		return reflect.TypeOf(int64(0))
	case oid.T_int4:
		return reflect.TypeOf(int32(0))
	case oid.T_int2:
		return reflect.TypeOf(int16(0))
	case oid.T_varchar, oid.T_text:
		return reflect.TypeOf("")
	case oid.T_bool:
		return reflect.TypeOf(false)
	case oid.T_date, oid.T_time, oid.T_timetz, oid.T_timestamp, oid.T_timestamptz:
		return reflect.TypeOf(time.Time{})
	case oid.T_bytea:
		return reflect.TypeOf([]byte(nil))
	default:
		return reflect.TypeOf(new(interface{})).Elem()
	}
}

func ( fieldDesc) () string {
	return oid.TypeName[.OID]
}

func ( fieldDesc) () ( int64,  bool) {
	switch .OID {
	case oid.T_text, oid.T_bytea:
		return math.MaxInt64, true
	case oid.T_varchar, oid.T_bpchar:
		return int64(.Mod - headerSize), true
	default:
		return 0, false
	}
}

func ( fieldDesc) () (,  int64,  bool) {
	switch .OID {
	case oid.T_numeric, oid.T__numeric:
		 := .Mod - headerSize
		 = int64(( >> 16) & 0xffff)
		 = int64( & 0xffff)
		return , , true
	default:
		return 0, 0, false
	}
}
ColumnTypeScanType returns the value type that can be used to scan types into.
func ( *rows) ( int) reflect.Type {
	return .colTyps[].Type()
}
ColumnTypeDatabaseTypeName return the database system type name.
func ( *rows) ( int) string {
	return .colTyps[].Name()
}
ColumnTypeLength returns the length of the column type if the column is a variable length type. If the column is not a variable length type ok should return false.
func ( *rows) ( int) ( int64,  bool) {
	return .colTyps[].Length()
}
ColumnTypePrecisionScale should return the precision and scale for decimal types. If not applicable, ok should be false.
func ( *rows) ( int) (,  int64,  bool) {
	return .colTyps[].PrecisionScale()