Re: Does Type Have = Operator? - Mailing list pgsql-hackers

From Euler Taveira
Subject Re: Does Type Have = Operator?
Date
Msg-id 57328848.4010509@timbira.com.br
Whole thread Raw
In response to Does Type Have = Operator?  ("David E. Wheeler" <david@justatheory.com>)
Responses Re: Does Type Have = Operator?  ("David G. Johnston" <david.g.johnston@gmail.com>)
List pgsql-hackers
On 10-05-2016 21:12, David E. Wheeler wrote:
> This makes sense, of course, and I could fix it by comparing text
> values instead of json values when the values are JSON. But of course
> the lack of a = operator is not limited to JSON. So I’m wondering if
> there’s an interface at the SQL level to tell me whether a type has
> an = operator? That way I could always use text values in those
> situations.
> 
There isn't an equality notation at catalogs. You could try "SELECT
oprname FROM pg_operator WHERE oprcode::text ~ 'eq'" but it is too
fragile. You could also try oprname, oprrest or oprjoin but the result
is worse than the former solution. You definitely need a hack.

Also, IS DISTINCT FROM is an alias for = operator per standard IIRC.


--   Euler Taveira                   Timbira - http://www.timbira.com.br/  PostgreSQL: Consultoria, Desenvolvimento,
Suporte24x7 e Treinamento
 



pgsql-hackers by date:

Previous
From: "David G. Johnston"
Date:
Subject: Re: Does Type Have = Operator?
Next
From: "David G. Johnston"
Date:
Subject: Re: Accurate list of Keywords / Datatypes?