Lonnie Cumberland <lonnie_cumberland@yahoo.com> writes:
> Actually I have the need at different places in my functions to
> sometimes work on the list items returned from a query and also have
> the need to just work on the first result returned by a query.
SELECT ... LIMIT 1 will serve the second need. For the first, perhaps
use the FOR ... loop construct in plpgsql.
regards, tom lane