Re: overloading LIKE operator to handle integer + text
От | Shaun Thomas |
---|---|
Тема | Re: overloading LIKE operator to handle integer + text |
Дата | |
Msg-id | 509037C7.3040702@optionshouse.com обсуждение исходный текст |
Ответ на | Re: overloading LIKE operator to handle integer + text ("David Johnston" <polobo@yahoo.com>) |
Список | pgsql-general |
On 10/30/2012 03:14 PM, David Johnston wrote: > "LIKE" is apparently not an operator but a special SQL construct. Almost. :) The real problem is this, from the manual: "The operator name is a sequence of up to NAMEDATALEN-1 (63 by default) characters from the following list: + - * / < > = ~ ! @ # % ^ & | ` ? Grandparent might also want to mark his function as immutable so its execution can be optimized. Aside from that, this works: CREATE OPERATOR ~~ (LEFTARG=integer, RIGHTARG=text, PROCEDURE=my_like); However, this only creates it in the current schema. If this really should be usable for everyone, this should be the final statement: CREATE OPERATOR PUBLIC.~~ (LEFTARG=integer, RIGHTARG=text, PROCEDURE=my_like); -- Shaun Thomas OptionsHouse | 141 W. Jackson Blvd. | Suite 500 | Chicago IL, 60604 312-444-8534 sthomas@optionshouse.com ______________________________________________ See http://www.peak6.com/email_disclaimer/ for terms and conditions related to this email
В списке pgsql-general по дате отправления: