PostgreSQL Source Code git master
|
#include "postgres_fe.h"
#include <ctype.h>
#include "common/file_perm.h"
#include "common/logging.h"
#include "dumputils.h"
#include "fe_utils/string_utils.h"
Go to the source code of this file.
Macros | |
#define | CONVERT_PRIV(code, keywd) |
Functions | |
static bool | parseAclItem (const char *item, const char *type, const char *name, const char *subname, int remoteVersion, PQExpBuffer grantee, PQExpBuffer grantor, PQExpBuffer privs, PQExpBuffer privswgo) |
static char * | dequoteAclUserName (PQExpBuffer output, char *input) |
static void | AddAcl (PQExpBuffer aclbuf, const char *keyword, const char *subname) |
bool | buildACLCommands (const char *name, const char *subname, const char *nspname, const char *type, const char *acls, const char *baseacls, const char *owner, const char *prefix, int remoteVersion, PQExpBuffer sql) |
bool | buildDefaultACLCommands (const char *type, const char *nspname, const char *acls, const char *acldefault, const char *owner, int remoteVersion, PQExpBuffer sql) |
void | quoteAclUserName (PQExpBuffer output, const char *input) |
void | buildShSecLabelQuery (const char *catalog_name, Oid objectId, PQExpBuffer sql) |
void | emitShSecLabels (PGconn *conn, PGresult *res, PQExpBuffer buffer, const char *objtype, const char *objname) |
bool | variable_is_guc_list_quote (const char *name) |
bool | SplitGUCList (char *rawstring, char separator, char ***namelist) |
void | makeAlterConfigCommand (PGconn *conn, const char *configitem, const char *type, const char *name, const char *type2, const char *name2, PQExpBuffer buf) |
void | create_or_open_dir (const char *dirname) |
#define CONVERT_PRIV | ( | code, | |
keywd | |||
) |
|
static |
Definition at line 620 of file dumputils.c.
References appendPQExpBuffer(), appendPQExpBufferChar(), appendPQExpBufferStr(), PQExpBufferData::len, and subname.
bool buildACLCommands | ( | const char * | name, |
const char * | subname, | ||
const char * | nspname, | ||
const char * | type, | ||
const char * | acls, | ||
const char * | baseacls, | ||
const char * | owner, | ||
const char * | prefix, | ||
int | remoteVersion, | ||
PQExpBuffer | sql | ||
) |
Definition at line 66 of file dumputils.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), fmtId(), free, i, j, PQExpBufferData::len, name, parseAclItem(), parsePGArray(), pg_malloc(), printfPQExpBuffer(), subname, and type.
Referenced by buildDefaultACLCommands(), dumpACL(), dumpRoleGUCPrivs(), and dumpTablespaces().
bool buildDefaultACLCommands | ( | const char * | type, |
const char * | nspname, | ||
const char * | acls, | ||
const char * | acldefault, | ||
const char * | owner, | ||
int | remoteVersion, | ||
PQExpBuffer | sql | ||
) |
Definition at line 328 of file dumputils.c.
References acldefault(), appendPQExpBuffer(), buildACLCommands(), createPQExpBuffer(), PQExpBufferData::data, destroyPQExpBuffer(), fmtId(), and type.
Referenced by dumpDefaultACL().
void buildShSecLabelQuery | ( | const char * | catalog_name, |
Oid | objectId, | ||
PQExpBuffer | sql | ||
) |
Definition at line 640 of file dumputils.c.
References appendPQExpBuffer().
Referenced by buildShSecLabels(), and dumpDatabase().
void create_or_open_dir | ( | const char * | dirname | ) |
Definition at line 897 of file dumputils.c.
References mkdir, pg_check_dir(), pg_dir_create_mode, and pg_fatal.
Referenced by InitArchiveFmt_Directory(), and main().
|
static |
Definition at line 581 of file dumputils.c.
References appendPQExpBufferChar(), input, output, and resetPQExpBuffer().
Referenced by parseAclItem().
void emitShSecLabels | ( | PGconn * | conn, |
PGresult * | res, | ||
PQExpBuffer | buffer, | ||
const char * | objtype, | ||
const char * | objname | ||
) |
Definition at line 658 of file dumputils.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralConn(), conn, fmtId(), i, label, PQgetvalue(), and PQntuples().
Referenced by buildShSecLabels(), and dumpDatabase().
void makeAlterConfigCommand | ( | PGconn * | conn, |
const char * | configitem, | ||
const char * | type, | ||
const char * | name, | ||
const char * | type2, | ||
const char * | name2, | ||
PQExpBuffer | buf | ||
) |
Definition at line 826 of file dumputils.c.
References appendPQExpBuffer(), appendPQExpBufferStr(), appendStringLiteralConn(), buf, conn, fmtId(), name, pg_free(), pg_strdup(), SplitGUCList(), type, and variable_is_guc_list_quote().
Referenced by dumpDatabaseConfig(), and dumpUserConfig().
|
static |
Definition at line 385 of file dumputils.c.
References appendPQExpBuffer(), buf, CONVERT_PRIV, dequoteAclUserName(), pg_free(), pg_strdup(), printfPQExpBuffer(), resetPQExpBuffer(), subname, and type.
Referenced by buildACLCommands().
void quoteAclUserName | ( | PQExpBuffer | output, |
const char * | input | ||
) |
Definition at line 547 of file dumputils.c.
References appendPQExpBufferChar(), input, and output.
Referenced by getNamespaces().
bool SplitGUCList | ( | char * | rawstring, |
char | separator, | ||
char *** | namelist | ||
) |
Definition at line 726 of file dumputils.c.
References pg_malloc().
Referenced by makeAlterConfigCommand().
bool variable_is_guc_list_quote | ( | const char * | name | ) |
Definition at line 692 of file dumputils.c.
References name, and pg_strcasecmp().
Referenced by dumpFunc(), and makeAlterConfigCommand().