Re: proof concept: do statement parametrization
От | Florian Pflug |
---|---|
Тема | Re: proof concept: do statement parametrization |
Дата | |
Msg-id | E84DB895-2FA0-430E-9F8F-472508BFB5DF@phlo.org обсуждение исходный текст |
Ответ на | proof concept: do statement parametrization (Pavel Stehule <pavel.stehule@gmail.com>) |
Ответы |
Re: proof concept: do statement parametrization
|
Список | pgsql-hackers |
On Jul4, 2010, at 08:41 , Pavel Stehule wrote: > I enhanced DO statement syntax to allowing a parameters. Syntax is > relative simple: > > do ([varname] vartype := value, ...) $$ ... $$ I think it'd be more useful to put the values at the very end of the statement, not somewhere in the middle. For positionalparameters I envision do (vartype, ...) $$ ... $$ using value, ... and for named parameters it'd be do (varname vartype) $$ ... $$ using varname := value, ... I won't make a difference for your use-case, but it'd make it easier to call the same DO block with different parameters,like in the following shell snippet. COMMANDS="DO (arg int) $$ ... $$" (for a in arg1, arg2, arg3, arg4; do echo "$COMMANDS USING $a;" done) | psql best regards, Florian Pflug
В списке pgsql-hackers по дате отправления: