Re: request for advise - Mailing list pgsql-general

From Justin Clift
Subject Re: request for advise
Date
Msg-id 3BE799C5.62D8031B@postgresql.org
Whole thread Raw
In response to request for advise  ("Brian Hirt" <bhirt@mobygames.com>)
List pgsql-general
Tom Lane wrote:
>
> "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?

I think re-wording the error message is the way to go here.  It's easy
and doesn't unexpectedly change functionality.

:-)

Regards and best wishes,

Justin Clift

>
>                         regards, tom lane
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/users-lounge/docs/faq.html

--
"My grandfather once told me that there are two kinds of people: those
who work and those who take the credit. He told me to try to be in the
first group; there was less competition there."
   - Indira Gandhi

pgsql-general by date:

Previous
From: Jean-Michel POURE
Date:
Subject: Re: Use of Serial Datatype and Sequence Issue
Next
From: Jean-Michel POURE
Date:
Subject: Re: Drop column and multiple db query