Next: Procedures for Managing Large Objects, Previous: Procedures for Retrieving Data, Up: The (database postgres*) Modules [Contents][Index]
As of PostgreSQL 7.4, you can send arbitrarily-sized chunks of data after
issuing the COPY <table> FROM STDIN
command. Also, both send and
receive (with the COPY <table> TO STDOUT
command) paths can be
performed asynchronously.
Send on conn the data (a string).
Return one if ok; zero if the server is in nonblocking mode
and the attempt would block; and -1
if an error occurred.
Send an end-of-data indication over conn.
Optional arg errmsg is a string, which if present,
forces the COPY
operation to fail with errmsg as the
error message.
Return one if ok; zero if the server is in nonblocking mode
and the attempt would block; and -1
if an error occurred.
Get a line of COPY
data from conn, writing it to
output port. If port is a pair, construct
a new string and set its CAR to the new string.
Optional arg async? non-#f
means don’t block
if there is no data available yet.
Return the number of data bytes in the row (always greater
than zero); zero to mean the COPY
is still in progress
and no data is yet available; -1
to mean the COPY
is
done; or -2
to mean an error occurred.
Although not readily apparent, another form of data copying is formatted
output, which is supported by Guile-PG via the pg-print
procedure and
the accompanying pg-make-print-options
. Together these loosely mimic
the PQprint
functionality provided by libpq.
Return a print options object created from spec,
suitable for use with pg-print
. spec is a list
of elements, each either a flag (symbol) or a key-value pair
(with the key being a symbol). Recognized flags:
To specify a disabled flag, use no-FLAG, e.g.,
no-header
. Recognized keys:
Display result on the current output port.
Optional second arg options is an
object returned by pg-make-print-options
that
specifies various parameters of the output format.
Next: Procedures for Managing Large Objects, Previous: Procedures for Retrieving Data, Up: The (database postgres*) Modules [Contents][Index]