Re: request for advise - Mailing list pgsql-general

From Tom Lane
Subject Re: request for advise
Date
Msg-id 23109.1004983699@sss.pgh.pa.us
Whole thread Raw
In response to request for advise  ("Brian Hirt" <bhirt@mobygames.com>)
List pgsql-general
"Brian Hirt" <bhirt@mobygames.com> writes:
> I tried writing a function to
> recursively delete the list but it fails with "ERROR: unexpected SELECT
> query in exec_stmt_execsql()"

If you want to evaluate a SQL query and discard the results, plpgsql
wants you to say "PERFORM foo", not "SELECT foo".

Enough people have been confused by this that I think we ought to do
something: either allow SELECT with no destination, or at least reword
the error message to mention PERFORM.

Comments?

            regards, tom lane

pgsql-general by date:

Previous
From: "Eric Day"
Date:
Subject: Re: Stored procedures
Next
From: "Johnson, Shaunn"
Date:
Subject: postgres copy command