backup

package
v1.0.0 Latest Latest
Warning

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

Go to latest
Published: Nov 21, 2023 License: Apache-2.0 Imports: 35 Imported by: 0

Documentation

Index

Constants

View Source
const (
	Unknown int = iota
	Deferred
	Complete
	PG_LOCK_NOT_AVAILABLE = "55P03"
)

Table backup state constants

View Source
const (
	// Type of external table
	READABLE = iota
	READABLE_WEB
	WRITABLE
	WRITABLE_WEB
	// Protocol external table is using
	FILE
	GPFDIST
	GPHDFS
	HTTP
	S3
)
View Source
const (
	SNAPSHOT_GPDB_MIN_VERSION = "1.1.0"
)

Variables

View Source
var (
	PG_AGGREGATE_OID            uint32 = 1255
	PG_AUTHID_OID               uint32 = 1260
	PG_CAST_OID                 uint32 = 2605
	PG_CLASS_OID                uint32 = 1259
	PG_COLLATION_OID            uint32 = 3456
	PG_CONSTRAINT_OID           uint32 = 2606
	PG_CONVERSION_OID           uint32 = 2607
	PG_DATABASE_OID             uint32 = 1262
	PG_EVENT_TRIGGER            uint32 = 3466
	PG_EXTENSION_OID            uint32 = 3079
	PG_EXTPROTOCOL_OID          uint32 = 7175
	PG_FOREIGN_DATA_WRAPPER_OID uint32 = 2328
	PG_FOREIGN_SERVER_OID       uint32 = 1417
	PG_INDEX_OID                uint32 = 2610
	PG_LANGUAGE_OID             uint32 = 2612
	PG_TRANSFORM_OID            uint32 = 3576
	PG_NAMESPACE_OID            uint32 = 2615
	PG_OPCLASS_OID              uint32 = 2616
	PG_OPERATOR_OID             uint32 = 2617
	PG_OPFAMILY_OID             uint32 = 2753
	PG_PROC_OID                 uint32 = 1255
	PG_RESGROUP_OID             uint32 = 6436
	PG_RESQUEUE_OID             uint32 = 6026
	PG_REWRITE_OID              uint32 = 2618
	PG_STATISTIC_EXT_OID        uint32 = 3381
	PG_TABLESPACE_OID           uint32 = 1213
	PG_TRIGGER_OID              uint32 = 2620
	PG_TS_CONFIG_OID            uint32 = 3602
	PG_TS_DICT_OID              uint32 = 3600
	PG_TS_PARSER_OID            uint32 = 3601
	PG_TS_TEMPLATE_OID          uint32 = 3764
	PG_TYPE_OID                 uint32 = 1247
	PG_USER_MAPPING_OID         uint32 = 1418

	FIRST_NORMAL_OBJECT_ID uint32 = 16384
)
View Source
var ACLRegex = regexp.MustCompile(`^(.*)=([a-zA-Z\*]*)/(.*)$`)
View Source
var (

	/*
	 * Used for synchronizing DoCleanup.  In DoInit() we increment the group
	 * and then wait for at least one DoCleanup to finish, either in DoTeardown
	 * or the signal handler.
	 */
	CleanupGroup *sync.WaitGroup
)

* Non-flag variables

Functions

func AddProtocolDependenciesForGPDB4

func AddProtocolDependenciesForGPDB4(depMap DependencyMap, tables []Table, protocols []ExternalProtocol)

This file contains functions to sort objects that have dependencies among themselves. * For example, functions and types can be dependent on one another, we cannot simply * dump all functions and then all types. * The following objects are included the dependency sorting logic: * - Functions * - Types * - Tables * - Protocols

func AddTableDataEntriesToTOC

func AddTableDataEntriesToTOC(tables []Table, rowsCopiedMaps []map[uint32]int64)

func AnyValues

func AnyValues(any pq.StringArray, typ string) string

* A given type is not guaranteed to have a corresponding array type, so we need * to use array_in() instead of casting to an array.

func AppendExtPartSuffix

func AppendExtPartSuffix(name string) string

func BackupSingleTableData

func BackupSingleTableData(table Table, rowsCopiedMap map[uint32]int64, counters *BackupProgressCounters, whichConn int) error

func ConstructImplicitIndexOidList

func ConstructImplicitIndexOidList(connectionPool *dbconn.DBConn) string

* This function constructs the names of implicit indexes created by * unique constraints on tables, so they can be filtered out of the * index list. * * Primary key indexes can only be created implicitly by a primary * key constraint, so they can be filtered out directly in the query * to get indexes, but multiple unique indexes can be created on the * same column so we only want to filter out the implicit ones.

func ConstructTableAttributesList

func ConstructTableAttributesList(columnDefs []ColumnDefinition) string

func CopyTableOut

func CopyTableOut(connectionPool *dbconn.DBConn, table Table, destinationToWrite string, connNum int) (int64, error)

func CreateInitialSegmentPipes

func CreateInitialSegmentPipes(oidList []string, c *cluster.Cluster, connectionPool *dbconn.DBConn, fpInfo filepath.FilePathInfo) int

func DetermineExternalTableCharacteristics

func DetermineExternalTableCharacteristics(extTableDef ExternalTableDefinition) (int, int)

func DoBackup

func DoBackup()

func DoCleanup

func DoCleanup(backupFailed bool)

func DoFlagValidation

func DoFlagValidation(cmd *cobra.Command)

func DoInit

func DoInit(cmd *cobra.Command)

This function handles setup that can be done before parsing flags.

func DoSetup

func DoSetup()

This function handles setup that must be done after parsing flags.

func DoTeardown

func DoTeardown()

func ExtensionFilterClause

func ExtensionFilterClause(namespace string) string

func ExtractLanguageFunctions

func ExtractLanguageFunctions(funcDefs []Function, procLangs []ProceduralLanguage) ([]Function, []Function)

* This function separates out functions related to procedural languages from * any other functions, so that language-related functions can be backed up before * the languages themselves and we can avoid sorting languages and functions * together to resolve dependencies.

func FlagChanged

func FlagChanged(flagName string) bool

func GenerateAttributeStatisticsQueries

func GenerateAttributeStatisticsQueries(table Table, attStat AttributeStatistic) []string

func GenerateFormatStatement

func GenerateFormatStatement(extTableDef ExternalTableDefinition) string

func GenerateTableBatches

func GenerateTableBatches(tables []Relation, batchSize int) []string

GenerateTableBatches batches tables to reduce network congestion and resource contention. Returns an array of batches where a batch of tables is a single string with comma separated tables

func GenerateTupleStatisticsQuery

func GenerateTupleStatisticsQuery(table Table, tupleStat TupleStatistic) string

func GetAOIncrementalMetadata

func GetAOIncrementalMetadata(connectionPool *dbconn.DBConn) map[string]toc.AOEntry

func GetAttachPartitionInfo

func GetAttachPartitionInfo(connectionPool *dbconn.DBConn) map[uint32]AttachPartitionInfo

func GetAttributeStatistics

func GetAttributeStatistics(connectionPool *dbconn.DBConn, tables []Table) map[uint32][]AttributeStatistic

func GetColumnDefinitions

func GetColumnDefinitions(connectionPool *dbconn.DBConn) map[uint32][]ColumnDefinition

func GetDBSize

func GetDBSize(connectionPool *dbconn.DBConn) string

Potentially expensive query

func GetDatabaseGUCs

func GetDatabaseGUCs(connectionPool *dbconn.DBConn) []string

func GetDistributionPolicies

func GetDistributionPolicies(connectionPool *dbconn.DBConn) map[uint32]string

func GetExternalTableDefinitions

func GetExternalTableDefinitions(connectionPool *dbconn.DBConn) map[uint32]ExternalTableDefinition

func GetForceRowSecurity

func GetForceRowSecurity(connectionPool *dbconn.DBConn) map[uint32]bool

func GetForeignTableDefinitions

func GetForeignTableDefinitions(connectionPool *dbconn.DBConn) map[uint32]ForeignTableDefinition

func GetFunctionArgsAndIdentArgs

func GetFunctionArgsAndIdentArgs(connectionPool *dbconn.DBConn) (map[uint32]string, map[uint32]string)

* Functions do not have default argument values in GPDB 4.3, so there is no * difference between a function's "arguments" and "identity arguments" and * we can use the same map for both fields.

func GetFunctionOidToInfoMap

func GetFunctionOidToInfoMap(connectionPool *dbconn.DBConn) map[uint32]FunctionInfo

func GetFunctionReturnTypes

func GetFunctionReturnTypes(connectionPool *dbconn.DBConn) map[uint32]Function

func GetLatestMatchingBackupConfig

func GetLatestMatchingBackupConfig(history *history.History, currentBackupConfig *history.BackupConfig) *history.BackupConfig

func GetLatestMatchingBackupTimestamp

func GetLatestMatchingBackupTimestamp() string

func GetOperatorClassFunctions

func GetOperatorClassFunctions(connectionPool *dbconn.DBConn) map[uint32][]OperatorClassFunction

func GetOperatorClassOperators

func GetOperatorClassOperators(connectionPool *dbconn.DBConn) map[uint32][]OperatorClassOperator

func GetPartitionAlteredSchema

func GetPartitionAlteredSchema(connectionPool *dbconn.DBConn) map[uint32][]AlteredPartitionRelation

* Partition tables could have child partitions in schemas different * than the root partition. We need to keep track of these child * partitions and later create ALTER TABLE SET SCHEMA statements for * them.

func GetPartitionDetails

func GetPartitionDetails(connectionPool *dbconn.DBConn) (map[uint32]string, map[uint32]string)

func GetPartitionKeyDefs

func GetPartitionKeyDefs(connectionPool *dbconn.DBConn) map[uint32]string

Used to contruct root tables for GPDB 7+, because the root partition must be constructed by itself first.

func GetPartitionTableMap

func GetPartitionTableMap(connectionPool *dbconn.DBConn) map[uint32]PartitionLevelInfo

func GetRenameExchangedPartitionQuery

func GetRenameExchangedPartitionQuery(connection *dbconn.DBConn) string

func GetReport

func GetReport() *report.Report

func GetRoleGUCs

func GetRoleGUCs(connectionPool *dbconn.DBConn) map[string][]RoleGUC

func GetSegmentTablespaces

func GetSegmentTablespaces(connectionPool *dbconn.DBConn, Oid uint32) []string

func GetSynchronizedSnapshot

func GetSynchronizedSnapshot(connectionPool *dbconn.DBConn) (string, error)

Export synchronized snapshot using connection 0 and return snapshotId value as string

func GetTableAccessMethod

func GetTableAccessMethod(connectionPool *dbconn.DBConn) map[uint32]string

func GetTableInheritance

func GetTableInheritance(connectionPool *dbconn.DBConn, tables []Relation) map[uint32][]string

func GetTableReplicaIdentity

func GetTableReplicaIdentity(connectionPool *dbconn.DBConn) map[uint32]string

func GetTableStorage

func GetTableStorage(connectionPool *dbconn.DBConn) (map[uint32]string, map[uint32]string)

func GetTableType

func GetTableType(connectionPool *dbconn.DBConn) map[uint32]string

func GetTargetBackupTimestamp

func GetTargetBackupTimestamp() string

func GetTupleStatistics

func GetTupleStatistics(connectionPool *dbconn.DBConn, tables []Table) map[uint32]TupleStatistic

func GetTypeMetadataEntry

func GetTypeMetadataEntry(schema string, name string) (string, toc.MetadataEntry)

func GetUnloggedTables

func GetUnloggedTables(connectionPool *dbconn.DBConn) map[uint32]bool

func GetVersion

func GetVersion() string

func InitializeMetadataParams

func InitializeMetadataParams(connectionPool *dbconn.DBConn)

func LockTableNoWait

func LockTableNoWait(dataTable Table, connNum int) error

Acquire AccessShareLock on a table with NOWAIT option. If we are unable to acquire the lock, the call will fail instead of block. Return the failure for handling.

func LockTables

func LockTables(connectionPool *dbconn.DBConn, tables []Relation)

This function is responsible for getting the necessary access share locks for the target relations. This is mainly to protect the metadata dumping part but it also makes the main worker thread (worker 0) the most resilient for the later data dumping logic. Locks will still be taken for --data-only calls.

func MustGetFlagBool

func MustGetFlagBool(flagName string) bool

func MustGetFlagInt

func MustGetFlagInt(flagName string) int

func MustGetFlagString

func MustGetFlagString(flagName string) string

func MustGetFlagStringArray

func MustGetFlagStringArray(flagName string) []string

func MustGetFlagStringSlice

func MustGetFlagStringSlice(flagName string) []string

func NewBackupConfig

func NewBackupConfig(dbName string, dbVersion string, backupVersion string, plugin string, timestamp string, opts options.Options) *history.BackupConfig

func PopulateRestorePlan

func PopulateRestorePlan(changedTables []Table,
	restorePlan []history.RestorePlanEntry, allTables []Table) []history.RestorePlanEntry

func PostProcessFunctionConfigs

func PostProcessFunctionConfigs(allFunctions []Function) error

func PrintAccessMethodStatements

func PrintAccessMethodStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, accessMethods []AccessMethod, accessMethodMetadata MetadataMap)

func PrintAlterSequenceStatements

func PrintAlterSequenceStatements(metadataFile *utils.FileWithByteCount,
	tocfile *toc.TOC, sequences []Sequence)

func PrintConstraintStatement

func PrintConstraintStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, constraint Constraint, conMetadata ObjectMetadata)

* There's no built-in function to generate constraint definitions like there is for other types of * metadata, so this function constructs them.

func PrintCreateAggregateStatement

func PrintCreateAggregateStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, aggDef Aggregate, funcInfoMap map[uint32]FunctionInfo, aggMetadata ObjectMetadata)

func PrintCreateBaseTypeStatement

func PrintCreateBaseTypeStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, base BaseType, typeMetadata ObjectMetadata)

func PrintCreateCastStatement

func PrintCreateCastStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, castDef Cast, castMetadata ObjectMetadata)

func PrintCreateCollationStatements

func PrintCreateCollationStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, collations []Collation, collationMetadata MetadataMap)

func PrintCreateCompositeTypeStatement

func PrintCreateCompositeTypeStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, composite CompositeType, typeMetadata ObjectMetadata)

func PrintCreateConversionStatements

func PrintCreateConversionStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, conversions []Conversion, conversionMetadata MetadataMap)

func PrintCreateDatabaseStatement

func PrintCreateDatabaseStatement(metadataFile *utils.FileWithByteCount, tocfile *toc.TOC, defaultDB Database, db Database, dbMetadata MetadataMap)

func PrintCreateDomainStatement

func PrintCreateDomainStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, domain Domain, typeMetadata ObjectMetadata, constraints []Constraint)

func PrintCreateEnumTypeStatements

func PrintCreateEnumTypeStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, enums []EnumType, typeMetadata MetadataMap)

func PrintCreateEventTriggerStatements

func PrintCreateEventTriggerStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, eventTriggers []EventTrigger, eventTriggerMetadata MetadataMap)

func PrintCreateExtendedStatistics

func PrintCreateExtendedStatistics(metadataFile *utils.FileWithByteCount, toc *toc.TOC, statExtObjects []StatisticExt, statMetadata MetadataMap)

func PrintCreateExtensionStatements

func PrintCreateExtensionStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, extensionDefs []Extension, extensionMetadata MetadataMap)

func PrintCreateExternalProtocolStatement

func PrintCreateExternalProtocolStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, protocol ExternalProtocol, funcInfoMap map[uint32]FunctionInfo, protoMetadata ObjectMetadata)

func PrintCreateForeignDataWrapperStatement

func PrintCreateForeignDataWrapperStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC,
	fdw ForeignDataWrapper, funcInfoMap map[uint32]FunctionInfo, fdwMetadata ObjectMetadata)

func PrintCreateFunctionStatement

func PrintCreateFunctionStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, funcDef Function, funcMetadata ObjectMetadata)

func PrintCreateIndexStatements

func PrintCreateIndexStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, indexes []IndexDefinition, indexMetadata MetadataMap)

func PrintCreateLanguageStatements

func PrintCreateLanguageStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, procLangs []ProceduralLanguage,
	funcInfoMap map[uint32]FunctionInfo, procLangMetadata MetadataMap)

func PrintCreateOperatorClassStatement

func PrintCreateOperatorClassStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, operatorClass OperatorClass, operatorClassMetadata ObjectMetadata)

func PrintCreateOperatorFamilyStatements

func PrintCreateOperatorFamilyStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, operatorFamilies []OperatorFamily, operatorFamilyMetadata MetadataMap)

* Operator families are not supported in GPDB 4.3, so this function * is not used in a 4.3 backup.

func PrintCreateOperatorStatement

func PrintCreateOperatorStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, operator Operator, operatorMetadata ObjectMetadata)

func PrintCreatePolicyStatements

func PrintCreatePolicyStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, policies []RLSPolicy, policyMetadata MetadataMap)

func PrintCreateRangeTypeStatement

func PrintCreateRangeTypeStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, rangeType RangeType, typeMetadata ObjectMetadata)

func PrintCreateResourceGroupStatements

func PrintCreateResourceGroupStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, resGroups []ResourceGroup, resGroupMetadata MetadataMap)

func PrintCreateResourceQueueStatements

func PrintCreateResourceQueueStatements(metadataFile *utils.FileWithByteCount, tocfile *toc.TOC, resQueues []ResourceQueue, resQueueMetadata MetadataMap)

func PrintCreateRoleStatements

func PrintCreateRoleStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, roles []Role, roleMetadata MetadataMap)

func PrintCreateRuleStatements

func PrintCreateRuleStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, rules []RuleDefinition, ruleMetadata MetadataMap)

func PrintCreateSchemaStatements

func PrintCreateSchemaStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, schemas []Schema, schemaMetadata MetadataMap)

func PrintCreateSequenceStatements

func PrintCreateSequenceStatements(metadataFile *utils.FileWithByteCount,
	toc *toc.TOC, sequences []Sequence, sequenceMetadata MetadataMap)

