|
@@ -13,7 +13,7 @@ Difference highlights (see CHANGES for full list):
|
|
|
|
|
|
* Known problems
|
|
|
|
|
|
- Timeout supplied at connect time will work only as connect timeout not query timeout.
|
|
|
+ Timeout supplied at connect time works as socket connect timeout not query timeout.
|
|
|
SSL performance degrades if driver process has large inbox (thousands of messages).
|
|
|
|
|
|
|
|
@@ -31,13 +31,27 @@ Difference highlights (see CHANGES for full list):
|
|
|
+ {ssl, Atom} true | false | required
|
|
|
+ {ssl_opts, List} see ssl application docs in OTP
|
|
|
+ {timeout, Integer} milliseconds, defaults to 5000
|
|
|
- + {async, Pid} see Asynchronous Messages section
|
|
|
+ + {async, Pid} see Server Notifications section
|
|
|
|
|
|
{ok, C} = pgsql:connect("localhost", "username", [{database, "test_db"}]).
|
|
|
ok = pgsql:close(C).
|
|
|
|
|
|
The timeout parameter will trigger an {error, timeout} result when the
|
|
|
- server fails to respond within Timeout milliseconds.
|
|
|
+ socket fails to connect within Timeout milliseconds.
|
|
|
+
|
|
|
+ Asynchronous connection example (applies to ipgsql too):
|
|
|
+
|
|
|
+ {ok, C} = apgsql:start_link(),
|
|
|
+ Ref = apgsql:connect(C, "localhost", "username", [{database, "test_db"}]),
|
|
|
+ receive
|
|
|
+ {C, Ref, connected} ->
|
|
|
+ {ok, C};
|
|
|
+ {C, Ref, Error = {error, _}} ->
|
|
|
+ Error;
|
|
|
+ {'EXIT', C, _Reason} ->
|
|
|
+ {error, closed}
|
|
|
+ end.
|
|
|
+
|
|
|
|
|
|
* Simple Query
|
|
|
|
|
@@ -136,7 +150,7 @@ Difference highlights (see CHANGES for full list):
|
|
|
closed - connection was closed
|
|
|
sync_required - error occured and pgsql:sync must be called
|
|
|
|
|
|
-* Asynchronous Messages
|
|
|
+* Server Notifications
|
|
|
|
|
|
PostgreSQL may deliver two types of asynchronous message: "notices" in response
|
|
|
to notice and warning messages generated by the server, and "notifications" which
|