Re: Does Type Have = Operator?

Поиск
Список
Период
Сортировка
От Euler Taveira
Тема Re: Does Type Have = Operator?
Дата
Msg-id 57328848.4010509@timbira.com.br
обсуждение исходный текст
Ответ на Does Type Have = Operator?  ("David E. Wheeler" <david@justatheory.com>)
Ответы Re: Does Type Have = Operator?  ("David G. Johnston" <david.g.johnston@gmail.com>)
Список 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 по дате отправления:

Предыдущее
От: "David G. Johnston"
Дата:
Сообщение: Re: Does Type Have = Operator?
Следующее
От: "David G. Johnston"
Дата:
Сообщение: Re: Accurate list of Keywords / Datatypes?