pg_blocking

pg_blocking — Get or set the connection mode - blocking or nonblocking

Synopsis

pg_blocking conn [newSetting]

Description

pg_blocking changes the blocking mode of a connection, or just gets the current mode.

Arguments

conn

The handle of the connection on which to listen for notifications.

newSetting

If supplied, a Tcl boolean value with the new blocking mode setting. Use 1 (or true, yes, or on) to set blocking mode, or 0 (or false, no, or off) for non-blocking mode.

Return Value

If newSetting is provided, returns the blocking state: 1 if blocking, 0 if non-blocking, before changing to the new setting. If newSetting is not provided, returns the current blocking state.

There are no error conditions other than argument errors.

Notes

You do not need to set a connection to non-blocking state to use the asynchronous query commands such as pg_sendquery. Furthermore, non-blocking mode has not been tested with other pgtcl commands, so the consequences of using non-blocking more are generally not known.

Caution

This command is part of a new Tcl interface to asynchronous query processing capabilities, and should be considered experimental. The command may change and backwards compatibility is not assured.