diff options
author | Joshua Colp <jcolp@digium.com> | 2017-09-22 05:49:15 -0500 |
---|---|---|
committer | Gerrit Code Review <gerrit2@gerrit.digium.api> | 2017-09-22 05:49:15 -0500 |
commit | ddc216f12edf2980554398e459034073ffe6f312 (patch) | |
tree | 0a759874bfe10f477f034219bde994c7ebe55cb5 | |
parent | 040487b90eb1830deb571e9b5ee6b1230071ff45 (diff) | |
parent | 339676b77db2376da5323d4399a3c7bf80c184e7 (diff) |
Merge "res_config_pgsql: Fix removed support to previous for versions PostgreSQL 9.1" into 14
-rw-r--r-- | res/res_config_pgsql.c | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/res/res_config_pgsql.c b/res/res_config_pgsql.c index 8d090cce8..4cbfd61ae 100644 --- a/res/res_config_pgsql.c +++ b/res/res_config_pgsql.c @@ -54,6 +54,7 @@ AST_THREADSTORAGE(semibuf_buf); static PGconn *pgsqlConn = NULL; static int version; #define has_schema_support (version > 70300 ? 1 : 0) +#define USE_BACKSLASH_AS_STRING (version >= 90100 ? 1 : 0) #define MAX_DB_OPTION_SIZE 64 @@ -386,7 +387,7 @@ static struct columns *find_column(struct tables *t, const char *colname) } #define IS_SQL_LIKE_CLAUSE(x) ((x) && ast_ends_with(x, " LIKE")) -static char *ESCAPE_CLAUSE = " ESCAPE '\\'"; +#define ESCAPE_CLAUSE (USE_BACKSLASH_AS_STRING ? " ESCAPE '\\'" : " ESCAPE '\\\\'") static struct ast_variable *realtime_pgsql(const char *database, const char *tablename, const struct ast_variable *fields) { |