From: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> |
---|---|
To: | Robert Haas <robertmhaas(at)gmail(dot)com> |
Cc: | Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>, Dimitri Fontaine <dimitri(at)2ndquadrant(dot)fr>, Joshua Tolley <eggyknap(at)gmail(dot)com>, pgsql-hackers(at)postgresql(dot)org |
Subject: | Re: pg_execute_from_file review |
Date: | 2010-12-06 17:41:55 |
Message-ID: | 28389.1291657315@sss.pgh.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-hackers |
Robert Haas <robertmhaas(at)gmail(dot)com> writes:
> On Sun, Dec 5, 2010 at 6:01 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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
From | Date | Subject | |
---|---|---|---|
Next Message | Josh Berkus | 2010-12-06 17:49:16 | Re: profiling connection overhead |
Previous Message | Tom Lane | 2010-12-06 17:38:42 | Re: profiling connection overhead |