#include "postgres_fe.h"
#include <unistd.h>
#include <ctype.h>
#include "common/connect.h"
#include "common/string.h"
#include "connectdb.h"
#include "parallel.h"
#include "pg_backup_archiver.h"
#include "pg_backup_db.h"
#include "pg_backup_utils.h"
Go to the source code of this file.
Definition at line 32 of file pg_backup_db.c.
References _archiveHandle::archiveRemoteVersion, _archiveHandle::connection, ExecuteSqlQueryForSingleRow(), Archive::isStandby, Archive::maxRemoteVersion, pg_fatal, pg_log_error, pg_log_error_detail, pg_strdup(), PQclear, PQgetvalue, PQparameterStatus(), PQserverVersion(), progname, _archiveHandle::public, Archive::remoteVersion, and Archive::remoteVersionStr.
Referenced by ConnectDatabaseAhx().
Definition at line 476 of file pg_backup_db.c.
References ExecuteSqlCommand().
Referenced by IssueCommandPerBlob().
Definition at line 109 of file pg_backup_db.c.
References _check_database_version(), ALWAYS_SECURE_SEARCH_PATH_SQL, ConnectDatabase(), _archiveHandle::connection, _connParams::dbname, ExecuteSqlQueryForSingleRow(), free, notice_processor(), _connParams::override_dbname, password, pg_fatal, pg_strdup(), _connParams::pghost, _connParams::pgport, PQclear, PQconnectionUsedPassword(), PQpass(), PQsetNoticeProcessor(), progname, _connParams::promptPassword, _archiveHandle::savedPassword, set_archive_cancel_info(), simple_prompt(), TRI_NO, TRI_YES, and _connParams::username.
Referenced by CloneArchive(), main(), ReconnectToServer(), restore_toc_entries_postfork(), and RestoreArchive().
Definition at line 208 of file pg_backup_db.c.
References _archiveHandle::connection, pg_log_error, pg_log_error_detail, and PQerrorMessage().
Referenced by ExecuteSqlQuery(), and ExecuteSqlStatement().
Definition at line 164 of file pg_backup_db.c.
References _archiveHandle::connCancel, _archiveHandle::connection, PQcancel(), PQfinish(), PQTRANS_ACTIVE, PQtransactionStatus(), and set_archive_cancel_info().
Referenced by archive_close_connection(), restore_toc_entries_prefork(), RestoreArchive(), and RunWorker().
Definition at line 612 of file pg_backup_db.c.
References ahprintf().
Referenced by _StartLO(), RestoreArchive(), and StartRestoreLO().
Definition at line 439 of file pg_backup_db.c.
References _archiveHandle::connection, pg_fatal, pg_log_warning, _archiveHandle::pgCopyIn, PGRES_COMMAND_OK, PQclear, PQerrorMessage(), PQgetResult, PQputCopyEnd(), PQresultStatus, and warn_or_exit_horribly().
Referenced by restore_toc_entry().
Definition at line 319 of file pg_backup_db.c.
References appendPQExpBufferChar(), sqlparseInfo::backSlash, buf, createPQExpBuffer(), sqlparseInfo::curCmd, PQExpBufferData::data, ExecuteSqlCommand(), PQExpBufferData::len, _archiveHandle::public, resetPQExpBuffer(), SQL_IN_DOUBLE_QUOTE, SQL_IN_SINGLE_QUOTE, SQL_SCAN, _archiveHandle::sqlparse, sqlparseInfo::state, and Archive::std_strings.
Referenced by ExecuteSqlCommandBuf().
Definition at line 267 of file pg_backup_db.c.
References conn, _archiveHandle::connection, fprintf, _archiveHandle::pgCopyIn, PGRES_COMMAND_OK, PGRES_COPY_IN, PGRES_EMPTY_QUERY, PGRES_TUPLES_OK, PQclear, PQerrorMessage(), PQexec(), PQresultStatus, and warn_or_exit_horribly().
Referenced by CommitTransaction(), ExecuteSimpleCommands(), ExecuteSqlCommandBuf(), and StartTransaction().
Definition at line 384 of file pg_backup_db.c.
References buf, _archiveHandle::connection, ExecuteSimpleCommands(), ExecuteSqlCommand(), free, OUTPUT_COPYDATA, OUTPUT_OTHERDATA, _archiveHandle::outputKind, pg_fatal, pg_malloc(), _archiveHandle::pgCopyIn, PQerrorMessage(), PQputCopyData(), and str.
Referenced by ahwrite().
Definition at line 229 of file pg_backup_db.c.
References _archiveHandle::connection, die_on_query_failure(), PQexec(), and PQresultStatus.
Referenced by append_depends_on_extension(), buildMatViewRefreshDependencies(), collectBinaryUpgradeClassOids(), collectComments(), collectRoleNames(), collectSecLabels(), collectSequences(), createViewAsClause(), dumpCompositeType(), dumpDatabase(), dumpDatabaseConfig(), dumpEnumType(), dumpOpclass(), dumpOpfamily(), dumpRule(), dumpSequence(), dumpSequenceData(), dumpTable(), dumpTableData_copy(), dumpTableData_insert(), dumpTSConfig(), dumpUserMappings(), ExecuteSqlQueryForSingleRow(), expand_extension_name_patterns(), expand_foreign_server_name_patterns(), expand_schema_name_patterns(), expand_table_name_patterns(), fetchAttributeStats(), getAccessMethods(), getAdditionalACLs(), getAggregates(), getCasts(), getCollations(), getConstraints(), getConversions(), getDefaultACLs(), getDependencies(), getDomainConstraints(), getEventTriggers(), getExtendedStatistics(), getExtensionMembership(), getExtensions(), getForeignDataWrappers(), getForeignServers(), getFuncs(), getIndexes(), getInherits(), getLOs(), getNamespaces(), getOpclasses(), getOperators(), getOpfamilies(), getPartitioningInfo(), getPolicies(), getProcLangs(), getPublicationNamespaces(), getPublications(), getPublicationTables(), getRules(), getSubscriptions(), getSubscriptionTables(), getTableAttrs(), getTables(), getTransforms(), getTriggers(), getTSConfigurations(), getTSDictionaries(), getTSParsers(), getTSTemplates(), getTypes(), processExtensionTables(), and set_restrict_relation_kind().
Definition at line 244 of file pg_backup_db.c.
References ExecuteSqlQuery(), ngettext, pg_fatal, PGRES_TUPLES_OK, and PQntuples.
Referenced by _check_database_version(), binary_upgrade_set_type_oids_by_type_oid(), ConnectDatabaseAhx(), convertTSFunction(), dumpAgg(), dumpBaseType(), dumpCollation(), dumpConversion(), dumpDatabase(), dumpDomain(), dumpForeignServer(), dumpFunc(), dumpOpclass(), dumpOpfamily(), dumpOpr(), dumpRangeType(), dumpSearchPath(), dumpStatisticsExt(), dumpTableAttach(), dumpTableSchema(), dumpTSConfig(), dumpTSDictionary(), expand_table_name_patterns(), get_language_name(), get_next_possible_free_pg_type_oid(), get_synchronized_snapshot(), getFormattedTypeName(), and setup_connection().
Definition at line 217 of file pg_backup_db.c.
References _archiveHandle::connection, die_on_query_failure(), PGRES_COMMAND_OK, PQclear, PQexec(), and PQresultStatus.
Referenced by dumpAgg(), dumpBaseType(), dumpCompositeType(), dumpDomain(), dumpEnumType(), dumpFunc(), dumpOpr(), dumpRangeType(), dumpRelationStats_dumper(), dumpTable(), dumpTableAttach(), dumpTableData_insert(), expand_table_name_patterns(), getDomainConstraints(), getTables(), and setup_connection().
Definition at line 193 of file pg_backup_db.c.
References _archiveHandle::connection.
Definition at line 538 of file pg_backup_db.c.
References Assert(), buf, _tocEntry::defn, _tocEntry::dependencies, _tocEntry::desc, getTocEntryByDumpId(), IssueCommandPerBlob(), pg_fatal, pg_free(), and pg_strdup().
Referenced by _printTocEntry().
Definition at line 491 of file pg_backup_db.c.
References ahprintf(), buf, CommitTransaction(), _archiveHandle::connection, _tocEntry::defn, pg_free(), pg_strdup(), _archiveHandle::public, Archive::ropt, StartTransaction(), _restoreOptions::txn_size, and _archiveHandle::txnCount.
Referenced by _printTocEntry(), IssueACLPerBlob(), and RestoreArchive().
Definition at line 201 of file pg_backup_db.c.
References pg_log_info.
Referenced by ConnectDatabaseAhx().
Definition at line 73 of file pg_backup_db.c.
References ConnectDatabaseAhx(), _archiveHandle::connection, _restoreOptions::cparams, dbname, _connParams::override_dbname, pg_strdup(), PQfinish(), _archiveHandle::public, and Archive::ropt.
Referenced by _reconnectToDB().
Definition at line 468 of file pg_backup_db.c.
References ExecuteSqlCommand().
Referenced by IssueCommandPerBlob().