PostgreSQL Source Code
git master
|
#include "postgres_fe.h"
#include <unistd.h>
#include <ctype.h>
#include <limits.h>
#include "access/attnum.h"
#include "access/sysattr.h"
#include "access/transam.h"
#include "catalog/pg_aggregate_d.h"
#include "catalog/pg_am_d.h"
#include "catalog/pg_attribute_d.h"
#include "catalog/pg_authid_d.h"
#include "catalog/pg_cast_d.h"
#include "catalog/pg_class_d.h"
#include "catalog/pg_default_acl_d.h"
#include "catalog/pg_largeobject_d.h"
#include "catalog/pg_largeobject_metadata_d.h"
#include "catalog/pg_proc_d.h"
#include "catalog/pg_subscription.h"
#include "catalog/pg_trigger_d.h"
#include "catalog/pg_type_d.h"
#include "common/connect.h"
#include "common/int.h"
#include "common/relpath.h"
#include "compress_io.h"
#include "dumputils.h"
#include "fe_utils/option_utils.h"
#include "fe_utils/string_utils.h"
#include "filter.h"
#include "getopt_long.h"
#include "libpq/libpq-fs.h"
#include "parallel.h"
#include "pg_backup_db.h"
#include "pg_backup_utils.h"
#include "pg_dump.h"
#include "storage/block.h"
Go to the source code of this file.
Data Structures | |
struct | RoleNameItem |
struct | CommentItem |
struct | SecLabelItem |
struct | BinaryUpgradeClassOidItem |
struct | SequenceItem |
Macros | |
#define | DUMP_DEFAULT_ROWS_PER_INSERT 1 |
#define | MAX_BLOBS_PER_ARCHIVE_ENTRY 1000 |
#define | fmtQualifiedDumpable(obj) |
Typedefs | |
typedef enum SeqType | SeqType |
typedef enum OidOptions | OidOptions |
Enumerations | |
enum | SeqType { SEQTYPE_SMALLINT , SEQTYPE_INTEGER , SEQTYPE_BIGINT } |
enum | OidOptions { zeroIsError = 1 , zeroAsStar = 2 , zeroAsNone = 4 } |
Functions | |
StaticAssertDecl (lengthof(SeqTypeNames)==(SEQTYPE_BIGINT+1), "array length mismatch") | |
static void | help (const char *progname) |
static void | setup_connection (Archive *AH, const char *dumpencoding, const char *dumpsnapshot, char *use_role) |
static ArchiveFormat | parseArchiveFormat (const char *format, ArchiveMode *mode) |
static void | expand_schema_name_patterns (Archive *fout, SimpleStringList *patterns, SimpleOidList *oids, bool strict_names) |
static void | expand_extension_name_patterns (Archive *fout, SimpleStringList *patterns, SimpleOidList *oids, bool strict_names) |
static void | expand_foreign_server_name_patterns (Archive *fout, SimpleStringList *patterns, SimpleOidList *oids) |
static void | expand_table_name_patterns (Archive *fout, SimpleStringList *patterns, SimpleOidList *oids, bool strict_names, bool with_child_tables) |
static void | prohibit_crossdb_refs (PGconn *conn, const char *dbname, const char *pattern) |
static NamespaceInfo * | findNamespace (Oid nsoid) |
static void | dumpTableData (Archive *fout, const TableDataInfo *tdinfo) |
static void | refreshMatViewData (Archive *fout, const TableDataInfo *tdinfo) |
static const char * | getRoleName (const char *roleoid_str) |
static void | collectRoleNames (Archive *fout) |
static void | getAdditionalACLs (Archive *fout) |
static void | dumpCommentExtended (Archive *fout, const char *type, const char *name, const char *namespace, const char *owner, CatalogId catalogId, int subid, DumpId dumpId, const char *initdb_comment) |
static void | dumpComment (Archive *fout, const char *type, const char *name, const char *namespace, const char *owner, CatalogId catalogId, int subid, DumpId dumpId) |
static int | findComments (Oid classoid, Oid objoid, CommentItem **items) |
static void | collectComments (Archive *fout) |
static void | dumpSecLabel (Archive *fout, const char *type, const char *name, const char *namespace, const char *owner, CatalogId catalogId, int subid, DumpId dumpId) |
static int | findSecLabels (Oid classoid, Oid objoid, SecLabelItem **items) |
static void | collectSecLabels (Archive *fout) |
static void | dumpDumpableObject (Archive *fout, DumpableObject *dobj) |
static void | dumpNamespace (Archive *fout, const NamespaceInfo *nspinfo) |
static void | dumpExtension (Archive *fout, const ExtensionInfo *extinfo) |
static void | dumpType (Archive *fout, const TypeInfo *tyinfo) |
static void | dumpBaseType (Archive *fout, const TypeInfo *tyinfo) |
static void | dumpEnumType (Archive *fout, const TypeInfo *tyinfo) |
static void | dumpRangeType (Archive *fout, const TypeInfo *tyinfo) |
static void | dumpUndefinedType (Archive *fout, const TypeInfo *tyinfo) |
static void | dumpDomain (Archive *fout, const TypeInfo *tyinfo) |
static void | dumpCompositeType (Archive *fout, const TypeInfo *tyinfo) |
static void | dumpCompositeTypeColComments (Archive *fout, const TypeInfo *tyinfo, PGresult *res) |
static void | dumpShellType (Archive *fout, const ShellTypeInfo *stinfo) |
static void | dumpProcLang (Archive *fout, const ProcLangInfo *plang) |
static void | dumpFunc (Archive *fout, const FuncInfo *finfo) |
static void | dumpCast (Archive *fout, const CastInfo *cast) |
static void | dumpTransform (Archive *fout, const TransformInfo *transform) |
static void | dumpOpr (Archive *fout, const OprInfo *oprinfo) |
static void | dumpAccessMethod (Archive *fout, const AccessMethodInfo *aminfo) |
static void | dumpOpclass (Archive *fout, const OpclassInfo *opcinfo) |
static void | dumpOpfamily (Archive *fout, const OpfamilyInfo *opfinfo) |
static void | dumpCollation (Archive *fout, const CollInfo *collinfo) |
static void | dumpConversion (Archive *fout, const ConvInfo *convinfo) |
static void | dumpRule (Archive *fout, const RuleInfo *rinfo) |
static void | dumpAgg (Archive *fout, const AggInfo *agginfo) |
static void | dumpTrigger (Archive *fout, const TriggerInfo *tginfo) |
static void | dumpEventTrigger (Archive *fout, const EventTriggerInfo *evtinfo) |
static void | dumpTable (Archive *fout, const TableInfo *tbinfo) |
static void | dumpTableSchema (Archive *fout, const TableInfo *tbinfo) |
static void | dumpTableAttach (Archive *fout, const TableAttachInfo *attachinfo) |
static void | dumpAttrDef (Archive *fout, const AttrDefInfo *adinfo) |
static void | collectSequences (Archive *fout) |
static void | dumpSequence (Archive *fout, const TableInfo *tbinfo) |
static void | dumpSequenceData (Archive *fout, const TableDataInfo *tdinfo) |
static void | dumpIndex (Archive *fout, const IndxInfo *indxinfo) |
static void | dumpIndexAttach (Archive *fout, const IndexAttachInfo *attachinfo) |
static void | dumpStatisticsExt (Archive *fout, const StatsExtInfo *statsextinfo) |
static void | dumpConstraint (Archive *fout, const ConstraintInfo *coninfo) |
static void | dumpTableConstraintComment (Archive *fout, const ConstraintInfo *coninfo) |
static void | dumpTSParser (Archive *fout, const TSParserInfo *prsinfo) |
static void | dumpTSDictionary (Archive *fout, const TSDictInfo *dictinfo) |
static void | dumpTSTemplate (Archive *fout, const TSTemplateInfo *tmplinfo) |
static void | dumpTSConfig (Archive *fout, const TSConfigInfo *cfginfo) |
static void | dumpForeignDataWrapper (Archive *fout, const FdwInfo *fdwinfo) |
static void | dumpForeignServer (Archive *fout, const ForeignServerInfo *srvinfo) |
static void | dumpUserMappings (Archive *fout, const char *servername, const char *namespace, const char *owner, CatalogId catalogId, DumpId dumpId) |
static void | dumpDefaultACL (Archive *fout, const DefaultACLInfo *daclinfo) |
static DumpId | dumpACL (Archive *fout, DumpId objDumpId, DumpId altDumpId, const char *type, const char *name, const char *subname, const char *nspname, const char *tag, const char *owner, const DumpableAcl *dacl) |
static void | getDependencies (Archive *fout) |
static void | BuildArchiveDependencies (Archive *fout) |
static void | findDumpableDependencies (ArchiveHandle *AH, const DumpableObject *dobj, DumpId **dependencies, int *nDeps, int *allocDeps) |
static DumpableObject * | createBoundaryObjects (void) |
static void | addBoundaryDependencies (DumpableObject **dobjs, int numObjs, DumpableObject *boundaryObjs) |
static void | addConstrChildIdxDeps (DumpableObject *dobj, const IndxInfo *refidx) |
static void | getDomainConstraints (Archive *fout, TypeInfo *tyinfo) |
static void | getTableData (DumpOptions *dopt, TableInfo *tblinfo, int numTables, char relkind) |
static void | makeTableDataInfo (DumpOptions *dopt, TableInfo *tbinfo) |
static void | buildMatViewRefreshDependencies (Archive *fout) |
static void | getTableDataFKConstraints (void) |
static char * | format_function_arguments (const FuncInfo *finfo, const char *funcargs, bool is_agg) |
static char * | format_function_signature (Archive *fout, const FuncInfo *finfo, bool honor_quotes) |
static char * | convertRegProcReference (const char *proc) |
static char * | getFormattedOperatorName (const char *oproid) |
static char * | convertTSFunction (Archive *fout, Oid funcOid) |
static const char * | getFormattedTypeName (Archive *fout, Oid oid, OidOptions opts) |
static void | getLOs (Archive *fout) |
static void | dumpLO (Archive *fout, const LoInfo *loinfo) |
static int | dumpLOs (Archive *fout, const void *arg) |
static void | dumpPolicy (Archive *fout, const PolicyInfo *polinfo) |
static void | dumpPublication (Archive *fout, const PublicationInfo *pubinfo) |
static void | dumpPublicationTable (Archive *fout, const PublicationRelInfo *pubrinfo) |
static void | dumpSubscription (Archive *fout, const SubscriptionInfo *subinfo) |
static void | dumpSubscriptionTable (Archive *fout, const SubRelInfo *subrinfo) |
static void | dumpDatabase (Archive *fout) |
static void | dumpDatabaseConfig (Archive *AH, PQExpBuffer outbuf, const char *dbname, Oid dboid) |
static void | dumpEncoding (Archive *AH) |
static void | dumpStdStrings (Archive *AH) |
static void | dumpSearchPath (Archive *AH) |
static void | binary_upgrade_set_type_oids_by_type_oid (Archive *fout, PQExpBuffer upgrade_buffer, Oid pg_type_oid, bool force_array_type, bool include_multirange_type) |
static void | binary_upgrade_set_type_oids_by_rel (Archive *fout, PQExpBuffer upgrade_buffer, const TableInfo *tbinfo) |
static void | collectBinaryUpgradeClassOids (Archive *fout) |
static void | binary_upgrade_set_pg_class_oids (Archive *fout, PQExpBuffer upgrade_buffer, Oid pg_class_oid) |
static void | binary_upgrade_extension_member (PQExpBuffer upgrade_buffer, const DumpableObject *dobj, const char *objtype, const char *objname, const char *objnamespace) |
static const char * | getAttrName (int attrnum, const TableInfo *tblInfo) |
static const char * | fmtCopyColumnList (const TableInfo *ti, PQExpBuffer buffer) |
static bool | nonemptyReloptions (const char *reloptions) |
static void | appendReloptionsArrayAH (PQExpBuffer buffer, const char *reloptions, const char *prefix, Archive *fout) |
static char * | get_synchronized_snapshot (Archive *fout) |
static void | set_restrict_relation_kind (Archive *AH, const char *value) |
static void | setupDumpWorker (Archive *AH) |
static TableInfo * | getRootTableInfo (const TableInfo *tbinfo) |
static bool | forcePartitionRootLoad (const TableInfo *tbinfo) |
static void | read_dump_filters (const char *filename, DumpOptions *dopt) |
int | main (int argc, char **argv) |
static bool | checkExtensionMembership (DumpableObject *dobj, Archive *fout) |
static void | selectDumpableNamespace (NamespaceInfo *nsinfo, Archive *fout) |
static void | selectDumpableTable (TableInfo *tbinfo, Archive *fout) |
static void | selectDumpableType (TypeInfo *tyinfo, Archive *fout) |
static void | selectDumpableDefaultACL (DefaultACLInfo *dinfo, DumpOptions *dopt) |
static void | selectDumpableCast (CastInfo *cast, Archive *fout) |
static void | selectDumpableProcLang (ProcLangInfo *plang, Archive *fout) |
static void | selectDumpableAccessMethod (AccessMethodInfo *method, Archive *fout) |
static void | selectDumpableExtension (ExtensionInfo *extinfo, DumpOptions *dopt) |
static void | selectDumpablePublicationObject (DumpableObject *dobj, Archive *fout) |
static void | selectDumpableStatisticsObject (StatsExtInfo *sobj, Archive *fout) |
static void | selectDumpableObject (DumpableObject *dobj, Archive *fout) |
static int | dumpTableData_copy (Archive *fout, const void *dcontext) |
static int | dumpTableData_insert (Archive *fout, const void *dcontext) |
void | getPolicies (Archive *fout, TableInfo tblinfo[], int numTables) |
void | getPublications (Archive *fout) |
void | getPublicationNamespaces (Archive *fout) |
void | getPublicationTables (Archive *fout, TableInfo tblinfo[], int numTables) |
static void | dumpPublicationNamespace (Archive *fout, const PublicationSchemaInfo *pubsinfo) |
static bool | is_superuser (Archive *fout) |
void | getSubscriptions (Archive *fout) |
void | getSubscriptionTables (Archive *fout) |
static void | append_depends_on_extension (Archive *fout, PQExpBuffer create, const DumpableObject *dobj, const char *catalog, const char *keyword, const char *objname) |
static Oid | get_next_possible_free_pg_type_oid (Archive *fout, PQExpBuffer upgrade_query) |
static int | BinaryUpgradeClassOidItemCmp (const void *p1, const void *p2) |
void | getNamespaces (Archive *fout) |
ExtensionInfo * | getExtensions (Archive *fout, int *numExtensions) |
void | getTypes (Archive *fout) |
void | getOperators (Archive *fout) |
void | getCollations (Archive *fout) |
void | getConversions (Archive *fout) |
void | getAccessMethods (Archive *fout) |
void | getOpclasses (Archive *fout) |
void | getOpfamilies (Archive *fout) |
void | getAggregates (Archive *fout) |
void | getFuncs (Archive *fout) |
TableInfo * | getTables (Archive *fout, int *numTables) |
void | getOwnedSeqs (Archive *fout, TableInfo tblinfo[], int numTables) |
InhInfo * | getInherits (Archive *fout, int *numInherits) |
void | getPartitioningInfo (Archive *fout) |
void | getIndexes (Archive *fout, TableInfo tblinfo[], int numTables) |
void | getExtendedStatistics (Archive *fout) |
void | getConstraints (Archive *fout, TableInfo tblinfo[], int numTables) |
void | getRules (Archive *fout) |
void | getTriggers (Archive *fout, TableInfo tblinfo[], int numTables) |
void | getEventTriggers (Archive *fout) |
void | getProcLangs (Archive *fout) |
void | getCasts (Archive *fout) |
static char * | get_language_name (Archive *fout, Oid langid) |
void | getTransforms (Archive *fout) |
void | getTableAttrs (Archive *fout, TableInfo *tblinfo, int numTables) |
bool | shouldPrintColumn (const DumpOptions *dopt, const TableInfo *tbinfo, int colno) |
void | getTSParsers (Archive *fout) |
void | getTSDictionaries (Archive *fout) |
void | getTSTemplates (Archive *fout) |
void | getTSConfigurations (Archive *fout) |
void | getForeignDataWrappers (Archive *fout) |
void | getForeignServers (Archive *fout) |
void | getDefaultACLs (Archive *fout) |
static void | dumpTableComment (Archive *fout, const TableInfo *tbinfo, const char *reltypename) |
static char * | format_aggregate_signature (const AggInfo *agginfo, Archive *fout, bool honor_quotes) |
static void | dumpTableSecLabel (Archive *fout, const TableInfo *tbinfo, const char *reltypename) |
static PQExpBuffer | createViewAsClause (Archive *fout, const TableInfo *tbinfo) |
static PQExpBuffer | createDummyViewAsClause (Archive *fout, const TableInfo *tbinfo) |
static SeqType | parse_sequence_type (const char *name) |
static int | SequenceItemCmp (const void *p1, const void *p2) |
void | getExtensionMembership (Archive *fout, ExtensionInfo extinfo[], int numExtensions) |
void | processExtensionTables (Archive *fout, ExtensionInfo extinfo[], int numExtensions) |
#define fmtQualifiedDumpable | ( | obj | ) |
typedef enum OidOptions OidOptions |
enum OidOptions |
enum SeqType |
|
static |
Definition at line 18616 of file pg_dump.c.
References addObjectDependency(), DO_ACCESS_METHOD, DO_AGG, DO_ATTRDEF, DO_CAST, DO_COLLATION, DO_CONSTRAINT, DO_CONVERSION, DO_DEFAULT_ACL, DO_DUMMY_TYPE, DO_EVENT_TRIGGER, DO_EXTENSION, DO_FDW, DO_FK_CONSTRAINT, DO_FOREIGN_SERVER, DO_FUNC, DO_INDEX, DO_INDEX_ATTACH, DO_LARGE_OBJECT, DO_LARGE_OBJECT_DATA, DO_NAMESPACE, DO_OPCLASS, DO_OPERATOR, DO_OPFAMILY, DO_POLICY, DO_POST_DATA_BOUNDARY, DO_PRE_DATA_BOUNDARY, DO_PROCLANG, DO_PUBLICATION, DO_PUBLICATION_REL, DO_PUBLICATION_TABLE_IN_SCHEMA, DO_REFRESH_MATVIEW, DO_RULE, DO_SEQUENCE_SET, DO_SHELL_TYPE, DO_STATSEXT, DO_SUBSCRIPTION, DO_SUBSCRIPTION_REL, DO_TABLE, DO_TABLE_ATTACH, DO_TABLE_DATA, DO_TRANSFORM, DO_TRIGGER, DO_TSCONFIG, DO_TSDICT, DO_TSPARSER, DO_TSTEMPLATE, DO_TYPE, _dumpableObject::dumpId, i, and _dumpableObject::objType.
Referenced by main().
|
static |
Definition at line 7961 of file pg_dump.c.
References addObjectDependency(), Assert, DO_FK_CONSTRAINT, _indexAttachInfo::dobj, _dumpableObject::dumpId, SimplePtrList::head, SimplePtrListCell::next, _dumpableObject::objType, _indxInfo::partattaches, _indexAttachInfo::partitionIdx, and SimplePtrListCell::ptr.
Referenced by getConstraints().
|
static |
Definition at line 5331 of file pg_dump.c.
References appendPQExpBuffer(), _dumpableObject::catId, createPQExpBuffer(), PQExpBufferData::data, _dumpableObject::depends_on_ext, destroyPQExpBuffer(), ExecuteSqlQuery(), fmtId(), i, CatalogId::oid, pg_free(), pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQfnumber(), PQgetvalue(), PQntuples(), and res.
Referenced by dumpConstraint(), dumpFunc(), dumpIndex(), dumpTableSchema(), and dumpTrigger().
|
static |
Definition at line 18933 of file pg_dump.c.
References appendReloptionsArray(), Archive::encoding, pg_log_warning, res, and Archive::std_strings.
Referenced by dumpConstraint(), dumpRule(), and dumpTableSchema().
|
static |
Definition at line 5642 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), _dumpableObject::dependencies, DO_EXTENSION, _dumpableObject::ext_member, findObjectByDumpId(), fmtId(), i, _dumpableObject::name, _dumpableObject::nDeps, _dumpableObject::objType, and pg_fatal.
Referenced by dumpAccessMethod(), dumpAgg(), dumpBaseType(), dumpCast(), dumpCollation(), dumpCompositeType(), dumpConversion(), dumpDomain(), dumpEnumType(), dumpEventTrigger(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpNamespace(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpProcLang(), dumpRangeType(), dumpSequence(), dumpTableSchema(), dumpTransform(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), and dumpUndefinedType().
|
static |
Definition at line 5552 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), Assert, BinaryUpgradeClassOidItemCmp(), binaryUpgradeClassOids, sort-test::key, nbinaryUpgradeClassOids, OidIsValid, BinaryUpgradeClassOidItem::relfilenumber, RelFileNumberIsValid, BinaryUpgradeClassOidItem::relkind, BinaryUpgradeClassOidItem::toast_index_oid, BinaryUpgradeClassOidItem::toast_index_relfilenumber, BinaryUpgradeClassOidItem::toast_oid, and BinaryUpgradeClassOidItem::toast_relfilenumber.
Referenced by dumpCompositeType(), dumpConstraint(), dumpIndex(), dumpSequence(), and dumpTableSchema().
|
static |
Definition at line 5487 of file pg_dump.c.
References binary_upgrade_set_type_oids_by_type_oid(), OidIsValid, and _tableInfo::reltype.
Referenced by dumpTableSchema().
|
static |
Definition at line 5407 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), atooid, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), ExecuteSqlQueryForSingleRow(), findTypeByOid(), get_next_possible_free_pg_type_oid(), InvalidOid, OidIsValid, PQclear(), PQfnumber(), PQgetvalue(), printfPQExpBuffer(), Archive::remoteVersion, res, and tinfo.
Referenced by binary_upgrade_set_type_oids_by_rel(), dumpBaseType(), dumpCompositeType(), dumpDomain(), dumpEnumType(), dumpRangeType(), dumpShellType(), and dumpUndefinedType().
|
static |
Definition at line 5502 of file pg_dump.c.
References BinaryUpgradeClassOidItem::oid, p2, and pg_cmp_u32().
Referenced by binary_upgrade_set_pg_class_oids().
|
static |
Definition at line 18732 of file pg_dump.c.
References _tocEntry::dependencies, _tocEntry::dumpId, findDumpableDependencies(), findObjectByDumpId(), free, _tocEntry::nDeps, _dumpableObject::nDeps, _tocEntry::next, pg_malloc(), pg_realloc(), _tocEntry::reqs, and _archiveHandle::toc.
Referenced by main().
|
static |
Definition at line 2927 of file pg_dump.c.
References addObjectDependency(), appendPQExpBufferStr(), Assert, atooid, CppAsString2, createPQExpBuffer(), PQExpBufferData::data, _tableInfo::dataObj, destroyPQExpBuffer(), DO_REFRESH_MATVIEW, DO_TABLE, _dumpableObject::dumpId, ExecuteSqlQuery(), findObjectByCatalogId(), i, if(), _dumpableObject::objType, CatalogId::oid, PGRES_TUPLES_OK, PQclear(), PQfnumber(), PQgetvalue(), PQntuples(), _tableInfo::relispopulated, _tableInfo::relkind, Archive::remoteVersion, res, and CatalogId::tableoid.
Referenced by main().
|
static |
Definition at line 1772 of file pg_dump.c.
References addObjectDependency(), _dumpOptions::binary_upgrade, _dumpableObject::catId, _extensionInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_ACL, DUMP_COMPONENT_NONE, _dumpableObject::dump_contains, _dumpableObject::dumpId, _dumpableObject::ext_member, findOwningExtension(), and Archive::remoteVersion.
Referenced by selectDumpableAccessMethod(), selectDumpableCast(), selectDumpableNamespace(), selectDumpableObject(), selectDumpableProcLang(), selectDumpablePublicationObject(), selectDumpableStatisticsObject(), selectDumpableTable(), and selectDumpableType().
|
static |
Definition at line 5518 of file pg_dump.c.
References atooid, binaryUpgradeClassOids, ExecuteSqlQuery(), i, nbinaryUpgradeClassOids, BinaryUpgradeClassOidItem::oid, pg_malloc(), PGRES_TUPLES_OK, PQclear(), PQgetvalue(), PQntuples(), BinaryUpgradeClassOidItem::relfilenumber, BinaryUpgradeClassOidItem::relkind, res, BinaryUpgradeClassOidItem::toast_index_oid, BinaryUpgradeClassOidItem::toast_index_relfilenumber, BinaryUpgradeClassOidItem::toast_oid, and BinaryUpgradeClassOidItem::toast_relfilenumber.
Referenced by main().
|
static |
Definition at line 10313 of file pg_dump.c.
References appendPQExpBufferStr(), atooid, _dumpableObject::catId, CommentItem::classoid, comments, _dumpableObject::components, createPQExpBuffer(), PQExpBufferData::data, CommentItem::descr, destroyPQExpBuffer(), DO_TABLE, _typeInfo::dobj, DUMP_COMPONENT_COMMENT, ExecuteSqlQuery(), findObjectByCatalogId(), findTypeByOid(), i, ncomments, CommentItem::objoid, CommentItem::objsubid, _dumpableObject::objType, CatalogId::oid, pg_malloc(), pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQfnumber(), PQgetvalue(), PQntuples(), res, and CatalogId::tableoid.
Referenced by main().
|
static |
Definition at line 9858 of file pg_dump.c.
References atooid, ExecuteSqlQuery(), i, nrolenames, pg_malloc(), pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQgetvalue(), PQntuples(), res, RoleNameItem::rolename, rolenames, and RoleNameItem::roleoid.
Referenced by main().
|
static |
Definition at line 15455 of file pg_dump.c.
References appendPQExpBufferStr(), atooid, _dumpableObject::catId, SecLabelItem::classoid, _dumpableObject::components, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), DO_TABLE, _typeInfo::dobj, DUMP_COMPONENT_SECLABEL, ExecuteSqlQuery(), findObjectByCatalogId(), findTypeByOid(), i, SecLabelItem::label, nseclabels, SecLabelItem::objoid, SecLabelItem::objsubid, _dumpableObject::objType, CatalogId::oid, pg_malloc(), pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQfnumber(), PQgetvalue(), PQntuples(), SecLabelItem::provider, res, seclabels, and CatalogId::tableoid.
Referenced by main().
|
static |
Definition at line 17395 of file pg_dump.c.
References atooid, SequenceItem::cache, SequenceItem::cycled, Archive::dopt, ExecuteSqlQuery(), i, SequenceItem::incby, SequenceItem::is_called, SequenceItem::last_value, SequenceItem::maxv, SequenceItem::minv, nsequences, SequenceItem::oid, parse_sequence_type(), pg_malloc(), PGRES_TUPLES_OK, PQclear(), PQgetvalue(), PQntuples(), Archive::remoteVersion, res, _dumpOptions::schemaOnly, SequenceItem::seqtype, _dumpOptions::sequence_data, sequences, SequenceItem::startv, and strtoi64.
Referenced by main().
|
static |
Definition at line 13005 of file pg_dump.c.
References name, and pg_strdup().
Referenced by dumpOpr().
Definition at line 13076 of file pg_dump.c.
References ExecuteSqlQueryForSingleRow(), pg_strdup(), PQclear(), PQgetvalue(), res, and snprintf.
Referenced by dumpTSParser(), and dumpTSTemplate().
|
static |
Definition at line 18592 of file pg_dump.c.
References AssignDumpId(), _dumpableObject::catId, DO_POST_DATA_BOUNDARY, DO_PRE_DATA_BOUNDARY, _dumpableObject::name, nilCatalogId, _dumpableObject::objType, pg_malloc(), and pg_strdup().
Referenced by main().
|
static |
Definition at line 15730 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), _tableInfo::attcollation, _tableInfo::attnames, _tableInfo::atttypnames, createPQExpBuffer(), findCollationByOid(), fmtId(), fmtQualifiedDumpable, j, _tableInfo::numatts, and OidIsValid.
Referenced by dumpRule(), and dumpTableSchema().
|
static |
Definition at line 15681 of file pg_dump.c.
References appendBinaryPQExpBuffer(), appendPQExpBuffer(), Assert, _dumpableObject::catId, createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), _tableInfo::dobj, ExecuteSqlQuery(), len, _dumpableObject::name, CatalogId::oid, pg_fatal, PGRES_TUPLES_OK, PQclear(), PQgetlength(), PQgetvalue(), PQntuples(), and res.
Referenced by dumpRule(), and dumpTableSchema().
|
static |
Definition at line 13098 of file pg_dump.c.
References _accessMethodInfo::amhandler, _accessMethodInfo::amtype, appendPQExpBuffer(), appendPQExpBufferStr(), ARCHIVE_OPTS, ArchiveEntry(), _dumpOptions::binary_upgrade, binary_upgrade_extension_member(), _dumpableObject::catId, createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), _accessMethodInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, dumpComment(), _dumpableObject::dumpId, fmtId(), free, _dumpableObject::name, pg_log_warning, pg_strdup(), and SECTION_PRE_DATA.
Referenced by dumpDumpableObject().
|
static |
Definition at line 15086 of file pg_dump.c.
References _dumpableAcl::acl, acldefault(), _dumpableAcl::acldefault, _dumpOptions::aclsSkip, appendPQExpBuffer(), appendPQExpBufferStr(), ARCHIVE_OPTS, ArchiveEntry(), _dumpOptions::binary_upgrade, buildACLCommands(), createDumpId(), createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), Archive::dopt, _dumpableAcl::initprivs, InvalidDumpId, PQExpBufferData::len, name, nilCatalogId, pg_fatal, _dumpableAcl::privtype, Archive::remoteVersion, SECTION_NONE, subname, and type.
Referenced by dumpAgg(), dumpBaseType(), dumpCompositeType(), dumpDatabase(), dumpDomain(), dumpEnumType(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpLO(), dumpNamespace(), dumpProcLang(), dumpRangeType(), dumpTable(), and dumpUndefinedType().
Definition at line 14051 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralAH, ARCHIVE_OPTS, ArchiveEntry(), _dumpOptions::binary_upgrade, binary_upgrade_extension_member(), createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), Archive::dopt, DUMP_COMPONENT_ACL, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, DUMP_COMPONENT_SECLABEL, dumpACL(), dumpComment(), dumpSecLabel(), ExecuteSqlQueryForSingleRow(), ExecuteSqlStatement(), fmtId(), format_aggregate_signature(), format_function_arguments(), format_function_signature(), free, getFormattedOperatorName(), InvalidDumpId, Archive::is_prepared, pg_fatal, PQclear(), PQfnumber(), PQgetisnull(), PQgetvalue(), PREPQUERY_DUMPAGG, printfPQExpBuffer(), Archive::remoteVersion, res, and SECTION_PRE_DATA.
Referenced by dumpDumpableObject().
|
static |
Definition at line 16705 of file pg_dump.c.
References _attrDefInfo::adef_expr, _attrDefInfo::adnum, _attrDefInfo::adtable, appendPQExpBuffer(), ARCHIVE_OPTS, ArchiveEntry(), _tableInfo::attnames, _dumpableObject::catId, createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), _tableInfo::dobj, _attrDefInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_DEFINITION, _dumpableObject::dumpId, fmtId(), fmtQualifiedDumpable, free, _dumpableObject::name, pg_strdup(), psprintf(), _tableInfo::relkind, _tableInfo::rolname, SECTION_PRE_DATA, and _attrDefInfo::separate.
Referenced by dumpDumpableObject().
Definition at line 11189 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralAH, ARCHIVE_OPTS, ArchiveEntry(), atooid, _dumpOptions::binary_upgrade, binary_upgrade_extension_member(), binary_upgrade_set_type_oids_by_type_oid(), _dumpableObject::catId, createPQExpBuffer(), _typeInfo::dacl, PQExpBufferData::data, destroyPQExpBuffer(), _typeInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_ACL, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, DUMP_COMPONENT_SECLABEL, dumpACL(), dumpComment(), _dumpableObject::dumpId, dumpSecLabel(), ExecuteSqlQueryForSingleRow(), ExecuteSqlStatement(), fmtId(), fmtQualifiedDumpable, free, getFormattedTypeName(), InvalidDumpId, Archive::is_prepared, _dumpableObject::name, CatalogId::oid, OidIsValid, pg_strdup(), PQclear(), PQfnumber(), PQgetisnull(), PQgetvalue(), PREPQUERY_DUMPBASETYPE, printfPQExpBuffer(), Archive::remoteVersion, res, _typeInfo::rolname, SECTION_PRE_DATA, typalign, _typeInfo::typelem, and zeroIsError.
Referenced by dumpType().
Definition at line 12552 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), ARCHIVE_OPTS, ArchiveEntry(), _dumpOptions::binary_upgrade, binary_upgrade_extension_member(), _castInfo::castcontext, _castInfo::castfunc, _castInfo::castmethod, _castInfo::castsource, _castInfo::casttarget, _dumpableObject::catId, createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), _funcInfo::dobj, _castInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, dumpComment(), _dumpableObject::dumpId, findFuncByOid(), fmtId(), format_function_signature(), free, getFormattedTypeName(), _dumpableObject::name, OidIsValid, pg_fatal, pg_log_warning, SECTION_PRE_DATA, and zeroAsNone.
Referenced by dumpDumpableObject().
Definition at line 13666 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralAH, ARCHIVE_OPTS, ArchiveEntry(), _dumpOptions::binary_upgrade, binary_upgrade_extension_member(), _dumpableObject::catId, createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), _collInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, dumpComment(), _dumpableObject::dumpId, ExecuteSqlQueryForSingleRow(), fmtId(), fmtQualifiedDumpable, free, _dumpableObject::name, CatalogId::oid, pg_fatal, pg_log_warning, pg_strdup(), PQclear(), PQfnumber(), PQgetisnull(), PQgetvalue(), Archive::remoteVersion, res, _collInfo::rolname, and SECTION_PRE_DATA.
Referenced by dumpDumpableObject().
|
inlinestatic |
Definition at line 10122 of file pg_dump.c.
References dumpCommentExtended(), name, and type.
Referenced by dumpAccessMethod(), dumpAgg(), dumpBaseType(), dumpCast(), dumpCollation(), dumpCompositeType(), dumpConversion(), dumpDomain(), dumpEnumType(), dumpEventTrigger(), dumpExtension(), dumpForeignDataWrapper(), dumpForeignServer(), dumpFunc(), dumpIndex(), dumpLO(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpPolicy(), dumpProcLang(), dumpPublication(), dumpRangeType(), dumpRule(), dumpSequence(), dumpStatisticsExt(), dumpSubscription(), dumpTableConstraintComment(), dumpTransform(), dumpTrigger(), dumpTSConfig(), dumpTSDictionary(), dumpTSParser(), dumpTSTemplate(), and dumpUndefinedType().
|
static |
Definition at line 10022 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralAH, ARCHIVE_OPTS, ArchiveEntry(), _dumpOptions::binary_upgrade, comments, createDumpId(), createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, CommentItem::descr, destroyPQExpBuffer(), Archive::dopt, findComments(), fmtId(), name, ncomments, nilCatalogId, _dumpOptions::no_comments, CommentItem::objsubid, CatalogId::oid, _dumpOptions::schemaOnly, SECTION_NONE, CatalogId::tableoid, and type.
Referenced by dumpComment(), and dumpNamespace().
Definition at line 11611 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendStringLiteralAH, ARCHIVE_OPTS, ArchiveEntry(), atooid, attalign, attlen, attname, _dumpOptions::binary_upgrade, binary_upgrade_extension_member(), binary_upgrade_set_pg_class_oids(), binary_upgrade_set_type_oids_by_type_oid(), _dumpableObject::catId, createPQExpBuffer(), _typeInfo::dacl, PQExpBufferData::data, destroyPQExpBuffer(), _typeInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_ACL, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, DUMP_COMPONENT_SECLABEL, dumpACL(), dumpComment(), dumpCompositeTypeColComments(), _dumpableObject::dumpId, dumpSecLabel(), ExecuteSqlQuery(), ExecuteSqlStatement(), findCollationByOid(), fmtId(), fmtQualifiedDumpable, free, i, InvalidDumpId, Archive::is_prepared, _dumpableObject::name, CatalogId::oid, OidIsValid, pg_strdup(), PGRES_TUPLES_OK, PQclear(), PQfnumber(), PQgetvalue(), PQntuples(), PREPQUERY_DUMPCOMPOSITETYPE, printfPQExpBuffer(), res, _typeInfo::rolname, SECTION_PRE_DATA, and _typeInfo::typrelid.
Referenced by dumpType().
|
static |
Definition at line 11817 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralAH, ARCHIVE_OPTS, ArchiveEntry(), attname, comments, createDumpId(), createPQExpBuffer(), PQExpBufferData::data, CommentItem::descr, destroyPQExpBuffer(), _typeInfo::dobj, Archive::dopt, _dumpableObject::dumpId, findComments(), fmtId(), fmtQualifiedDumpable, i, _dumpableObject::name, ncomments, nilCatalogId, _dumpOptions::no_comments, CommentItem::objsubid, PQfnumber(), PQgetvalue(), PQntuples(), res, resetPQExpBuffer(), _typeInfo::rolname, SECTION_NONE, and _typeInfo::typrelid.
Referenced by dumpCompositeType().
|
static |
Definition at line 17052 of file pg_dump.c.
References append_depends_on_extension(), appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), appendReloptionsArrayAH(), ARCHIVE_OPTS, ArchiveEntry(), attname, _dumpOptions::binary_upgrade, binary_upgrade_set_pg_class_oids(), _dumpableObject::catId, _constraintInfo::condef, _constraintInfo::condeferrable, _constraintInfo::condeferred, _constraintInfo::condomain, _constraintInfo::conindex, _constraintInfo::conislocal, _constraintInfo::conperiod, _constraintInfo::contable, _constraintInfo::contype, createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), _typeInfo::dobj, _tableInfo::dobj, _indxInfo::dobj, _constraintInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, _dumpableObject::dumpId, dumpTableConstraintComment(), findObjectByDumpId(), fmtId(), fmtQualifiedDumpable, free, getAttrName(), if(), _indxInfo::indisclustered, _indxInfo::indisreplident, _indxInfo::indkeys, _indxInfo::indnattrs, _indxInfo::indnkeyattrs, _indxInfo::indnullsnotdistinct, _indxInfo::indreloptions, InvalidAttrNumber, _dumpableObject::name, nonemptyReloptions(), CatalogId::oid, pg_fatal, psprintf(), _tableInfo::relkind, _typeInfo::rolname, _tableInfo::rolname, SECTION_POST_DATA, _constraintInfo::separate, and _indxInfo::tablespace.
Referenced by dumpDumpableObject().
Definition at line 13923 of file pg_dump.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralAH, ARCHIVE_OPTS, ArchiveEntry(), _dumpOptions::binary_upgrade, binary_upgrade_extension_member(), _dumpableObject::catId, createPQExpBuffer(), PQExpBufferData::data, _dumpOptions::dataOnly, destroyPQExpBuffer(), _convInfo::dobj, Archive::dopt, _dumpableObject::dump, DUMP_COMPONENT_COMMENT, DUMP_COMPONENT_DEFINITION, dumpComment(), _dumpableObject::dumpId, ExecuteSqlQueryForSingleRow(), fmtId(), fmtQualifiedDumpable, free, _dumpableObject::name, CatalogId::oid, pg_strdup(), PQclear(), PQfnumber(), PQgetvalue(), res, _convInfo::rolname, and SECTION_PRE_DATA.
Referenced by dumpDumpableObject().
|
static |
Definition at line 3083 of file pg_dump.c.