"Greg Quinn" <greg@officium.co.za> writes:
> Ok, then how do I make sure my query uses plpsql?
Queries, per se, don't use plpgsql. It's a language for writing
functions in, so you have to create a function. Look at the examples
in the manual, for instance on this page:
http://www.postgresql.org/docs/8.2/static/plpgsql-porting.html
regards, tom lane