diff options
author | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-31 16:30:13 +0200 |
---|---|---|
committer | Rainer Gerhards <rgerhards@adiscon.com> | 2011-03-31 16:30:13 +0200 |
commit | 945bc9bd0d9de984ab11b9faf609b809a1f3cb90 (patch) | |
tree | f3464946b2eef29b2f8a4e54c32f7bf063a2c27f /plugins/ompgsql/ompgsql.c | |
parent | f057fb2db388cc16475f9c5a7de64aeb1f3bdb43 (diff) | |
parent | eccfbf71f9dbc235309c2ad40035d41620f5e5df (diff) | |
download | rsyslog-945bc9bd0d9de984ab11b9faf609b809a1f3cb90.tar.gz rsyslog-945bc9bd0d9de984ab11b9faf609b809a1f3cb90.tar.bz2 rsyslog-945bc9bd0d9de984ab11b9faf609b809a1f3cb90.zip |
Merge branch 'v5-beta' into v5-devel
Conflicts:
ChangeLog
Diffstat (limited to 'plugins/ompgsql/ompgsql.c')
-rw-r--r-- | plugins/ompgsql/ompgsql.c | 7 |
1 files changed, 6 insertions, 1 deletions
diff --git a/plugins/ompgsql/ompgsql.c b/plugins/ompgsql/ompgsql.c index ab8e4d2c..ea4b4b75 100644 --- a/plugins/ompgsql/ompgsql.c +++ b/plugins/ompgsql/ompgsql.c @@ -149,8 +149,13 @@ static rsRetVal initPgSQL(instanceData *pData, int bSilent) dbgprintf("host=%s dbname=%s uid=%s\n",pData->f_dbsrv,pData->f_dbname,pData->f_dbuid); + /* Force PostgreSQL to use ANSI-SQL conforming strings, otherwise we may + * get all sorts of side effects (e.g.: backslash escapes) and warnings + */ + const char *PgConnectionOptions = "-c standard_conforming_strings=on"; + /* Connect to database */ - if((pData->f_hpgsql=PQsetdbLogin(pData->f_dbsrv, NULL, NULL, NULL, + if((pData->f_hpgsql=PQsetdbLogin(pData->f_dbsrv, NULL, PgConnectionOptions, NULL, pData->f_dbname, pData->f_dbuid, pData->f_dbpwd)) == NULL) { reportDBError(pData, bSilent); closePgSQL(pData); /* ignore any error we may get */ |