diff options
author | Stu Tomlinson <stu@nosnilmot.com> | 2022-11-16 12:58:30 +0000 |
---|---|---|
committer | GitHub <noreply@github.com> | 2022-11-16 13:58:30 +0100 |
commit | a1cfae8c981e8e957eb79bfda94cc45ccf35b316 (patch) | |
tree | 0325257bd75597407c5aae81e07348996e2a9928 | |
parent | Handle mnesia_system_event mnesia_up when other node joins this (#3842) (diff) |
pgsql: do not set standard_conforming_strings to 'off' (#3944)
Since f9120f75b0 string literals use escape string syntax (E'...') on
pgsql, so it is no longer necessary to set standard_conforming_strings
to 'off'
Fixes #3932
-rw-r--r-- | src/ejabberd_sql.erl | 24 |
1 files changed, 8 insertions, 16 deletions
diff --git a/src/ejabberd_sql.erl b/src/ejabberd_sql.erl index 39c2eab7d..446f4951f 100644 --- a/src/ejabberd_sql.erl +++ b/src/ejabberd_sql.erl @@ -1005,22 +1005,14 @@ sqlite_to_odbc(_Host, _) -> %% Open a database connection to PostgreSQL pgsql_connect(Server, Port, DB, Username, Password, ConnectTimeout, Transport, SSLOpts) -> - case pgsql:connect([{host, Server}, - {database, DB}, - {user, Username}, - {password, Password}, - {port, Port}, - {transport, Transport}, - {connect_timeout, ConnectTimeout}, - {as_binary, true}|SSLOpts]) of - {ok, Ref} -> - pgsql:squery(Ref, [<<"alter database \"">>, DB, <<"\" set ">>, - <<"standard_conforming_strings='off';">>]), - pgsql:squery(Ref, [<<"set standard_conforming_strings to 'off';">>]), - {ok, Ref}; - Err -> - Err - end. + pgsql:connect([{host, Server}, + {database, DB}, + {user, Username}, + {password, Password}, + {port, Port}, + {transport, Transport}, + {connect_timeout, ConnectTimeout}, + {as_binary, true}|SSLOpts]). %% Convert PostgreSQL query result to Erlang ODBC result formalism pgsql_to_odbc({ok, PGSQLResult}) -> |