Re: [BUGS] BUG #14854: daterange[] is an anyarray or anyrange? - Mailing list pgsql-bugs

From David G. Johnston
Subject Re: [BUGS] BUG #14854: daterange[] is an anyarray or anyrange?
Date
Msg-id CAKFQuwZUWHomK4E=nt_sErPMSnY7TQsmwMrwTFEz1eLtfTO=yQ@mail.gmail.com
Whole thread Raw
In response to Re: [BUGS] BUG #14854: daterange[] is an anyarray or anyrange?  (Szilfai Balázs <balazs@obiserver.hu>)
List pgsql-bugs
On Fri, Oct 13, 2017 at 1:42 PM, Szilfai Balázs <balazs@obiserver.hu> wrote:
Thanks a lot!

Ok, the (daterange, date[]) invocation is working now with (anyelement,
anyarray) param list.

I ​assume you meant (daterate, daterange[])​

But now is working with eg. (date, date[]) invocation. I can't forbid it
anyway?

​No.  It also matches (text, text[]) and "(integer, integer[])".  The best you can do is detect non-range values in the first argument and raise an exception.  Or define explicitly typed functions for the variants you care about and drop the polymorphism.

David J.

pgsql-bugs by date:

Previous
From: Szilfai Balázs
Date:
Subject: Re: [BUGS] BUG #14854: daterange[] is an anyarray or anyrange?
Next
From: Tom Lane
Date:
Subject: Re: [BUGS] BUG #14854: daterange[] is an anyarray or anyrange?