RHEL/CentOS 7:
# yum install postgresql-server postgresql
+ # postgresql-setup --initdb
# systemctl enable postgresql
# systemctl start postgresql
# IPv6 local connections:
host all all ::1/128 ident
- # /etc/init.d/postgresql restart
+ # service postgresql restart
After creating the database and permissions you can import the Icinga 2 IDO
SetConnected(true);
+ IdoPgsqlResult result;
+
+ /* explicitely require legacy mode for string escaping in PostgreSQL >= 9.1
+ * changing standard_conforming_strings to on by default
+ */
+ if (PQserverVersion(m_Connection) >= 90100)
+ result = Query("SET standard_conforming_strings TO off");
+
String dbVersionName = "idoutils";
- IdoPgsqlResult result = Query("SELECT version FROM " + GetTablePrefix() + "dbversion WHERE name=E'" + Escape(dbVersionName) + "'");
+ result = Query("SELECT version FROM " + GetTablePrefix() + "dbversion WHERE name=E'" + Escape(dbVersionName) + "'");
Dictionary::Ptr row = FetchRow(result, 0);