* This function is largely derived from the dumpSequence() function in pg_dump.c. The values of * minVal and maxVal come from SEQ_MINVALUE and SEQ_MAXVALUE, defined in include/commands/sequence.h.

func PrintCreateServerStatement

func PrintCreateServerStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, server ForeignServer, serverMetadata ObjectMetadata)

func PrintCreateShellTypeStatements

func PrintCreateShellTypeStatements(metadataFile *utils.FileWithByteCount, tocfile *toc.TOC, shellTypes []ShellType, baseTypes []BaseType, rangeTypes []RangeType)

func PrintCreateTableStatement

func PrintCreateTableStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, table Table, tableMetadata ObjectMetadata)

* This function prints CREATE TABLE statements in a format very similar to pg_dump. Unlike pg_dump, * however, table names are printed fully qualified with their schemas instead of relying on setting * the search_path; this will aid in later filtering to include or exclude certain tables during the * backup process, and allows customers to copy just the CREATE TABLE block in order to use it directly.

func PrintCreateTablespaceStatements

func PrintCreateTablespaceStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, tablespaces []Tablespace, tablespaceMetadata MetadataMap)

func PrintCreateTextSearchConfigurationStatement

func PrintCreateTextSearchConfigurationStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, configuration TextSearchConfiguration, configurationMetadata ObjectMetadata)

func PrintCreateTextSearchDictionaryStatement

func PrintCreateTextSearchDictionaryStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, dictionary TextSearchDictionary, dictionaryMetadata ObjectMetadata)

func PrintCreateTextSearchParserStatement

func PrintCreateTextSearchParserStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, parser TextSearchParser, parserMetadata ObjectMetadata)

func PrintCreateTextSearchTemplateStatement

func PrintCreateTextSearchTemplateStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, template TextSearchTemplate, templateMetadata ObjectMetadata)

func PrintCreateTransformStatement

func PrintCreateTransformStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, transform Transform, funcInfoMap map[uint32]FunctionInfo, transformMetadata ObjectMetadata)

func PrintCreateTriggerStatements

func PrintCreateTriggerStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, triggers []TriggerDefinition, triggerMetadata MetadataMap)

func PrintCreateUserMappingStatement

func PrintCreateUserMappingStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, mapping UserMapping)

func PrintCreateViewStatement

func PrintCreateViewStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, view View, viewMetadata ObjectMetadata)

A view's column names are automatically factored into it's definition.

func PrintDatabaseGUCs

func PrintDatabaseGUCs(metadataFile *utils.FileWithByteCount, tocfile *toc.TOC, gucs []string, dbname string)

func PrintDefaultPrivilegesStatements

func PrintDefaultPrivilegesStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, privileges []DefaultPrivileges)

func PrintDependentObjectStatements

func PrintDependentObjectStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, objects []Sortable, metadataMap MetadataMap, domainConstraints []Constraint, funcInfoMap map[uint32]FunctionInfo)

func PrintExchangeExternalPartitionStatements

func PrintExchangeExternalPartitionStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, extPartitions []PartitionInfo, partInfoMap map[uint32]PartitionInfo, tables []Table)

func PrintExternalTableCreateStatement

func PrintExternalTableCreateStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, table Table)

func PrintExternalTableStatements

func PrintExternalTableStatements(metadataFile *utils.FileWithByteCount, tableName string, extTableDef ExternalTableDefinition)

func PrintFunctionBodyOrPath

func PrintFunctionBodyOrPath(metadataFile *utils.FileWithByteCount, funcDef Function)

* This function either prints a path to an executable function (for C and * internal functions) or a function definition (for functions in other languages).

func PrintFunctionModifiers

func PrintFunctionModifiers(metadataFile *utils.FileWithByteCount, funcDef Function)

func PrintIdentityColumns

func PrintIdentityColumns(metadataFile *utils.FileWithByteCount, toc *toc.TOC, sequences []Sequence)

func PrintObjectMetadata

func PrintObjectMetadata(metadataFile *utils.FileWithByteCount, toc *toc.TOC,
	metadata ObjectMetadata, obj toc.TOCObjectWithMetadata, owningTable string)

func PrintPostCreateTableStatements

func PrintPostCreateTableStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, table Table, tableMetadata ObjectMetadata)

* This function prints additional statements that come after the CREATE TABLE * statement for both regular and external tables.

func PrintRegularTableCreateStatement

func PrintRegularTableCreateStatement(metadataFile *utils.FileWithByteCount, toc *toc.TOC, table Table)

func PrintResetResourceGroupStatements

func PrintResetResourceGroupStatements(metadataFile *utils.FileWithByteCount, tocfile *toc.TOC)

func PrintRoleGUCStatements

func PrintRoleGUCStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, roleGUCs map[string][]RoleGUC)

func PrintRoleMembershipStatements

func PrintRoleMembershipStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC, roleMembers []RoleMember)

func PrintSessionGUCs

func PrintSessionGUCs(metadataFile *utils.FileWithByteCount, toc *toc.TOC, gucs SessionGUCs)

func PrintStatements

func PrintStatements(metadataFile *utils.FileWithByteCount, toc *toc.TOC,
	obj toc.TOCObject, statements []string)

func PrintStatisticsStatements

func PrintStatisticsStatements(statisticsFile *utils.FileWithByteCount, tocfile *toc.TOC, tables []Table, attStats map[uint32][]AttributeStatistic, tupleStats map[uint32]TupleStatistic)

func QuoteGUCValue

func QuoteGUCValue(name, value string) string

func RenameExchangedPartitionConstraints

func RenameExchangedPartitionConstraints(connectionPool *dbconn.DBConn, constraints *[]Constraint)

func RenameExchangedPartitionIndexes

func RenameExchangedPartitionIndexes(connectionPool *dbconn.DBConn, indexes *[]IndexDefinition)

func RetrieveAndProcessTables

func RetrieveAndProcessTables() ([]Table, []Table)

func SchemaFilterClause

func SchemaFilterClause(namespace string) string

A list of schemas we don't want to back up, formatted for use in a WHERE clause

func SchemaFilterClauseWithAlteredPartitionSchemas

func SchemaFilterClauseWithAlteredPartitionSchemas(namespace string, partitionAlteredSchemas map[string]bool) string

* A list of schemas we don't want to back up, formatted for use in a * WHERE clause. This function takes into consideration child * partitions that are in different schemas than their root partition.

func SetCluster

func SetCluster(cluster *cluster.Cluster)

func SetCmdFlags

func SetCmdFlags(flagSet *pflag.FlagSet)

func SetConnection

func SetConnection(conn *dbconn.DBConn)

func SetFPInfo

func SetFPInfo(fpInfo filepath.FilePathInfo)

func SetFilterRelationClause

func SetFilterRelationClause(filterClause string)

func SetLoggerVerbosity

func SetLoggerVerbosity()

func SetPluginConfig

func SetPluginConfig(config *utils.PluginConfig)

func SetQuotedRoleNames

func SetQuotedRoleNames(quotedRoles map[string]string)

func SetReport

func SetReport(report *report.Report)

func SetSessionGUCs

func SetSessionGUCs(connNum int)

func SetSynchronizedSnapshot

func SetSynchronizedSnapshot(connectionPool *dbconn.DBConn, connNum int, snapshotId string) error

Set synchronized snapshot for connNum to snapshotId

func SetTOC

func SetTOC(toc *toc.TOC)

func SetVersion

func SetVersion(v string)

func SliceToPostgresArray

func SliceToPostgresArray(slice []string) string

It is assumed that the elements in the input slice are already escaped

func SplitTablesByPartitionType

func SplitTablesByPartitionType(tables []Table, includeList []string) ([]Table, []Table)

* When leafPartitionData is set, for partition tables we want to print metadata * for the parent tables and data for the leaf tables, so we split them into * separate lists. Intermediate tables are skipped, and non-partition tables are * backed up normally (both metadata and data). * * When the flag is not set, we want to back up both metadata and data for all * tables, so both returned arrays contain all tables.

func UnescapeDoubleQuote

func UnescapeDoubleQuote(value string) string

func ValidateSchemasExist

func ValidateSchemasExist(connectionPool *dbconn.DBConn, schemaList []string, excludeSet bool)

func ValidateTablesExist

func ValidateTablesExist(conn *dbconn.DBConn, tableList []string, excludeSet bool)

Types

type ACL

type ACL struct {
	Grantee             string
	Select              bool
	SelectWithGrant     bool
	Insert              bool
	InsertWithGrant     bool
	Update              bool
	UpdateWithGrant     bool
	Delete              bool
	DeleteWithGrant     bool
	Truncate            bool
	TruncateWithGrant   bool
	References          bool
	ReferencesWithGrant bool
	Trigger             bool
	TriggerWithGrant    bool
	Usage               bool
	UsageWithGrant      bool
	Execute             bool
	ExecuteWithGrant    bool
	Create              bool
	CreateWithGrant     bool
	Temporary           bool
	TemporaryWithGrant  bool
	Connect             bool
	ConnectWithGrant    bool
}

func ParseACL

