Re: PL/pgSQL PERFORM with CTE

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Merlin Moncure <mmoncure(at)gmail(dot)com>
Cc: Josh Berkus <josh(at)agliodbs(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Jan Wieck <JanWieck(at)yahoo(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 18:51:32
Message-ID: CAFj8pRBqYqRB0y4r9Zihs_Nzkss=OCEERnn8fDAr0uXDzikjsw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2013/8/23 Merlin Moncure <mmoncure(at)gmail(dot)com>

> On Fri, Aug 23, 2013 at 1:38 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
> wrote:
> >
> >
> >
> > 2013/8/23 Merlin Moncure <mmoncure(at)gmail(dot)com>
> > I think so is not good if some programming language functionality does
> one
> > in one context (functions) and does something else in second context
> > (procedures).
>
> It's not really different -- it means 'return if able'. Also there
> are a lot of things that would have to be different for other reasons
> especially transaction management. It's not reasonable to expect same
> behavior in function vs procedure context -- especially in terms of
> sending output to the caller.
>
> > On second hand, I am thinking so requirement PERFORM is good. A query
> that
> > does some, but result is ignored, is strange (and it can be a performance
> > fault), so we should not be too friendly in this use case.
>
> Completely disagree. There are many cases where this is *not*
> strange. For example:
> SELECT writing_func(some_col) FROM foo;
>

it is about a personal taste - if you prefer more verbose or less verbose
languages.

I feeling a PERFORM usage as something special and you example is nice
case, where I am think so PERFORM is good for verbosity.

Regards

Pavel

>
> merlin
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message David E. Wheeler 2013-08-23 19:01:11 Re: PL/pgSQL PERFORM with CTE
Previous Message Pavel Stehule 2013-08-23 18:45:05 Re: Performance problem in PLPgSQL