|
@@ -91,9 +91,9 @@ provide a common fork for community development.
|
|
|
|
|
|
{error, Error} = pgsql:squery(C, "invalid SQL").
|
|
|
|
|
|
- Columns - list of column records, see pgsql.hrl for definition.
|
|
|
- Rows - list of tuples, one for each row.
|
|
|
- Count - integer count of rows inserted/updated/etc
|
|
|
+ + Columns - list of column records, see pgsql.hrl for definition.
|
|
|
+ + Rows - list of tuples, one for each row.
|
|
|
+ + Count - integer count of rows inserted/updated/etc
|
|
|
|
|
|
The simple query protocol returns all columns as text (Erlang binaries)
|
|
|
and does not support binding parameters.
|
|
@@ -176,8 +176,8 @@ provide a common fork for community development.
|
|
|
|
|
|
{ok, Statement} = pgsql:parse(C, [StatementName], Sql, [ParameterTypes]).
|
|
|
|
|
|
- StatementName - optional, reusable, name for the prepared statement.
|
|
|
- ParameterTypes - optional list of PostgreSQL types for each parameter.
|
|
|
+ + StatementName - optional, reusable, name for the prepared statement.
|
|
|
+ + ParameterTypes - optional list of PostgreSQL types for each parameter.
|
|
|
|
|
|
For valid type names see `pgsql_types.erl`.
|
|
|
|
|
@@ -191,7 +191,7 @@ provide a common fork for community development.
|
|
|
|
|
|
ok = pgsql:bind(C, Statement, [PortalName], ParameterValues).
|
|
|
|
|
|
- PortalName - optional name for the result portal.
|
|
|
+ + PortalName - optional name for the result portal.
|
|
|
|
|
|
both `apgsql:bind` and `ipgsql:bind` send `{C, Ref, ok | {error, Reason}}`
|
|
|
|
|
@@ -199,8 +199,8 @@ provide a common fork for community development.
|
|
|
{ok, Count} = pgsql:execute(C, Statement, [PortalName]).
|
|
|
{ok, Count, Rows} = pgsql:execute(C, Statement, [PortalName]).
|
|
|
|
|
|
- PortalName - optional portal name used in bind/4.
|
|
|
- MaxRows - maximum number of rows to return (0 for all rows).
|
|
|
+ + PortalName - optional portal name used in bind/4.
|
|
|
+ + MaxRows - maximum number of rows to return (0 for all rows).
|
|
|
|
|
|
execute returns {partial, Rows} when more rows are available.
|
|
|
|
|
@@ -231,8 +231,8 @@ provide a common fork for community development.
|
|
|
|
|
|
Results = pgsql:execute_batch(C, Batch).
|
|
|
|
|
|
- Batch - list of `{Statement, ParameterValues}`
|
|
|
- Results - list of `{ok, Count}` or `{ok, Count, Rows}`
|
|
|
+ + Batch - list of `{Statement, ParameterValues}`
|
|
|
+ + Results - list of `{ok, Count}` or `{ok, Count, Rows}`
|
|
|
|
|
|
Example
|
|
|
|
|
@@ -297,16 +297,15 @@ provide a common fork for community development.
|
|
|
|
|
|
{pgsql, Connection, {notification, Channel, Pid, Payload}}
|
|
|
|
|
|
- Connection - connection the notification occurred on
|
|
|
-
|
|
|
- Channel - channel the notification occurred on
|
|
|
- Pid - database session pid that sent notification
|
|
|
- Payload - optional payload, only available from PostgreSQL >= 9.0
|
|
|
+ + Connection - connection the notification occurred on
|
|
|
+ + Channel - channel the notification occurred on
|
|
|
+ + Pid - database session pid that sent notification
|
|
|
+ + Payload - optional payload, only available from PostgreSQL >= 9.0
|
|
|
|
|
|
{pgsql, Connection, {notice, Error}}
|
|
|
|
|
|
- Connection - connection the notice occurred on
|
|
|
- Error - an #error{} record, see pgsql.hrl
|
|
|
+ + Connection - connection the notice occurred on
|
|
|
+ + Error - an #error{} record, see pgsql.hrl
|
|
|
|
|
|
|
|
|
* Mailing list
|