Re: regex_fixed_prefix() is still a few bricks shy of a load

From: Robert Haas <robertmhaas(at)gmail(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "pgsql-hackers(at)postgreSQL(dot)org" <pgsql-hackers(at)postgreSQL(dot)org>
Subject: Re: regex_fixed_prefix() is still a few bricks shy of a load
Date: 2012-07-07 19:46:26
Message-ID: E9AC540E-516E-49F8-B07C-379E100F3B48@gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Jul 7, 2012, at 1:46 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> wrote:
> 3. Try another approach entirely. The idea that I've got in mind here
> is to compile the regex using the regex library and then look at the
> compiled NFA representation to see if there must be a fixed prefix.
> I would not have risked this before this year, but after last winter's
> expeditions into the darkest corners of the regex library I feel
> competent to do it, and some quick study suggests that it might not take
> very much code to produce something that is significantly brighter than
> what we have now. However, there are a couple of arguments against
> pursuing this path:

I think this is clearly the best way forward, probably even in the back branches. It's true that the wchar to mb conversion is largely untested, but it's also pretty simple code. Sure, it could have bugs, but so could whatever work-around you cobble together to avoid back-patching it. And it's not like we'll break anything else, either: the code will only be used in the case that is buggy right now anyway.

...Robert

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2012-07-07 21:18:34 Re: Schema version management
Previous Message Alvaro Herrera 2012-07-07 19:46:11 Re: Schema version management