Search Postgresql Archives

Re: doesn't recognize "!=-" (not equal to a negative value)

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



On 7/11/06, Paul Tilles <Paul.Tilles@xxxxxxxx> wrote:
Yes.  That works.  I think that the parser should work properly either way.

it works properly. just the proper way of functioning is not the one you would like to have.
you can simply add this operator:

CREATE FUNCTION not_equals_minus(int8, int8) RETURNS bool AS $BODY$
    SELECT $1 <> -$2;
$BODY$ LANGUAGE SQL IMMUTABLE STRICT;

CREATE OPERATOR !=- (
     leftarg = int8,
     rightarg = int8,
     procedure = not_equals_minus,
     commutator = !=-
);


and then:
> select 1!=-2;
 ?column?
----------
 t
(1 row)

depesz

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux