icinga2/lib/db_ido_pgsql
Julian Brost 782669f13b IDO PgSQL: always use regular string literals
IdoPgsqlConnection::Escape() internally uses PQescapeStringConn() and its
documentation states the following:

  Furthermore, PQescapeStringConn does not generate the single quotes that must
  surround PostgreSQL string literals; they should be provided in the SQL
  command that the result is inserted into.

So it's intended to use the result in 'string' literals, not in E'string'
literals as Icinga did. This results in problems as the behavior of
PQescapeStringConn() depends on how the current connection will interpret
regular single quoted literals, namely on the value of the
standard_conforming_strings variable.

The E'string' literals were initially introduced in
ac6f3f8acf to fix #1206 where PostgreSQL started
warning about escape sequences in string literals not supported by the SQL
standard (but by PostgreSQL depending on the value of
standard_conforming_strings). In the meantime the oldest PostgreSQL version on
any platform supported by Icinga increased to 9.2 (CentOS 7) and starting with
9.1, standard_conforming_strings is enabled by default, so there will be no
warnings about escape sequences (as the warning is only issued if the escape
sequence is actually interpreted by PostgreSQL).
2021-08-05 11:39:32 +02:00
..
schema Replace a few more copyright strings 2019-02-25 16:30:40 +01:00
CMakeLists.txt Replace Copyright header with a short version, part II 2019-02-25 15:09:36 +01:00
idopgsqlconnection.cpp IDO PgSQL: always use regular string literals 2021-08-05 11:39:32 +02:00
idopgsqlconnection.hpp Merge pull request #8855 from Icinga/bugfix/inconsistent-ido-schema-versions-8852 2021-07-14 18:09:27 +02:00
idopgsqlconnection.ti Remove passwords from API 2021-07-05 15:09:54 +02:00