common

package
v0.11.0 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Apr 14, 2024 License: MIT Imports: 4 Imported by: 0

Documentation

Index

Constants

View Source
const (
	PG_UNKNOWN       = 0xFFFF
	PG_ORIGINAL      = 0
	PGPRO_STANDARD   = (uint32('P') << 8) | uint32('P')
	PGPRO_ENTERPRISE = (uint32('P') << 8) | uint32('E')

	PG_UNKNOWN_STR       = "(unknown edition)"
	PG_ORIGINAL_STR      = "PostgreSQL"
	PGPRO_STANDARD_STR   = "Postgres Pro Standard"
	PGPRO_ENTERPRISE_STR = "Postgres Pro Enterprise"
)

typedef enum

{
	PG_UNKNOWN					= 0xFFFF,
	PG_ORIGINAL					= 0,
	PGPRO_STANDARD				= ('P'<<8|'P'),
	PGPRO_ENTERPRISE			= ('P'<<8|'E'),
} PgEdition;
View Source
const (
	PageSize                 = 8192
	FirstNormalTransactionID = 3

	LP_UNUSED   = 0 /* unused (should always have lp_len=0) */
	LP_NORMAL   = 1 /* used (should always have lp_len>0) */
	LP_REDIRECT = 2 /* HOT redirect (should have lp_len=0) */
	LP_DEAD     = 3
)
View Source
const (
	RelSegSize = 131072
)

Variables

View Source
var DBState = scalar.UintMap{
	0: {Sym: "DB_STARTUP"},
	1: {Sym: "DB_SHUTDOWNED"},
	2: {Sym: "DB_SHUTDOWNED_IN_RECOVERY"},
	3: {Sym: "DB_SHUTDOWNING"},
	4: {Sym: "DB_IN_CRASH_RECOVERY"},
	5: {Sym: "DB_IN_ARCHIVE_RECOVERY"},
	6: {Sym: "DB_IN_PRODUCTION"},
}

typedef enum DBState

{
	DB_STARTUP = 0,
	DB_SHUTDOWNED,
	DB_SHUTDOWNED_IN_RECOVERY,
	DB_SHUTDOWNING,
	DB_IN_CRASH_RECOVERY,
	DB_IN_ARCHIVE_RECOVERY,
	DB_IN_PRODUCTION
} DBState;
View Source
var HexMapper = hexMapper{}
View Source
var IcuVersionMapper = icuVersionMapper{}
View Source
var LocPtrMapper = xLogRecPtrMapper{}
View Source
var LpFlagsMapper = lpFlagsMapper{}
View Source
var NextFullXidMapper = nextFullXidMapper{}
View Source
var TimeMapper = timeMapper{}
View Source
var VersionMapper = versionMapper{}
View Source
var WalLevel = scalar.SintMap{
	0: {Sym: "WAL_LEVEL_MINIMAL"},
	1: {Sym: "WAL_LEVEL_REPLICA"},
	2: {Sym: "WAL_LEVEL_LOGICAL"},
}

typedef enum WalLevel

{
	WAL_LEVEL_MINIMAL = 0,
	WAL_LEVEL_REPLICA,
	WAL_LEVEL_LOGICAL
} WalLevel;
View Source
var XLogRecPtrMapper = xLogRecPtrMapper{}

Functions

func CheckSumBlock

func CheckSumBlock(page []byte, blockNumber uint32) uint16

func IsMaskSet

func IsMaskSet(value uint64, mask uint64) uint64

func IsMaskSet0

func IsMaskSet0(value uint64, mask uint64) bool

func ParsePgProVersion

func ParsePgProVersion(v uint32) (pgProVersion uint32, oriVer uint32)

func RoundDown

func RoundDown(alignVal uint64, alignLen uint64) uint64

func TransactionIDIsNormal

func TransactionIDIsNormal(xid uint64) bool

func TypeAlign

func TypeAlign(alignVal uint64, alignLen uint64) uint64

func TypeAlign8

func TypeAlign8(alignLen uint64) uint64

Types

type Mask

type Mask struct {
	Mask uint64
}

func (Mask) MapUint

func (m Mask) MapUint(s scalar.Uint) (scalar.Uint, error)

Directories

Path Synopsis
pg_btree
pg_heap

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL