Re: pg_execute_from_file review
| От | Tom Lane |
|---|---|
| Тема | Re: pg_execute_from_file review |
| Дата | |
| Msg-id | 28389.1291657315@sss.pgh.pa.us обсуждение |
| Ответ на | Re: pg_execute_from_file review (Robert Haas <robertmhaas@gmail.com>) |
| Ответы |
Re: pg_execute_from_file review
|
| Список | pgsql-hackers |
Robert Haas <robertmhaas@gmail.com> writes:
> On Sun, Dec 5, 2010 at 6:01 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:
>> Why is there a variadic replace() in this patch at all? It seems just
>> about entirely unrelated to the stated purpose of the patch, as well
>> as being of dubious usefulness. When would it be superior to
>> replace(replace(orig, from1, to1), from2, to2), ...
> An iterated replacement has different semantics from a simultaneous
> replace - replacing N placeholders with values simultaneously means
> you don't need to worry about the case where one of the replacement
> strings contains something that looks like a placeholder.
Good point, but what the patch implements is in fact iterated
replacement ... or at least it looked that way in a quick once-over.
> I actually
> think a simultaneous replacement feature would be quite handy but I
> make no comment on whether it belongs as part of this patch.
My point is that the replacement stuff really really needs to be
factored out of the string-execution stuff, precisely because the
desired behavior is debatable.
regards, tom lane
В списке pgsql-hackers по дате отправления: