Re: Anonymous Code Blocks as Lambdas?

From: "David E(dot) Wheeler" <david(at)kineticode(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Anonymous Code Blocks as Lambdas?
Date: 2009-10-26 21:00:08
Message-ID: 69F6216B-D9AC-42B1-9795-987BDB890859@kineticode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Oct 26, 2009, at 1:21 PM, Tom Lane wrote:

> A lambda facility would require being able to pass arguments and
> return
> results, which we intentionally left out of DO to keep it simple. By
> the time you add all that notation, it's far from clear that you
> shouldn't just define a function.

Well sometimes I want to do something like that as an expression,
rather than having to write a separate statement that declares a
function.

> Also, DO is (intended to be) optimized for execute-once behavior.
> A lambda block inside a query shouldn't assume that. So it would
> not be
> the same facility from either a syntax or an implementation
> standpoint.

Perhaps lambda isn't the proper term.

Best,

David

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Greg Stark 2009-10-26 21:06:42 Re: Parsing config files in a directory
Previous Message David E. Wheeler 2009-10-26 20:59:08 Re: Anonymous Code Blocks as Lambdas?