Re: BUG #15445: Difference between two dates is not an integer

From: Sergei Kornilov <sk(at)zsrv(dot)org>
To: "martin(dot)varady(at)gmail(dot)com" <martin(dot)varady(at)gmail(dot)com>, "pgsql-bugs(at)lists(dot)postgresql(dot)org" <pgsql-bugs(at)lists(dot)postgresql(dot)org>
Subject: Re: BUG #15445: Difference between two dates is not an integer
Date: 2018-10-19 13:26:27
Message-ID: 21769501539955587@iva5-d3020dc3459d.qloud-c.yandex.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Hello

Works for me in pg 10.5, 11.0, and 9.6

Try this query:
SELECT n.nspname as "Schema",
o.oprname AS "Name",
CASE WHEN o.oprkind='l' THEN NULL ELSE pg_catalog.format_type(o.oprleft, NULL) END AS "Left arg type",
CASE WHEN o.oprkind='r' THEN NULL ELSE pg_catalog.format_type(o.oprright, NULL) END AS "Right arg type",
pg_catalog.format_type(o.oprresult, NULL) AS "Result type",
coalesce(pg_catalog.obj_description(o.oid, 'pg_operator'),
pg_catalog.obj_description(o.oprcode, 'pg_proc')) AS "Description"
FROM pg_catalog.pg_operator o
LEFT JOIN pg_catalog.pg_namespace n ON n.oid = o.oprnamespace
WHERE o.oprname OPERATOR(pg_catalog.=) '-'
AND o.oprleft OPERATOR(pg_catalog.=) (select oid from pg_type where typname OPERATOR(pg_catalog.=) 'date')
AND o.oprleft OPERATOR(pg_catalog.=) o.oprright
AND pg_catalog.pg_operator_is_visible(o.oid)
ORDER BY 1, 2, 3, 4;

Maybe you have custom operators?

regards, Sergei

In response to

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Martin Varady 2018-10-19 14:05:46 Re: BUG #15445: Difference between two dates is not an integer
Previous Message PG Bug reporting form 2018-10-19 13:14:47 BUG #15445: Difference between two dates is not an integer