Escape double-quotes in strings passed to an event notification script

The string in question will be generated internally by repmgr as a simple
one-line string with no control characters etc., so all that needs to be
escaped at the moment are any double quotes.
This commit is contained in:
Ian Barwick
2017-11-16 10:36:48 +09:00
parent 53ebde8f33
commit e331069f53
5 changed files with 38 additions and 5 deletions

View File

@@ -142,6 +142,8 @@ extern char *escape_recovery_conf_value(const char *src);
extern char *escape_string(PGconn *conn, const char *string);
extern void escape_double_quotes(char *string, PQExpBufferData *out);
extern void
append_where_clause(PQExpBufferData *where_clause, const char *clause,...)
__attribute__((format(PG_PRINTF_ATTRIBUTE, 2, 3)));