Re: Proposal: USING clause for DO statement

Поиск
Список
Период
Сортировка
От Pavel Stehule
Тема Re: Proposal: USING clause for DO statement
Дата
Msg-id 162867790911211232j286b87d2m7c501f0924e4ef0e@mail.gmail.com
обсуждение исходный текст
Ответ на Re: Proposal: USING clause for DO statement  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: Proposal: USING clause for DO statement
Список pgsql-hackers
2009/11/21 Tom Lane <tgl@sss.pgh.pa.us>:
> Pavel Stehule <pavel.stehule@gmail.com> writes:
>> Hypothetically - when we are able to pass any value to DO script, then
>> I don't see problem. If I use Andrew's design - ${shellvar} and add it
>> to psql parser, then I could to write
>
>> \set par1 world
>
>> do $$
>>   begin
>>     raise notice 'Helo, % and %', $1, $2;
>>   end;
>> $$ using :par1, ${USER};
>
> Ick.  Double, triple ick.  It is astonishing to me how many people think
> that the solution to today's problem is always to invent some weird new
> syntax to plaster over SQL.  Which for some reason invariably involves
> dollar signs and/or curly braces ... there isn't even any originality
> involved :-(.
>
> Maybe we should accept one of these proposals, just so that it usurps
> that part of the syntax space forever and we can reject the next ten bad
> ideas out-of-hand.  Of course, if the SQL committee ever gets around to
> defining curly braces as doing something, we'll be screwed.
>
> colon-foo is bad enough.  Let's not add more.

I have a no problem. Syntax should be defined later. there is simple
workaround (using shellvariables):

psql ... -v user = $USER


I repeat it again and finish:

proposal is related only to DO statement (what is Pg specific).
Doesn't propose psql changes, doesn't propose PL changes.

good night
Pavel


>
>                        regards, tom lane
>


В списке pgsql-hackers по дате отправления:

Предыдущее
От: Heikki Linnakangas
Дата:
Сообщение: Re: Hot standby and removing VACUUM FULL
Следующее
От: Merlin Moncure
Дата:
Сообщение: Re: Proposal: USING clause for DO statement