func ParseACL(aclStr string) *ACL

type AccessMethod

type AccessMethod struct {
	Oid     uint32
	Name    string
	Handler string
	Type    string
}

func GetAccessMethods

func GetAccessMethods(connectionPool *dbconn.DBConn) []AccessMethod

func (AccessMethod) FQN

func (a AccessMethod) FQN() string

func (AccessMethod) GetMetadataEntry

func (a AccessMethod) GetMetadataEntry() (string, toc.MetadataEntry)

func (AccessMethod) GetUniqueID

func (a AccessMethod) GetUniqueID() UniqueID

type Aggregate

type Aggregate struct {
	Oid                        uint32
	Schema                     string
	Name                       string
	Arguments                  sql.NullString
	IdentArgs                  sql.NullString
	TransitionFunction         uint32 `db:"aggtransfn"`
	PreliminaryFunction        uint32 `db:"aggprelimfn"`
	CombineFunction            uint32 `db:"aggcombinefn"`
	SerialFunction             uint32 `db:"aggserialfn"`
	DeserialFunction           uint32 `db:"aggdeserialfn"`
	FinalFunction              uint32 `db:"aggfinalfn"`
	FinalFuncExtra             bool
	SortOperator               string
	SortOperatorSchema         string
	Hypothetical               bool   // GPDB < 7
	Kind                       string // GPDB7+
	TransitionDataType         string
	TransitionDataSize         int `db:"aggtransspace"`
	InitialValue               string
	InitValIsNull              bool
	IsOrdered                  bool   `db:"aggordered"`
	MTransitionFunction        uint32 `db:"aggmtransfn"`
	MInverseTransitionFunction uint32 `db:"aggminvtransfn"`
	MTransitionDataType        string
	MTransitionDataSize        int    `db:"aggmtransspace"`
	MFinalFunction             uint32 `db:"aggmfinalfn"`
	MFinalFuncExtra            bool
	MInitialValue              string
	MInitValIsNull             bool
	Finalmodify                string // GPDB7+
	Mfinalmodify               string // GPDB7+
	Parallel                   string // GPDB7+
}

func GetAggregates

func GetAggregates(connectionPool *dbconn.DBConn) []Aggregate

func (Aggregate) FQN

func (a Aggregate) FQN() string

func (Aggregate) GetMetadataEntry

func (a Aggregate) GetMetadataEntry() (string, toc.MetadataEntry)

func (Aggregate) GetUniqueID

func (a Aggregate) GetUniqueID() UniqueID

type AlteredPartitionRelation

type AlteredPartitionRelation struct {
	OldSchema string
	NewSchema string
	Name      string
}

type AttachPartitionInfo

type AttachPartitionInfo struct {
	Oid     uint32
	Relname string
	Parent  string
	Expr    string
}

type Attribute

type Attribute struct {
	CompositeTypeOid uint32
	Name             string
	Type             string
	Comment          string
	Collation        string
}

type AttributeStatistic

type AttributeStatistic struct {
	Oid          uint32
	Schema       string
	Table        string
	AttName      string
	Type         string
	Relid        uint32         `db:"starelid"`
	AttNumber    int            `db:"staattnum"`
	Inherit      bool           `db:"stainherit"`
	NullFraction float64        `db:"stanullfrac"`
	Width        int            `db:"stawidth"`
	Distinct     float64        `db:"stadistinct"`
	Kind1        int            `db:"stakind1"`
	Kind2        int            `db:"stakind2"`
	Kind3        int            `db:"stakind3"`
	Kind4        int            `db:"stakind4"`
	Kind5        int            `db:"stakind5"`
	Operator1    uint32         `db:"staop1"`
	Operator2    uint32         `db:"staop2"`
	Operator3    uint32         `db:"staop3"`
	Operator4    uint32         `db:"staop4"`
	Operator5    uint32         `db:"staop5"`
	Collation1   uint32         `db:"stacoll1"`
	Collation2   uint32         `db:"stacoll2"`
	Collation3   uint32         `db:"stacoll3"`
	Collation4   uint32         `db:"stacoll4"`
	Collation5   uint32         `db:"stacoll5"`
	Numbers1     pq.StringArray `db:"stanumbers1"`
	Numbers2     pq.StringArray `db:"stanumbers2"`
	Numbers3     pq.StringArray `db:"stanumbers3"`
	Numbers4     pq.StringArray `db:"stanumbers4"`
	Numbers5     pq.StringArray `db:"stanumbers5"`
	Values1      pq.StringArray `db:"stavalues1"`
	Values2      pq.StringArray `db:"stavalues2"`
	Values3      pq.StringArray `db:"stavalues3"`
	Values4      pq.StringArray `db:"stavalues4"`
	Values5      pq.StringArray `db:"stavalues5"`
}

type BackupProgressCounters

type BackupProgressCounters struct {
	NumRegTables   int64
	TotalRegTables int64
	ProgressBar    utils.ProgressBar
}

type BaseType

type BaseType struct {
	Oid             uint32
	Schema          string
	Name            string
	Input           string
	Output          string
	Receive         string
	Send            string
	ModIn           string
	ModOut          string
	InternalLength  int
	IsPassedByValue bool
	Alignment       string
	Storage         string
	DefaultVal      string
	Element         string
	Category        string
	Preferred       bool
	Delimiter       string
	StorageOptions  string
	Collatable      bool
	Collation       string
}

func GetBaseTypes

func GetBaseTypes(connectionPool *dbconn.DBConn) []BaseType

func (BaseType) FQN

func (t BaseType) FQN() string

func (BaseType) GetMetadataEntry

func (t BaseType) GetMetadataEntry() (string, toc.MetadataEntry)

func (BaseType) GetUniqueID

func (t BaseType) GetUniqueID() UniqueID

type Cast

type Cast struct {
	Oid            uint32
	SourceTypeFQN  string
	TargetTypeFQN  string
	FunctionOid    uint32 // Used with GPDB 4.3 to map function arguments
	FunctionSchema string
	FunctionName   string
	FunctionArgs   string
	CastContext    string
	CastMethod     string
}

func GetCasts

func GetCasts(connectionPool *dbconn.DBConn) []Cast

func (Cast) FQN

func (c Cast) FQN() string

func (Cast) GetMetadataEntry

func (c Cast) GetMetadataEntry() (string, toc.MetadataEntry)

func (Cast) GetUniqueID

func (c Cast) GetUniqueID() UniqueID

type Collation

type Collation struct {
	Oid             uint32
	Schema          string
	Name            string
	Collate         string
	Ctype           string
	Provider        string
	IsDeterministic string
}

func GetCollations

func GetCollations(connectionPool *dbconn.DBConn) []Collation

func (Collation) FQN

func (c Collation) FQN() string

func (Collation) GetMetadataEntry

func (c Collation) GetMetadataEntry() (string, toc.MetadataEntry)

func (Collation) GetUniqueID

func (c Collation) GetUniqueID() UniqueID

type ColumnDefinition

type ColumnDefinition struct {
	Oid                   uint32 `db:"attrelid"`
	Num                   int    `db:"attnum"`
	Name                  string
	NotNull               bool `db:"attnotnull"`
	HasDefault            bool `db:"atthasdef"`
	Type                  string
	Encoding              string
	StatTarget            int `db:"attstattarget"`
	StorageType           string
	DefaultVal            string
	Comment               string
	Privileges            sql.NullString
	Kind                  string
	Options               string
	FdwOptions            string
	Collation             string
	SecurityLabelProvider string
	SecurityLabel         string
	AttGenerated          string
}

type CompositeType

type CompositeType struct {
	Oid        uint32
	Schema     string
	Name       string
	Attributes []Attribute
}

func GetCompositeTypes

func GetCompositeTypes(connectionPool *dbconn.DBConn) []CompositeType

func (CompositeType) FQN

func (t CompositeType) FQN() string

func (CompositeType) GetMetadataEntry

func (t CompositeType) GetMetadataEntry() (string, toc.MetadataEntry)

func (CompositeType) GetUniqueID

func (t CompositeType) GetUniqueID() UniqueID

type Constraint

type Constraint struct {
	Oid                uint32
	Schema             string
	Name               string
	ConType            string
	Def                sql.NullString
	ConIsLocal         bool
	OwningObject       string
	IsDomainConstraint bool
	IsPartitionParent  bool
}

func GetConstraints

func GetConstraints(connectionPool *dbconn.DBConn, includeTables ...Relation) []Constraint

func (Constraint) FQN

func (c Constraint) FQN() string

func (Constraint) GetMetadataEntry

func (c Constraint) GetMetadataEntry() (string, toc.MetadataEntry)

func (Constraint) GetUniqueID

func (c Constraint) GetUniqueID() UniqueID

type Conversion

type Conversion struct {
	Oid                uint32
	Schema             string
	Name               string
	ForEncoding        string
	ToEncoding         string
	ConversionFunction string
	IsDefault          bool `db:"condefault"`
}

func GetConversions

func GetConversions(connectionPool *dbconn.DBConn) []Conversion

func (Conversion) FQN

func (c Conversion) FQN() string

func (Conversion) GetMetadataEntry

func (c Conversion) GetMetadataEntry() (string, toc.MetadataEntry)

func (Conversion) GetUniqueID

func (c Conversion) GetUniqueID() UniqueID

type Database

type Database struct {
	Oid        uint32
	Name       string
	Tablespace string
	Collate    string
	CType      string
	Encoding   string
}

func GetDatabaseInfo

func GetDatabaseInfo(connectionPool *dbconn.DBConn) Database

func GetDefaultDatabaseEncodingInfo

func GetDefaultDatabaseEncodingInfo(connectionPool *dbconn.DBConn) Database

func (Database) FQN

func (db Database) FQN() string

func (Database) GetMetadataEntry

func (db Database) GetMetadataEntry() (string, toc.MetadataEntry)

func (Database) GetUniqueID

func (db Database) GetUniqueID() UniqueID

type DefaultPrivileges

type DefaultPrivileges struct {
	Owner      string
	Schema     string
	Privileges []ACL
	ObjectType string
}

func ConstructDefaultPrivileges

func ConstructDefaultPrivileges(results []DefaultPrivilegesQueryStruct) []DefaultPrivileges

func GetDefaultPrivileges

func GetDefaultPrivileges(connectionPool *dbconn.DBConn) []DefaultPrivileges

func (DefaultPrivileges) GetMetadataEntry

func (dp DefaultPrivileges) GetMetadataEntry() (string, toc.MetadataEntry)

type DefaultPrivilegesQueryStruct

type DefaultPrivilegesQueryStruct struct {
	Oid        uint32
	Owner      string
	Schema     string
	Privileges sql.NullString
	Kind       string
	ObjectType string
}

type Dependency

type Dependency struct {
	Oid              uint32
	ReferencedObject string
}

type DependencyMap

type DependencyMap map[UniqueID]map[UniqueID]bool

func GetDependencies

func GetDependencies(connectionPool *dbconn.DBConn, backupSet map[UniqueID]bool, tables []Table) DependencyMap

This function only returns dependencies that are referenced in the backup set

type Domain

type Domain struct {
	Oid        uint32
	Schema     string
	Name       string
	DefaultVal string
	Collation  string
	BaseType   string
	NotNull    bool
}

func GetDomainTypes

func GetDomainTypes(connectionPool *dbconn.DBConn) []Domain

func (Domain) FQN

func (t Domain) FQN() string

func (Domain) GetMetadataEntry

func (t Domain) GetMetadataEntry() (string, toc.MetadataEntry)

func (Domain) GetUniqueID

func (t Domain) GetUniqueID() UniqueID

type EnumType

type EnumType struct {
	Oid        uint32
	Schema     string
	Name       string
	EnumLabels string
}

func GetEnumTypes

func GetEnumTypes(connectionPool *dbconn.DBConn) []EnumType

func (EnumType) FQN

func (t EnumType) FQN() string

func (EnumType) GetMetadataEntry

func (t EnumType) GetMetadataEntry() (string, toc.MetadataEntry)

func (EnumType) GetUniqueID

func (t EnumType) GetUniqueID() UniqueID

type EventTrigger

type EventTrigger struct {
	Oid          uint32
	Name         string
	Event        string
	FunctionName string
	Enabled      string
	EventTags    string
}

func GetEventTriggers

func GetEventTriggers(connectionPool *dbconn.DBConn) []EventTrigger

func (EventTrigger) FQN

func (et EventTrigger) FQN() string

func (EventTrigger) GetMetadataEntry

func (et EventTrigger) GetMetadataEntry() (string, toc.MetadataEntry)

func (EventTrigger) GetUniqueID

func (et EventTrigger) GetUniqueID() UniqueID

type ExchangedPartitionName

type ExchangedPartitionName struct {
	OrigName string
	NewName  string
}

type Extension

type Extension struct {
	Oid    uint32
	Name   string
	Schema string
}

func GetExtensions

func GetExtensions(connectionPool *dbconn.DBConn) []Extension

func (Extension) FQN

func (e Extension) FQN() string

func (Extension) GetMetadataEntry

func (e Extension) GetMetadataEntry() (string, toc.MetadataEntry)

func (Extension) GetUniqueID

func (e Extension) GetUniqueID() UniqueID

type ExternalProtocol

type ExternalProtocol struct {
	Oid           uint32
	Name          string
	Owner         string
	Trusted       bool   `db:"ptctrusted"`
	ReadFunction  uint32 `db:"ptcreadfn"`
	WriteFunction uint32 `db:"ptcwritefn"`
	Validator     uint32 `db:"ptcvalidatorfn"`
}

func GetExternalProtocols

func GetExternalProtocols(connectionPool *dbconn.DBConn) []ExternalProtocol

func (ExternalProtocol) FQN

func (p ExternalProtocol) FQN() string

func (ExternalProtocol) GetMetadataEntry

func (p ExternalProtocol) GetMetadataEntry() (string, toc.MetadataEntry)

func (ExternalProtocol) GetUniqueID

func (p ExternalProtocol) GetUniqueID() UniqueID

type ExternalTableDefinition

type ExternalTableDefinition struct {
	Oid             uint32
	Type            int
	Protocol        int
	Location        sql.NullString
	ExecLocation    string
	FormatType      string
	FormatOpts      string
	Command         string
	RejectLimit     int
	RejectLimitType string
	ErrTableName    string
	ErrTableSchema  string
	LogErrors       bool
	LogErrPersist   bool
	Encoding        string
	Writable        bool
	URIs            []string
}

type ForeignDataWrapper

type ForeignDataWrapper struct {
	Oid       uint32
	Name      string
	Handler   uint32
	Validator uint32
	Options   string
}

func GetForeignDataWrappers

func GetForeignDataWrappers(connectionPool *dbconn.DBConn) []ForeignDataWrapper

func (ForeignDataWrapper) FQN

func (fdw ForeignDataWrapper) FQN() string

func (ForeignDataWrapper) GetMetadataEntry

func (fdw ForeignDataWrapper) GetMetadataEntry() (string, toc.MetadataEntry)

func (ForeignDataWrapper) GetUniqueID

func (fdw ForeignDataWrapper) GetUniqueID() UniqueID

type ForeignServer

type ForeignServer struct {
	Oid                uint32
	Name               string
	Type               string
	Version            string
	ForeignDataWrapper string
	Options            string
}

func GetForeignServers

func GetForeignServers(connectionPool *dbconn.DBConn) []ForeignServer

func (ForeignServer) FQN

func (fs ForeignServer) FQN() string

func (ForeignServer) GetMetadataEntry

func (fs ForeignServer) GetMetadataEntry() (string, toc.MetadataEntry)

func (ForeignServer) GetUniqueID

func (fs ForeignServer) GetUniqueID() UniqueID

type ForeignTableDefinition

type ForeignTableDefinition struct {
	Oid     uint32 `db:"ftrelid"`
	Options string `db:"ftoptions"`
	Server  string `db:"ftserver"`
}

type Function

type Function struct {
	Oid               uint32
	Schema            string
	Name              string
	ReturnsSet        bool `db:"proretset"`
	FunctionBody      string
	BinaryPath        string
	Arguments         sql.NullString
	IdentArgs         sql.NullString
	ResultType        sql.NullString
	Volatility        string  `db:"provolatile"`
	IsStrict          bool    `db:"proisstrict"`
	IsLeakProof       bool    `db:"proleakproof"`
	IsSecurityDefiner bool    `db:"prosecdef"`
	Config            string  `db:"proconfig"`
	Cost              float32 `db:"procost"`
	NumRows           float32 `db:"prorows"`
	DataAccess        string  `db:"prodataaccess"`
	Language          string
	Kind              string `db:"prokind"`     // GPDB 7+
	PlannerSupport    string `db:"prosupport"`  // GPDB 7+
	IsWindow          bool   `db:"proiswindow"` // before 7
	ExecLocation      string `db:"proexeclocation"`
	Parallel          string `db:"proparallel"` // GPDB 7+
	TransformTypes    string // GPDB 7+
}

func GetFunctions

func GetFunctions(connectionPool *dbconn.DBConn) []Function

func GetFunctions4

func GetFunctions4(connectionPool *dbconn.DBConn) []Function

* In addition to lacking the pg_get_function_* functions, GPDB 4.3 lacks * several columns in pg_proc compared to GPDB 5, so we don't retrieve those.

func GetFunctionsAllVersions

func GetFunctionsAllVersions(connectionPool *dbconn.DBConn) []Function

* The functions pg_get_function_arguments, pg_getfunction_identity_arguments, * and pg_get_function_result were introduced in GPDB 5, so we can use those * functions to retrieve arguments, identity arguments, and return values in * 5 or later but in GPDB 4.3 we must query pg_proc directly and construct * those values here.

func (Function) FQN

func (f Function) FQN() string

func (Function) GetMetadataEntry

func (f Function) GetMetadataEntry() (string, toc.MetadataEntry)

func (Function) GetUniqueID

func (f Function) GetUniqueID() UniqueID

type FunctionInfo

type FunctionInfo struct {
	Oid           uint32
	Name          string
	Schema        string
	QualifiedName string
	Arguments     sql.NullString
	IdentArgs     sql.NullString
	IsInternal    bool
}

func (FunctionInfo) FQN

func (info FunctionInfo) FQN() string

func (FunctionInfo) GetMetadataEntry

func (info FunctionInfo) GetMetadataEntry() (string, toc.MetadataEntry)

type IndexDefinition

type IndexDefinition struct {
	Oid                uint32
	Name               string
	OwningSchema       string
	OwningTable        string
	Tablespace         string
	Def                sql.NullString
	IsClustered        bool
	SupportsConstraint bool
	IsReplicaIdentity  bool
	StatisticsColumns  string
	StatisticsValues   string
	ParentIndex        uint32
	ParentIndexFQN     string
}

func GetIndexes

func GetIndexes(connectionPool *dbconn.DBConn) []IndexDefinition

* GetIndexes queries for all user and implicitly created indexes, since * implicitly created indexes could still have metadata to be backed up. * e.g. comments on implicitly created indexes

func (IndexDefinition) FQN

func (i IndexDefinition) FQN() string

func (IndexDefinition) GetMetadataEntry

func (i IndexDefinition) GetMetadataEntry() (string, toc.MetadataEntry)

func (IndexDefinition) GetUniqueID

func (i IndexDefinition) GetUniqueID() UniqueID

type MetadataMap

type MetadataMap map[UniqueID]ObjectMetadata

func ConstructMetadataMap

func ConstructMetadataMap(results []MetadataQueryStruct) MetadataMap

func GetCommentsForObjectType

func GetCommentsForObjectType(connectionPool *dbconn.DBConn, params MetadataQueryParams) MetadataMap

func GetMetadataForObjectType

func GetMetadataForObjectType(connectionPool *dbconn.DBConn, params MetadataQueryParams) MetadataMap

type MetadataQueryParams

type MetadataQueryParams struct {
	NameField    string
	SchemaField  string
	ObjectType   string
	OidField     string
	ACLField     string
	OwnerField   string
	OidTable     string
	CommentTable string
	CatalogTable string
	FilterClause string
	Shared       bool
}
var (
	TYPE_ACCESS_METHOD      MetadataQueryParams
	TYPE_AGGREGATE          MetadataQueryParams
	TYPE_CAST               MetadataQueryParams
	TYPE_COLLATION          MetadataQueryParams
	TYPE_CONSTRAINT         MetadataQueryParams
	TYPE_CONVERSION         MetadataQueryParams
	TYPE_DATABASE           MetadataQueryParams
	TYPE_EVENTTRIGGER       MetadataQueryParams
	TYPE_EXTENSION          MetadataQueryParams
	TYPE_FOREIGNDATAWRAPPER MetadataQueryParams
	TYPE_FOREIGNSERVER      MetadataQueryParams
	TYPE_FUNCTION           MetadataQueryParams
	TYPE_INDEX              MetadataQueryParams
	TYPE_PROCLANGUAGE       MetadataQueryParams
	TYPE_TRANSFORM          MetadataQueryParams
	TYPE_OPERATOR           MetadataQueryParams
	TYPE_OPERATORCLASS      MetadataQueryParams
	TYPE_OPERATORFAMILY     MetadataQueryParams
	TYPE_PROTOCOL           MetadataQueryParams
	TYPE_RELATION           MetadataQueryParams
	TYPE_RESOURCEGROUP      MetadataQueryParams
	TYPE_RESOURCEQUEUE      MetadataQueryParams
	TYPE_ROLE               MetadataQueryParams
	TYPE_RULE               MetadataQueryParams
	TYPE_SCHEMA             MetadataQueryParams
	TYPE_STATISTIC_EXT      MetadataQueryParams
	TYPE_TABLESPACE         MetadataQueryParams
	TYPE_TSCONFIGURATION    MetadataQueryParams
	TYPE_TSDICTIONARY       MetadataQueryParams
	TYPE_TSPARSER           MetadataQueryParams
	TYPE_TSTEMPLATE         MetadataQueryParams
	TYPE_TRIGGER            MetadataQueryParams
	TYPE_TYPE               MetadataQueryParams
	TYPE_POLICY             MetadataQueryParams
)

type MetadataQueryStruct

type MetadataQueryStruct struct {
	UniqueID
	Name                  string
	ObjectType            string
	Schema                string
	Owner                 string
	Comment               string
	Privileges            sql.NullString
	Kind                  string
	SecurityLabel         string
	SecurityLabelProvider string
}

type ObjectMetadata

type ObjectMetadata struct {
	Privileges            []ACL
	ObjectType            string
	Owner                 string
	Comment               string
	SecurityLabelProvider string
	SecurityLabel         string
}

func (ObjectMetadata) GetCommentStatement

func (obj ObjectMetadata) GetCommentStatement(objectName string, objectType string, owningTable string) string

func (ObjectMetadata) GetOwnerStatement

func (obj ObjectMetadata) GetOwnerStatement(objectName string, objectType string) string

func (ObjectMetadata) GetPrivilegesStatements

func (obj ObjectMetadata) GetPrivilegesStatements(objectName string, objectType string, columnName ...string) string

func (ObjectMetadata) GetSecurityLabelStatement

func (obj ObjectMetadata) GetSecurityLabelStatement(objectName string, objectType string) string

type Operator

type Operator struct {
	Oid              uint32
	Schema           string
	Name             string
	Procedure        string
	LeftArgType      string
	RightArgType     string
	CommutatorOp     string
	NegatorOp        string
	RestrictFunction string
	JoinFunction     string
	CanHash          bool
	CanMerge         bool
}

func GetOperators

func GetOperators(connectionPool *dbconn.DBConn) []Operator

func (Operator) FQN

func (o Operator) FQN() string

func (Operator) GetMetadataEntry

func (o Operator) GetMetadataEntry() (string, toc.MetadataEntry)

func (Operator) GetUniqueID

func (o Operator) GetUniqueID() UniqueID

type OperatorClass

type OperatorClass struct {
	Oid          uint32
	Schema       string
	Name         string
	FamilySchema string
	FamilyName   string
	IndexMethod  string
	Type         string
	Default      bool
	StorageType  string
	Operators    []OperatorClassOperator
	Functions    []OperatorClassFunction
}

func GetOperatorClasses

func GetOperatorClasses(connectionPool *dbconn.DBConn) []OperatorClass

func (OperatorClass) FQN

func (opc OperatorClass) FQN() string

func (OperatorClass) GetMetadataEntry

func (opc OperatorClass) GetMetadataEntry() (string, toc.MetadataEntry)

func (OperatorClass) GetUniqueID

func (opc OperatorClass) GetUniqueID() UniqueID

type OperatorClassFunction

type OperatorClassFunction struct {
	ClassOid      uint32
	SupportNumber int
	FunctionName  string
	LeftType      string `db:"amproclefttype"`
	RightType     string `db:"amprocrighttype"`
}

type OperatorClassOperator

type OperatorClassOperator struct {
	ClassOid       uint32
	StrategyNumber int
	Operator       string
	Recheck        bool
	OrderByFamily  string
}

type OperatorFamily

type OperatorFamily struct {
	Oid         uint32
	Schema      string
	Name        string
	IndexMethod string
}

func GetOperatorFamilies

func GetOperatorFamilies(connectionPool *dbconn.DBConn) []OperatorFamily

func (OperatorFamily) FQN

func (opf OperatorFamily) FQN() string

func (OperatorFamily) GetMetadataEntry

func (opf OperatorFamily) GetMetadataEntry() (string, toc.MetadataEntry)

func (OperatorFamily) GetUniqueID

func (opf OperatorFamily) GetUniqueID() UniqueID

type ParserTokenType

type ParserTokenType struct {
	TokenID uint32
	Alias   string
}

type ParserTokenTypes

type ParserTokenTypes struct {
	// contains filtered or unexported fields
}

func NewParserTokenTypes

func NewParserTokenTypes() *ParserTokenTypes

func (*ParserTokenTypes) TokenName

func (tokenTypes *ParserTokenTypes) TokenName(connectionPool *dbconn.DBConn, parserOid uint32, tokenTypeID uint32) string

type PartitionInfo

type PartitionInfo struct {
	PartitionRuleOid       uint32
	PartitionParentRuleOid uint32
	ParentRelationOid      uint32
	ParentSchema           string
	ParentRelationName     string
	RelationOid            uint32
	PartitionName          string
	PartitionRank          int
	IsExternal             bool
}

func GetExternalPartitionInfo

func GetExternalPartitionInfo(connectionPool *dbconn.DBConn) ([]PartitionInfo, map[uint32]PartitionInfo)

func (PartitionInfo) GetMetadataEntry

func (pi PartitionInfo) GetMetadataEntry() (string, toc.MetadataEntry)

type PartitionLevelInfo

type PartitionLevelInfo struct {
	Oid      uint32
	Level    string
	RootName string
}

type ProceduralLanguage

type ProceduralLanguage struct {
	Oid       uint32
	Name      string
	Owner     string
	IsPl      bool   `db:"lanispl"`
	PlTrusted bool   `db:"lanpltrusted"`
	Handler   uint32 `db:"lanplcallfoid"`
	Inline    uint32 `db:"laninline"`
	Validator uint32 `db:"lanvalidator"`
}

