Re: Proposal: USING clause for DO statement - Mailing list pgsql-hackers

From Tom Lane
Subject Re: Proposal: USING clause for DO statement
Date
Msg-id 14791.1258818539@sss.pgh.pa.us
Whole thread Raw
In response to Re: Proposal: USING clause for DO statement  (Pavel Stehule <pavel.stehule@gmail.com>)
Responses Re: Proposal: USING clause for DO statement
List pgsql-hackers
Pavel Stehule <pavel.stehule@gmail.com> writes:
> 2009/11/21 Andrew Dunstan <andrew@dunslane.net>:
>> One possible problem: what type would these anonymous params be?

> It is solved long time - without specification, any parameter is
> 'unknown text'.

Nonsense.

We do have the ability to infer parameter types when parsing a SQL
statement. That does not extend to any random PL being able to do it.
In fact, NONE of them can do it, not even plpgsql.  They all expect
incoming parameter types to be predetermined.

Without types *and* names, there is no point in considering parameters.
And the problem with that, which is why we didn't put parameters into
DO in the first place, is that it raises the minimum notational bar
quite a lot.  You might as well go ahead and define a temporary
function.
        regards, tom lane


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Proposal: USING clause for DO statement
Next
From: Tom Lane
Date:
Subject: Re: DEFAULT of domain ignored in plpgsql (8.4.1)