mirror of
https://github.com/processone/ejabberd.git
synced 2024-11-22 16:20:52 +01:00
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
This commit is contained in:
parent
c6513fcfc6
commit
a1cfae8c98
@ -1005,22 +1005,14 @@ sqlite_to_odbc(_Host, _) ->
|
|||||||
%% Open a database connection to PostgreSQL
|
%% Open a database connection to PostgreSQL
|
||||||
pgsql_connect(Server, Port, DB, Username, Password, ConnectTimeout,
|
pgsql_connect(Server, Port, DB, Username, Password, ConnectTimeout,
|
||||||
Transport, SSLOpts) ->
|
Transport, SSLOpts) ->
|
||||||
case pgsql:connect([{host, Server},
|
pgsql:connect([{host, Server},
|
||||||
{database, DB},
|
{database, DB},
|
||||||
{user, Username},
|
{user, Username},
|
||||||
{password, Password},
|
{password, Password},
|
||||||
{port, Port},
|
{port, Port},
|
||||||
{transport, Transport},
|
{transport, Transport},
|
||||||
{connect_timeout, ConnectTimeout},
|
{connect_timeout, ConnectTimeout},
|
||||||
{as_binary, true}|SSLOpts]) of
|
{as_binary, true}|SSLOpts]).
|
||||||
{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.
|
|
||||||
|
|
||||||
%% Convert PostgreSQL query result to Erlang ODBC result formalism
|
%% Convert PostgreSQL query result to Erlang ODBC result formalism
|
||||||
pgsql_to_odbc({ok, PGSQLResult}) ->
|
pgsql_to_odbc({ok, PGSQLResult}) ->
|
||||||
|
Loading…
Reference in New Issue
Block a user