Re: SIMILAR TO syntax (Was: Re: The TODO List (Was: Re: [HACKERS] O...)

2002-09-22 Thread Tom Lane

> On Thu, 19 Sep 2002, Tom Lane wrote:
>> AFAICS, getting SIMILAR TO to operate per spec would require adding some
>> sort of translation function that converts the spec-style pattern into
>> a Posix pattern that our regex match engine would handle.

I did something about this.  The translation function probably needs
work (for one thing, it's not multibyte-aware) but it's a start; and
we shouldn't need any more initdbs to tweak it.

regards, tom lane

---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])



SIMILAR TO syntax (Was: Re: The TODO List (Was: Re: [HACKERS] O...)

2002-09-19 Thread Marc G. Fournier

On Thu, 19 Sep 2002, Tom Lane wrote:

> "Marc G. Fournier" <[EMAIL PROTECTED]> writes:
> > Who implemented SIMILAR TO in the first place?
>
> Thomas.  He put in the syntax, but as it stands it's simply syntactic
> sugar for ~ --- that is, our Posix-compatible regex match operator.
> Since the spec demands very non-Posix behavior, this is wrong.
>
> AFAICS, getting SIMILAR TO to operate per spec would require adding some
> sort of translation function that converts the spec-style pattern into
> a Posix pattern that our regex match engine would handle.  This would at
> least require adding ^ and $ around the pattern, converting the escape
> character if any, and translating % and _ into .* and . respectively.
> There are probably some differences of detail that we'd need to fix
> later, but that would get it to a state where we need not be ashamed
> to release it.
>
> We already have a similar mechanism for handling LIKE ... ESCAPE
> clauses, so it doesn't seem too difficult to do.  But I haven't got
> time for it...

'K, just curious here, but ... Thomas, do you agree with Tom's
interpretation of the spec?  If so, would it be possible to get the above
fixed?

Or is there an ambiguity there (not like *that* has never happened before)
that Tom/Peter are being more strict about then the spec requires?




---(end of broadcast)---
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to [EMAIL PROTECTED])