func GetProceduralLanguages

func GetProceduralLanguages(connectionPool *dbconn.DBConn) []ProceduralLanguage

func (ProceduralLanguage) FQN

func (pl ProceduralLanguage) FQN() string

func (ProceduralLanguage) GetMetadataEntry

func (pl ProceduralLanguage) GetMetadataEntry() (string, toc.MetadataEntry)

func (ProceduralLanguage) GetUniqueID

func (pl ProceduralLanguage) GetUniqueID() UniqueID

type RLSPolicy

type RLSPolicy struct {
	Oid        uint32
	Name       string
	Cmd        string
	Permissive string
	Schema     string
	Table      string
	Roles      string
	Qual       string
	WithCheck  string
}

func GetPolicies

func GetPolicies(connectionPool *dbconn.DBConn) []RLSPolicy

func (RLSPolicy) FQN

func (p RLSPolicy) FQN() string

func (RLSPolicy) GetMetadataEntry

func (p RLSPolicy) GetMetadataEntry() (string, toc.MetadataEntry)

func (RLSPolicy) GetUniqueID

func (p RLSPolicy) GetUniqueID() UniqueID

type RangeType

type RangeType struct {
	Oid            uint32
	Schema         string
	Name           string
	SubType        string
	Collation      string
	SubTypeOpClass string
	Canonical      string
	SubTypeDiff    string
}

func GetRangeTypes

func GetRangeTypes(connectionPool *dbconn.DBConn) []RangeType

func (RangeType) FQN

func (t RangeType) FQN() string

func (RangeType) GetMetadataEntry

func (t RangeType) GetMetadataEntry() (string, toc.MetadataEntry)

func (RangeType) GetUniqueID

func (t RangeType) GetUniqueID() UniqueID

type Relation

type Relation struct {
	SchemaOid uint32
	Oid       uint32
	Schema    string
	Name      string
}

func GetForeignTableRelations

func GetForeignTableRelations(connectionPool *dbconn.DBConn) []Relation

func GetIncludedUserTableRelations

func GetIncludedUserTableRelations(connectionPool *dbconn.DBConn, includedRelationsQuoted []string) []Relation

func (Relation) FQN

func (r Relation) FQN() string

func (Relation) GetUniqueID

func (r Relation) GetUniqueID() UniqueID

type ResourceGroup

type ResourceGroup struct {
	Oid               uint32
	Name              string
	Concurrency       string
	CPURateLimit      string
	MemoryLimit       string
	MemorySharedQuota string
	MemorySpillRatio  string
	MemoryAuditor     string
	Cpuset            string
}

func GetResourceGroups

func GetResourceGroups(connectionPool *dbconn.DBConn) []ResourceGroup

func (ResourceGroup) FQN

func (rg ResourceGroup) FQN() string

func (ResourceGroup) GetMetadataEntry

func (rg ResourceGroup) GetMetadataEntry() (string, toc.MetadataEntry)

func (ResourceGroup) GetUniqueID

func (rg ResourceGroup) GetUniqueID() UniqueID

type ResourceQueue

type ResourceQueue struct {
	Oid              uint32
	Name             string
	ActiveStatements int
	MaxCost          string
	CostOvercommit   bool
	MinCost          string
	Priority         string
	MemoryLimit      string
}

func GetResourceQueues

func GetResourceQueues(connectionPool *dbconn.DBConn) []ResourceQueue

func (ResourceQueue) FQN

func (rq ResourceQueue) FQN() string

func (ResourceQueue) GetMetadataEntry

func (rq ResourceQueue) GetMetadataEntry() (string, toc.MetadataEntry)

func (ResourceQueue) GetUniqueID

func (rq ResourceQueue) GetUniqueID() UniqueID

type Role

type Role struct {
	Oid             uint32
	Name            string
	Super           bool `db:"rolsuper"`
	Inherit         bool `db:"rolinherit"`
	CreateRole      bool `db:"rolcreaterole"`
	CreateDB        bool `db:"rolcreatedb"`
	CanLogin        bool `db:"rolcanlogin"`
	Replication     bool `db:"rolreplication"`
	ConnectionLimit int  `db:"rolconnlimit"`
	Password        string
	ValidUntil      string
	ResQueue        string
	ResGroup        string
	Createrexthttp  bool `db:"rolcreaterexthttp"`
	Createrextgpfd  bool `db:"rolcreaterextgpfd"`
	Createwextgpfd  bool `db:"rolcreatewextgpfd"`
	Createrexthdfs  bool `db:"rolcreaterexthdfs"`
	Createwexthdfs  bool `db:"rolcreatewexthdfs"`
	TimeConstraints []TimeConstraint
}

func GetRoles

func GetRoles(connectionPool *dbconn.DBConn) []Role

* We convert rolvaliduntil to UTC and then append '-00' so that * we standardize times to UTC but do not lose time zone information * in the timestamp.

func (Role) FQN

func (r Role) FQN() string

func (Role) GetMetadataEntry

func (r Role) GetMetadataEntry() (string, toc.MetadataEntry)

func (Role) GetUniqueID

func (r Role) GetUniqueID() UniqueID

type RoleGUC

type RoleGUC struct {
	RoleName string
	DbName   string
	Config   string
}

func (RoleGUC) GetMetadataEntry

func (rg RoleGUC) GetMetadataEntry() (string, toc.MetadataEntry)

type RoleMember

type RoleMember struct {
	Role    string
	Member  string
	Grantor string
	IsAdmin bool
}

func GetRoleMembers

func GetRoleMembers(connectionPool *dbconn.DBConn) []RoleMember

func (RoleMember) GetMetadataEntry

func (rm RoleMember) GetMetadataEntry() (string, toc.MetadataEntry)

type RuleDefinition

type RuleDefinition struct {
	Oid          uint32
	Name         string
	OwningSchema string
	OwningTable  string
	Def          sql.NullString
}

func GetRules

func GetRules(connectionPool *dbconn.DBConn) []RuleDefinition

* Rules named "_RETURN", "pg_settings_n", and "pg_settings_u" are * built-in rules and we don't want to back them up. We use two `%` to * prevent Go from interpolating the % symbol.

func (RuleDefinition) FQN

func (r RuleDefinition) FQN() string

func (RuleDefinition) GetMetadataEntry

func (r RuleDefinition) GetMetadataEntry() (string, toc.MetadataEntry)

func (RuleDefinition) GetUniqueID

func (r RuleDefinition) GetUniqueID() UniqueID

type Schema

type Schema struct {
	Oid  uint32
	Name string
}

* All queries in the various queries_*.go files come from one of three sources: * - Copied from pg_dump largely unmodified * - Derived from the output of a psql flag like \d+ or \df * - Constructed from scratch * In the former two cases, a reference to the query source is provided for * further reference. * * All structs in these file whose names begin with "Query" are intended only * for use with the functions immediately following them. Structs in the utils * package (especially Table and Schema) are intended for more general use.

func GetAllUserSchemas

func GetAllUserSchemas(connectionPool *dbconn.DBConn, partitionAlteredSchemas map[string]bool) []Schema

func (Schema) FQN

func (s Schema) FQN() string

func (Schema) GetMetadataEntry

func (s Schema) GetMetadataEntry() (string, toc.MetadataEntry)

func (Schema) GetUniqueID

func (s Schema) GetUniqueID() UniqueID

type Sequence

type Sequence struct {
	Relation
	OwningTableOid          string
	OwningTableSchema       string
	OwningTable             string
	OwningColumn            string
	UnqualifiedOwningColumn string
	OwningColumnAttIdentity string
	IsIdentity              bool
	Definition              SequenceDefinition
}

func GetAllSequences

func GetAllSequences(connectionPool *dbconn.DBConn) []Sequence

func (Sequence) GetMetadataEntry

func (s Sequence) GetMetadataEntry() (string, toc.MetadataEntry)

type SequenceDefinition

type SequenceDefinition struct {
	LastVal     int64
	Type        string
	StartVal    int64
	Increment   int64
	MaxVal      int64
	MinVal      int64
	CacheVal    int64
	IsCycled    bool
	IsCalled    bool
	OwningTable string
}

func GetSequenceDefinition

func GetSequenceDefinition(connectionPool *dbconn.DBConn, seqName string) SequenceDefinition

type SessionGUCs

type SessionGUCs struct {
	ClientEncoding string `db:"client_encoding"`
}

func GetSessionGUCs

func GetSessionGUCs(connectionPool *dbconn.DBConn) SessionGUCs

func (SessionGUCs) GetMetadataEntry

func (sg SessionGUCs) GetMetadataEntry() (string, toc.MetadataEntry)

type ShellType

type ShellType struct {
	Oid    uint32
	Schema string
	Name   string
}

func GetShellTypes

func GetShellTypes(connectionPool *dbconn.DBConn) []ShellType

func (ShellType) FQN

func (t ShellType) FQN() string

func (ShellType) GetMetadataEntry

func (t ShellType) GetMetadataEntry() (string, toc.MetadataEntry)

func (ShellType) GetUniqueID

func (t ShellType) GetUniqueID() UniqueID

