Re: overloading LIKE operator to handle integer + text - Mailing list pgsql-general

From Shaun Thomas
Subject Re: overloading LIKE operator to handle integer + text
Date
Msg-id 509037C7.3040702@optionshouse.com
Whole thread Raw
In response to Re: overloading LIKE operator to handle integer + text  ("David Johnston" <polobo@yahoo.com>)
List 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 by date:

Previous
From: "David Johnston"
Date:
Subject: Re: overloading LIKE operator to handle integer + text
Next
From: elliott@cpi.com
Date:
Subject: Autovacuum Launcher Process Exception