Julien Rouhaud <rjuju123(at)gmail(dot)com> writes:
> SplitIdentifierString can run pretty much forever without hitting a CFI. This
> is mostly due to scan_quoted_identifier having O(n2) complexity, but the same
> problem exists to a lesser degree in SplitIdentifierString.
> I hit that problem by setting by mistake (bug in a some client app) search_path
> to a big list of double quotes.
> Simple patch attached, adding a couple of CFI in the mentioned functions.
This seems like a pretty bad idea, because it will inject the
possibility of elog() into GUC callbacks that aren't supposed to
do that.
Why is this O(N^2), and can't we fix that?
regards, tom lane