30#define ERRCODE_DUPLICATE_OBJECT "42710"
37#define MINIMUM_VERSION_FOR_SHOW_CMD 100000
42#define MINIMUM_VERSION_FOR_GROUP_ACCESS 110000
130 keywords[
i] =
"fallback_application_name";
189 pg_fatal(
"could not connect to server");
246 pg_log_error(
"could not determine server setting for \"integer_datetimes\"");
253 pg_log_error(
"\"integer_datetimes\" compile flag does not match server");
296 pg_log_error(
"could not send replication command \"%s\": %s",
304 pg_log_error(
"could not fetch WAL segment size: got %d rows and %d fields, expected %d rows and %d or more fields",
323 multiplier = 1024 * 1024;
325 multiplier = 1024 * 1024 * 1024;
333 "remote server reported invalid WAL segment size (%d bytes)",
367 res =
PQexec(
conn,
"SHOW data_directory_mode");
370 pg_log_error(
"could not send replication command \"%s\": %s",
378 pg_log_error(
"could not fetch group access flag: got %d rows and %d fields, expected %d rows and %d or more fields",
387 pg_log_error(
"group access flag could not be parsed: %s",
422 pg_log_error(
"could not send replication command \"%s\": %s",
430 pg_log_error(
"could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields",
442 if (starttli !=
NULL)
450 pg_log_error(
"could not parse write-ahead log location \"%s\"",
467 pg_log_error(
"could not identify system: got %d rows and %d fields, expected %d rows and %d or more fields",
510 pg_log_error(
"could not send replication command \"%s\": %s",
519 pg_log_error(
"could not read replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields",
531 pg_log_error(
"replication slot \"%s\" does not exist", slot_name);
542 pg_log_error(
"expected a physical replication slot, got type \"%s\" instead",
556 pg_log_error(
"could not parse restart_lsn \"%s\" for replication slot \"%s\"",
633 "SNAPSHOT",
"nothing");
636 "NOEXPORT_SNAPSHOT");
642 if (query->
data[query->
len - 1] ==
'(')
645 query->
data[query->
len] =
'\0';
667 pg_log_error(
"could not send replication command \"%s\": %s",
678 pg_log_error(
"could not create replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields",
712 pg_log_error(
"could not send replication command \"%s\": %s",
722 pg_log_error(
"could not drop replication slot \"%s\": got %d rows and %d fields, expected %d rows and %d fields",
749 if (
buf->len > 0 &&
buf->data[
buf->len - 1] !=
'(')
static Datum values[MAXATTR]
#define ngettext(s, p, n)
#define Assert(condition)
#define ALWAYS_SECURE_SEARCH_PATH_SQL
#define POSTGRES_EPOCH_JDATE
int PQserverVersion(const PGconn *conn)
void PQconninfoFree(PQconninfoOption *connOptions)
PQconninfoOption * PQconninfoParse(const char *conninfo, char **errmsg)
const char * PQparameterStatus(const PGconn *conn, const char *paramName)
int PQconnectionNeedsPassword(const PGconn *conn)
ConnStatusType PQstatus(const PGconn *conn)
void PQfinish(PGconn *conn)
char * PQerrorMessage(const PGconn *conn)
PGconn * PQconnectdbParams(const char *const *keywords, const char *const *values, int expand_dbname)
size_t PQescapeStringConn(PGconn *conn, char *to, const char *from, size_t length, int *error)
PGresult * PQexec(PGconn *conn, const char *query)
char * pg_strdup(const char *in)
void * pg_malloc0(size_t size)
void SetDataDirectoryCreatePerm(int dataDirMode)
static const JsonPathKeyword keywords[]
#define PQresultErrorField
#define pg_log_error(...)
#define pg_log_error_detail(...)
void pfree(void *pointer)
#define DEFAULT_XLOG_SEG_SIZE
static bool slot_exists_ok
static const char * plugin
static XLogRecPtr startpos
static char buf[DEFAULT_XLOG_SEG_SIZE]
PQExpBuffer createPQExpBuffer(void)
void appendPQExpBuffer(PQExpBuffer str, const char *fmt,...)
void destroyPQExpBuffer(PQExpBuffer str)
void appendPQExpBufferChar(PQExpBuffer str, char ch)
void appendPQExpBufferStr(PQExpBuffer str, const char *data)
char * simple_prompt(const char *prompt, bool echo)
void AppendIntegerCommandOption(PQExpBuffer buf, bool use_new_option_syntax, char *option_name, int32 option_value)
PGconn * GetConnection(void)
bool RetrieveWalSegSize(PGconn *conn)
#define ERRCODE_DUPLICATE_OBJECT
#define MINIMUM_VERSION_FOR_SHOW_CMD
int64 fe_recvint64(char *buf)
TimestampTz feGetCurrentTimestamp(void)
bool CreateReplicationSlot(PGconn *conn, const char *slot_name, const char *plugin, bool is_temporary, bool is_physical, bool reserve_wal, bool slot_exists_ok, bool two_phase, bool failover)
#define MINIMUM_VERSION_FOR_GROUP_ACCESS
void feTimestampDifference(TimestampTz start_time, TimestampTz stop_time, long *secs, int *microsecs)
void AppendPlainCommandOption(PQExpBuffer buf, bool use_new_option_syntax, char *option_name)
void AppendStringCommandOption(PQExpBuffer buf, bool use_new_option_syntax, char *option_name, char *option_value)
void fe_sendint64(int64 i, char *buf)
bool feTimestampDifferenceExceeds(TimestampTz start_time, TimestampTz stop_time, int msec)
bool GetSlotInformation(PGconn *conn, const char *slot_name, XLogRecPtr *restart_lsn, TimeLineID *restart_tli)
static bool RetrieveDataDirCreatePerm(PGconn *conn)
bool DropReplicationSlot(PGconn *conn, const char *slot_name)
bool RunIdentifySystem(PGconn *conn, char **sysid, TimeLineID *starttli, XLogRecPtr *startpos, char **db_name)
int gettimeofday(struct timeval *tp, void *tzp)
#define IsValidWalSegSize(size)
#define InvalidXLogRecPtr