Исходный код СУБД RuDB — свободной СУБД с открытым исходным кодом на базе PostgreSQL
rudb
3 days ago bd039d1e92813358c5c5a1e346b49074baf513f2
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
/*-------------------------------------------------------------------------
 *
 * Utility routines for SQL dumping
 *
 * Basically this is stuff that is useful in both pg_dump and pg_dumpall.
 *
 *
 * Portions Copyright (c) 1996-2026, PostgreSQL Global Development Group
 * Portions Copyright (c) 1994, Regents of the University of California
 *
 * src/bin/pg_dump/dumputils.h
 *
 *-------------------------------------------------------------------------
 */
#ifndef DUMPUTILS_H
#define DUMPUTILS_H
 
#include "libpq-fe.h"
#include "pqexpbuffer.h"
 
/*
 * Preferred strftime(3) format specifier for printing timestamps in pg_dump
 * and friends.
 *
 * We don't print the timezone on Windows, because the names are long and
 * localized, which means they may contain characters in various random
 * encodings; this has been seen to cause encoding errors when reading the
 * dump script.  One could now possibly get around that by using %z, but %z
 * was previously not portable to pre-C99 systems, and also previously %z
 * didn't actually act differently from %Z on Windows.  But of these problems
 * might be obsolete now.
 */
#ifndef WIN32
#define PGDUMP_STRFTIME_FMT  "%Y-%m-%d %H:%M:%S %Z"
#else
#define PGDUMP_STRFTIME_FMT  "%Y-%m-%d %H:%M:%S"
#endif
 
 
extern char *sanitize_line(const char *str, bool want_hyphen);
extern 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);
extern bool buildDefaultACLCommands(const char *type, const char *nspname,
                                    const char *acls, const char *acldefault,
                                    const char *owner,
                                    int remoteVersion,
                                    PQExpBuffer sql);
 
extern void quoteAclUserName(PQExpBuffer output, const char *input);
 
extern void buildShSecLabelQuery(const char *catalog_name,
                                 Oid objectId, PQExpBuffer sql);
extern void emitShSecLabels(PGconn *conn, PGresult *res,
                            PQExpBuffer buffer, const char *objtype, const char *objname);
 
extern bool variable_is_guc_list_quote(const char *name);
 
extern void makeAlterConfigCommand(PGconn *conn, const char *configitem,
                                   const char *type, const char *name,
                                   const char *type2, const char *name2,
                                   PQExpBuffer buf);
extern void create_or_open_dir(const char *dirname);
 
extern char *generate_restrict_key(void);
extern bool valid_restrict_key(const char *restrict_key);
 
#endif                          /* DUMPUTILS_H */