pg_result resultHandle resultOption
The handle for a query result.
Specifies one of several possible options.
the status of the result.
the error message, if the status indicates error; otherwise an empty string.
the connection that produced the result.
if the command was an INSERT, the OID of the inserted tuple; otherwise an empty string.
the number of tuples returned by the query.
the number of attributes in each tuple.
assign the results to a list of lists.
assign the results to an array, using subscripts of the form (tupno,attributeName).
assign the results to an array using the first attribute's value and the remaining attributes' names as keys. If appendstr is given then it is appended to each key. In short, all but the first field of each tuple are stored into the array, using subscripts of the form (firstFieldValue,fieldNameAppendStr).
returns the fields of the indicated tuple in a list. Tuple numbers start at zero.
stores the fields of the tuple in array arrayName, indexed by field names. Tuple numbers start at zero.
returns a list of the names of the tuple attributes.
returns a list of sublists, {name ftype fsize} for each tuple attribute.
clear the result query object.
pg_result returns information about a query result created by a prior pg_exec.
You can keep a query result around for as long as you need it, but when you are done with it, be sure to free it by executing pg_result -clear. Otherwise, you have a memory leak, and Pgtcl will eventually start complaining that you've created too many query result objects.