Re: expression evaluation with expected datatypes - Mailing list pgsql-hackers

From Dimitri Fontaine
Subject Re: expression evaluation with expected datatypes
Date
Msg-id m2liirkfbu.fsf@2ndQuadrant.fr
Whole thread Raw
In response to expression evaluation with expected datatypes  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: expression evaluation with expected datatypes  (Pavel Stehule <pavel.stehule@gmail.com>)
Re: expression evaluation with expected datatypes  (Tom Lane <tgl@sss.pgh.pa.us>)
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> When I worked on parametrised DO statement, I had to solve following issue:

DO currently is a utility command, not a query. Do you mean to change
that?

Also, did you think about a lambda construct, which is basically
allowing functions to be defined inline in a query?

We could imagine several syntax to show up the idea, common keywords
here include LAMBDA, FLET or LABELS, but I think that expanding WITH
would be preferable for us.
 WITH FUNCTION foo(param list) returns rettype language foo AS (   definition here ) <query using foo() here>;

Other WITH extensions we can think about include support for DCL as
asked by David Fetter in the past already, and support for variables too
(a kind of per-query SET LOCAL).

I don't see how adding parameters and return values to utility commands
is going to be easier than adding a "lambda" facility.

Regards,
-- 
Dimitri Fontaine
http://2ndQuadrant.fr     PostgreSQL : Expertise, Formation et Support


pgsql-hackers by date:

Previous
From: "Colin 't Hart"
Date:
Subject: [PATCH] psql \n shortcut for set search_path =
Next
From: Dimitri Fontaine
Date:
Subject: Re: pg_prewarm