type Sortable

type Sortable interface {
	FQN() string
	GetUniqueID() UniqueID
}

func TopologicalSort

func TopologicalSort(slice []Sortable, dependencies DependencyMap) []Sortable

type SortableDependency

type SortableDependency struct {
	ClassID    uint32
	ObjID      uint32
	RefClassID uint32
	RefObjID   uint32
}

type StatisticExt

type StatisticExt struct {
	Oid         uint32
	Name        string
	Namespace   string // namespace that statistics object belongs to
	Owner       string
	TableSchema string // schema that table covered by statistics belongs to
	TableName   string // table covered by statistics
	Definition  string
}

func GetExtendedStatistics

func GetExtendedStatistics(connectionPool *dbconn.DBConn) []StatisticExt

func (StatisticExt) FQN

func (se StatisticExt) FQN() string

func (StatisticExt) GetMetadataEntry

func (se StatisticExt) GetMetadataEntry() (string, toc.MetadataEntry)

func (StatisticExt) GetUniqueID

func (se StatisticExt) GetUniqueID() UniqueID

type Table

type Table struct {
	Relation
	TableDefinition
}

func ConstructDefinitionsForTables

func ConstructDefinitionsForTables(connectionPool *dbconn.DBConn, tableRelations []Relation) []Table

* This function calls all the functions needed to gather the metadata for a * single table and assembles the metadata into ColumnDef and TableDef structs * for more convenient handling in the PrintCreateTableStatement() function.

func FilterTablesForIncremental

func FilterTablesForIncremental(lastBackupTOC, currentTOC *toc.TOC, tables []Table) []Table

func GetBackupDataSet

func GetBackupDataSet(tables []Table) ([]Table, int64)

Remove external/foreign tables from the data backup set

func (Table) GetMetadataEntry

func (t Table) GetMetadataEntry() (string, toc.MetadataEntry)

func (Table) SkipDataBackup

func (t Table) SkipDataBackup() bool

type TableDefinition

type TableDefinition struct {
	DistPolicy              string
	PartDef                 string
	PartTemplateDef         string
	StorageOpts             string
	TablespaceName          string
	ColumnDefs              []ColumnDefinition
	IsExternal              bool
	ExtTableDef             ExternalTableDefinition
	PartitionLevelInfo      PartitionLevelInfo
	TableType               string
	IsUnlogged              bool
	ForeignDef              ForeignTableDefinition
	Inherits                []string
	ReplicaIdentity         string
	PartitionAlteredSchemas []AlteredPartitionRelation
	AccessMethodName        string
	PartitionKeyDef         string
	AttachPartitionInfo     AttachPartitionInfo
	ForceRowSecurity        bool
}

type TableLocks

type TableLocks struct {
	Oid         uint32
	Database    string
	Relation    string
	Mode        string
	Application string
	Granted     string
	User        string
	Pid         string
}

type Tablespace

type Tablespace struct {
	Oid              uint32
	Tablespace       string
	FileLocation     string // FILESPACE in 4.3 and 5, LOCATION in 6 and later
	SegmentLocations []string
	Options          string
}

func GetTablespaces

func GetTablespaces(connectionPool *dbconn.DBConn) []Tablespace

func (Tablespace) FQN

func (t Tablespace) FQN() string

func (Tablespace) GetMetadataEntry

func (t Tablespace) GetMetadataEntry() (string, toc.MetadataEntry)

func (Tablespace) GetUniqueID

func (t Tablespace) GetUniqueID() UniqueID

type TextSearchConfiguration

type TextSearchConfiguration struct {
	Oid          uint32
	Schema       string
	Name         string
	Parser       string
	TokenToDicts map[string][]string
}

func GetTextSearchConfigurations

func GetTextSearchConfigurations(connectionPool *dbconn.DBConn) []TextSearchConfiguration

func (TextSearchConfiguration) FQN

func (tsc TextSearchConfiguration) FQN() string

func (TextSearchConfiguration) GetMetadataEntry

func (tsc TextSearchConfiguration) GetMetadataEntry() (string, toc.MetadataEntry)

func (TextSearchConfiguration) GetUniqueID

func (tsc TextSearchConfiguration) GetUniqueID() UniqueID

type TextSearchDictionary

type TextSearchDictionary struct {
	Oid        uint32
	Schema     string
	Name       string
	Template   string
	InitOption string
}

func GetTextSearchDictionaries

func GetTextSearchDictionaries(connectionPool *dbconn.DBConn) []TextSearchDictionary

func (TextSearchDictionary) FQN

func (tsd TextSearchDictionary) FQN() string

func (TextSearchDictionary) GetMetadataEntry

func (tsd TextSearchDictionary) GetMetadataEntry() (string, toc.MetadataEntry)

func (TextSearchDictionary) GetUniqueID

func (tsd TextSearchDictionary) GetUniqueID() UniqueID

type TextSearchParser

type TextSearchParser struct {
	Oid          uint32
	Schema       string
	Name         string
	StartFunc    string
	TokenFunc    string
	EndFunc      string
	LexTypesFunc string
	HeadlineFunc string
}

func GetTextSearchParsers

func GetTextSearchParsers(connectionPool *dbconn.DBConn) []TextSearchParser

func (TextSearchParser) FQN

func (tsp TextSearchParser) FQN() string

func (TextSearchParser) GetMetadataEntry

func (tsp TextSearchParser) GetMetadataEntry() (string, toc.MetadataEntry)

func (TextSearchParser) GetUniqueID

func (tsp TextSearchParser) GetUniqueID() UniqueID

type TextSearchTemplate

type TextSearchTemplate struct {
	Oid        uint32
	Schema     string
	Name       string
	InitFunc   string
	LexizeFunc string
}

func GetTextSearchTemplates

func GetTextSearchTemplates(connectionPool *dbconn.DBConn) []TextSearchTemplate

func (TextSearchTemplate) FQN

func (tst TextSearchTemplate) FQN() string

func (TextSearchTemplate) GetMetadataEntry

func (tst TextSearchTemplate) GetMetadataEntry() (string, toc.MetadataEntry)

func (TextSearchTemplate) GetUniqueID

func (tst TextSearchTemplate) GetUniqueID() UniqueID

type TimeConstraint

type TimeConstraint struct {
	Oid       uint32
	StartDay  int
	StartTime string
	EndDay    int
	EndTime   string
}

type Transform

type Transform struct {
	Oid           uint32
	TypeNamespace string `db:"typnamespace"`
	TypeName      string `db:"typname"`
	LanguageName  string `db:"lanname"`
	FromSQLFunc   uint32 `db:"trffromsql"`
	ToSQLFunc     uint32 `db:"trftosql"`
}

func GetTransforms

func GetTransforms(connectionPool *dbconn.DBConn) []Transform

func (Transform) FQN

func (trf Transform) FQN() string

func (Transform) GetMetadataEntry

func (trf Transform) GetMetadataEntry() (string, toc.MetadataEntry)

func (Transform) GetUniqueID

func (trf Transform) GetUniqueID() UniqueID

type TriggerDefinition

type TriggerDefinition RuleDefinition

func GetTriggers

func GetTriggers(connectionPool *dbconn.DBConn) []TriggerDefinition

func (TriggerDefinition) FQN

func (t TriggerDefinition) FQN() string

func (TriggerDefinition) GetMetadataEntry

func (t TriggerDefinition) GetMetadataEntry() (string, toc.MetadataEntry)

func (TriggerDefinition) GetUniqueID

func (t TriggerDefinition) GetUniqueID() UniqueID

type TupleStatistic

type TupleStatistic struct {
	Oid       uint32
	Schema    string
	Table     string
	RelPages  int
	RelTuples float64
}

type TypeMapping

type TypeMapping struct {
	ConfigOid  uint32 `db:"mapcfg"`
	TokenType  uint32 `db:"maptokentype"`
	Dictionary string `db:"mapdictname"`
}

type UniqueID

type UniqueID struct {
	ClassID uint32
	Oid     uint32
}

type UserMapping

type UserMapping struct {
	Oid     uint32
	User    string
	Server  string
	Options string
}

func GetUserMappings

func GetUserMappings(connectionPool *dbconn.DBConn) []UserMapping

func (UserMapping) FQN

func (um UserMapping) FQN() string

func (UserMapping) GetMetadataEntry

func (um UserMapping) GetMetadataEntry() (string, toc.MetadataEntry)

func (UserMapping) GetUniqueID

func (um UserMapping) GetUniqueID() UniqueID

type View

type View struct {
	Oid            uint32
	Schema         string
	Name           string
	Options        string
	Definition     sql.NullString
	Tablespace     string
	IsMaterialized bool
	DistPolicy     string
}

func GetAllViews

func GetAllViews(connectionPool *dbconn.DBConn) []View

This function retrieves both regular views and materialized views.

func (View) FQN

func (v View) FQN() string

func (View) GetMetadataEntry

func (v View) GetMetadataEntry() (string, toc.MetadataEntry)

func (View) GetUniqueID

func (v View) GetUniqueID() UniqueID

func (View) ObjectType

func (v View) ObjectType() string

Jump to

Keyboard shortcuts

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