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

From Pavel Stehule
Subject Re: Proposal: USING clause for DO statement
Date
Msg-id 162867790911210600p51ff17fh43766e9edcbf340@mail.gmail.com
Whole thread Raw
In response to Re: Proposal: USING clause for DO statement  (Andrew Dunstan <andrew@dunslane.net>)
Responses Re: Proposal: USING clause for DO statement
Re: Proposal: USING clause for DO statement
List pgsql-hackers
2009/11/21 Andrew Dunstan <andrew@dunslane.net>:
>
>
> Pavel Stehule wrote:
>>
>> What do you thing about this proposal?
>>
>>
>>
>
> I think it's premature. Before we start adding bells and whistles to the
> feature, let's give it a turn in the field.

why? It thing so not. My opinion - it is incomplete. It has similar
function like function without parameters now. It's good for some
static task (single-use). But it isn't practical for using in shell
scripts. Do you have a other mechanism for parametrisation? I would to
use it from bash - and I need some mechanism for passing an parameter
from command line to DO statement. I

>
> One possible problem: what type would these anonymous params be? (And, BTW,
> don't kid yourself that there would not very soon be pressure to name them).
>

It is solved long time - without specification, any parameter is
'unknown text'. It is based on PQexecParam functionality. In this
case, the situation is simpler - we know value - it same as EXECUTE
statement in plpgsql - type is defined by call. So we knows params (it
is supported by protocol), PL languages support params. So it needs
only some relation. It's need a few lines more in executor (copy a
four pointers and one int) and some in PL (local variable declaring
and copy values) + 5 lines in gram.y

Pavel

p.s. Maybe it is premature - We had to live with EXECUTE (without
USING clause) twelve years. But an life should be comfortable. I don't
would to wait twelve years :)


> cheers
>
> andrew
>


pgsql-hackers by date:

Previous
From: Andrew Dunstan
Date:
Subject: Re: Proposal: USING clause for DO statement
Next
From: Andrew Dunstan
Date:
Subject: Re: Proposal: USING clause for DO statement