Skip to content

Commit

Permalink
ido_pgsql: do not set standard_conforming_strings to off
Browse files Browse the repository at this point in the history
Before postgres 9.1, this setting defaulted to off and icinga2 code was
making heavy use of this feature. Since postgres 9.1, this settings
defaults to on. During the adoption of postgres >= 9.1, the icinga2
postgres ido code maintained compatibility by setting it to off
explicitly.

In the mean time, the postgres ido code has been converted to using the
`E'...'` escape literal syntax exclusively.

The last remaining step is now to no longer force the setting to off
because no query is using the feature any longer.

Closes github issue #8122.
  • Loading branch information
MEschenbacher committed Jul 26, 2020
1 parent 09cf7c3 commit 35b6547
Showing 1 changed file with 0 additions and 6 deletions.
6 changes: 0 additions & 6 deletions lib/db_ido_pgsql/idopgsqlconnection.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -257,12 +257,6 @@ void IdoPgsqlConnection::Reconnect()

IdoPgsqlResult result;

/* explicitely require legacy mode for string escaping in PostgreSQL >= 9.1
* changing standard_conforming_strings to on by default
*/
if (m_Pgsql->serverVersion(m_Connection) >= 90100)
result = Query("SET standard_conforming_strings TO off");

String dbVersionName = "idoutils";
result = Query("SELECT version FROM " + GetTablePrefix() + "dbversion WHERE name=E'" + Escape(dbVersionName) + "'");

Expand Down

0 comments on commit 35b6547

Please sign in to comment.