From: | novnov <novnovice(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Error: Operator does not exist: "char"=integer |
Date: | 2008-12-18 19:24:20 |
Message-ID: | 21079266.post@talk.nabble.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
The error went away; I updated the admin tool I use (pg lightning admin) and
that seemed to help.
Thanks everyone.
Julius Tuskenis-2 wrote:
>
> Raymond O'Donnell rašė:
>> A lot of previously automatic casts were removed in the 8.3 series -
>> this is possibly one of them.
>>
>> You now need to cast explicitly in such cases, e.g.
>>
>> select '5'::integer;
>>
>> Ray.
>>
> That is a good advice and a good practice. But the solution usually
> takes time. For a quick (temporary) solution you could write your own
> operator for handling "char" = integer cases.
>
> I had to do it once for an "integer ILIKE text" operator:
>
> CREATE OR REPLACE FUNCTION of_integer_ilike_text(prm_integer integer,
> prm_text text)
> RETURNS boolean AS
> $BODY$BEGIN
> RETURN prm_integer::text ~~* prm_text ;
> END;$BODY$
> LANGUAGE 'plpgsql' VOLATILE
> COST 100;
> ALTER FUNCTION of_integer_ilike_text(integer, text) OWNER TO useris;
>
> CREATE OPERATOR ~~(
> PROCEDURE = of_integer_ilike_text,
> LEFTARG = int4,
> RIGHTARG = text);
>
> I'm sure you'll manage to do this for "text = integer";
>
> Julius Tuskenis
>
>
>
> --
> Sent via pgsql-general mailing list (pgsql-general(at)postgresql(dot)org)
> To make changes to your subscription:
> http://www.postgresql.org/mailpref/pgsql-general
>
>
--
View this message in context: http://www.nabble.com/Error%3A-Operator-does-not-exist%3A-%22char%22%3Dinteger-tp21067261p21079266.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.
From | Date | Subject | |
---|---|---|---|
Next Message | Lennin Caro | 2008-12-18 19:31:08 | alocate table in memory and multui listener |
Previous Message | Jeremiah Jahn | 2008-12-18 19:13:31 | Re: 8.1.11 PREPARE problem? |