Re: PL/pgSQL PERFORM with CTE

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Josh Berkus <josh(at)agliodbs(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jan Wieck <JanWieck(at)yahoo(dot)com>, Merlin Moncure <mmoncure(at)gmail(dot)com>, Andres Freund <andres(at)2ndquadrant(dot)com>, "David E(dot) Wheeler" <david(at)justatheory(dot)com>, pgsql-hackers Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: PL/pgSQL PERFORM with CTE
Date: 2013-08-23 03:42:31
Message-ID: CAFj8pRBbu5DvqZgg9TXkNcSwCD4vDa=x2=Uvhb10sfFvPr7T8Q@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/8/23 Josh Berkus <josh(at)agliodbs(dot)com>

> Tom,
>
>
> > Jan might remember more about his thought process here, but I'm thinking
> > that he copied the SELECT-must-have-INTO rule and then chose to invent
> > a new statement for the case of wanting to discard the result. I think
> > you could make an argument for that being good from an
> oversight-detection
> > standpoint, but it's not a really strong argument. Particularly in view
> > of the difficulty we'd have in supporting WITH ... PERFORM ... nicely,
> > it doesn't seem unreasonable to just allow SELECT-without-INTO.
>
> For my own part, I have to correct forgetting to substitute "PERORM" for
> "SELECT" around 200 times each major PL/pgSQL project. So it would be
> user-friendly for it to go away.
>

But it can have a different reason. In T-SQL (Microsoft or Sybase) or MySQL
a unbound query is used to direct transfer data to client side.

There

BEGIN
SELECT 10;
END;

doesn't mean "ignore result of query", but it means push result to client.

And we doesn't support this functionality, so I prefer doesn't allow this
syntax.

Regards

Pavel

>
> --
> Josh Berkus
> PostgreSQL Experts Inc.
> http://pgexperts.com
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Amit Kapila 2013-08-23 03:57:10 Re: ALTER SYSTEM SET command to change postgresql.conf parameters (RE: Proposal for Allow postgresql.conf values to be changed via SQL [review])
Previous Message Josh Berkus 2013-08-23 00:18:57 Re: PL/pgSQL PERFORM with CTE