Re: Adding a distinct "pattern" type to resolve the "~" commutator stalemate
От | David E. Wheeler |
---|---|
Тема | Re: Adding a distinct "pattern" type to resolve the "~" commutator stalemate |
Дата | |
Msg-id | 0134E293-FF0E-4A4B-B153-203D077F5B57@kineticode.com обсуждение исходный текст |
Ответ на | Re: Adding a distinct "pattern" type to resolve the "~" commutator stalemate (Florian Pflug <fgp@phlo.org>) |
Ответы |
Re: Adding a distinct "pattern" type to resolve the "~" commutator stalemate
|
Список | pgsql-hackers |
On Jun 19, 2011, at 4:56 PM, Florian Pflug wrote: > Hm, it seems we either all have different idea about how such > a pattern type would be be defined, or have grown so accustomed to > pg's type system that we've forgotten how powerful it really > is ;-) (For me, the latter is surely true...). > > I've now created a primitive prototype that uses a composite > type for "pattern". That changes the input syntax for patterns > (you need to enclose them in brackets), but should model all > the implicit and explicit casting rules and operator selection > correctly. It also uses "~~~" in place of "~", for obvious > reasons and again without changing the casting and overloading > rules. Ew. > The prototype defines > text ~~~ text > text ~~~ pattern > pattern ~~~ text > and can be found at end of this mail. > > With that prototype, *all* the cases (even unknown ~~~ unknown) > work as today, i.e. all of the statements below return true Florian++ Very nice, thanks! I don't suppose there's a special quoting to be had for patterns? Perhaps one of these (modulo SQL parsing issues); /pattern/ {pattern} qr/pattern/ qr'pattern' R/pattern/ R'pattern' Mike bikeshed is scarlet, David
В списке pgsql-hackers по дате отправления: