pg

package
v0.1.1 Latest Latest
Warning

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

Go to latest
Published: Sep 14, 2017 License: Apache-2.0 Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	// Value representing an invalid LSN (used in error conditions)
	InvalidLSN = LSN(math.MaxUint64)

	// WALPageSize == PostgreSQL's Page Size.  Page Size == BLKSZ WALPageSize
	// defaults to 8KB.  The same value used in the WAL is used in the PostgreSQL
	// Heap.
	//
	// TODO(seanc@): pull this data from `SHOW wal_block_size`.
	WALPageSize = 8 * units.KiB

	HeapPageSize = WALPageSize

	// WALFileSize == PostgreSQL WAL File Size.
	// WALFileSize defaults to 16MB
	//
	// TODO(seanc@): pull this value from `SHOW wal_segment_size`
	WALFileSize = 16 * units.MiB

	// HeapMaxSegmentSize is the max size of a single file in a relation.
	//
	// TODO(seanc@): pull this value from pg_controldata(1)'s "Blocks per segment
	// of large relation" and multiply it by WALBlockSize
	HeapMaxSegmentSize = 1 * units.GiB

	WALFilesPerSegment uint64 = 0x100000000 / uint64(WALFileSize)
)

Variables

This section is empty.

Functions

This section is empty.

Types

type HeapBlockNumber

type HeapBlockNumber uint64

HeapBlockNumber represents a given HeapBlockNumber inside of a segment

type HeapPageNumber

type HeapPageNumber uint64

func HeapSegmentPageNum

func HeapSegmentPageNum(block HeapBlockNumber) HeapPageNumber

HeapSegmentPageNum returns the page number of a given page inside of a heap segment.

type HeapSegment

type HeapSegment uint32

func SegmentNumber

func SegmentNumber(block uint64) HeapSegment

SegmentNumber returns the segment number from a given block number.

type LSN

type LSN uint64

func New

func New(segNo HeapSegment, off Offset) LSN

New creates a new LSN from a segment ID and offset

func ParseLSN

func ParseLSN(in string) (LSN, error)

ParseLSN returns a parsed LSN

func (LSN) ByteOffset

func (lsn LSN) ByteOffset() Offset

Offset returns the byte offset inside of a WAL segment.

func (LSN) ID

func (lsn LSN) ID() HeapSegment

ID returns the numeric ID of the WAL.

func (LSN) SegmentNumber

func (lsn LSN) SegmentNumber() HeapSegment

Segment returns the Segment number of the LSN.

func (LSN) String

func (lsn LSN) String() string

String returns the string representation of an LSN.

func (LSN) WALFileName

func (lsn LSN) WALFileName(timelineID ...TimelineID) string

WALFileName returns the name of a WAL's filename. The timeline number is optional. If the timeline is not specified, default to a timelineID of 1.

type OID

type OID uint64

type Offset

type Offset uint32

type TimelineID

type TimelineID uint32

Jump to

Keyboard shortcuts

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