Re: Proposal: USING clause for DO statement

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
Cc: Andrew Dunstan <andrew(at)dunslane(dot)net>, Petr Jelinek <pjmodos(at)pjmodos(dot)net>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Proposal: USING clause for DO statement
Date: 2009-11-21 20:14:03
Message-ID: 27770.1258834443@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Pavel Stehule <pavel(dot)stehule(at)gmail(dot)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.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2009-11-21 20:18:31 Re: Proposal: USING clause for DO statement
Previous Message Tom Lane 2009-11-21 20:03:35 Re: Hot standby and removing VACUUM FULL