pg_select
Description
pg_select submits a query
(SELECT statement) to the
PostgreSQL server and executes a given
chunk of code for each row in the result. The
commandString must be a
SELECT statement; anything else returns an
error. The arrayVar variable is an array
name used in the loop. For each row,
arrayVar is filled in with the row values,
using the column names as the array indices. Then the
procedure is executed.
In addition to the column values, the following special entries are made in the array:
- .headers
A list of the column names returned by the query.
- .numcols
The number of columns returned by the query.
- .tupno
The current row number, starting at zero and incrementing for each iteration of the loop body.
Report a documentation issue
Read the upstream documentation. For corrections, first check the current manual.