Re: extend pgbench expressions with functions

From: Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>
To: Fabien COELHO <coelho(at)cri(dot)ensmp(dot)fr>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, PostgreSQL Developers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: extend pgbench expressions with functions
Date: 2015-11-04 15:11:44
Message-ID: 20151104151143.GR6104@alvherre.pgsql
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Fabien COELHO wrote:

> For instance for "random_gaussian(int, int, double)", it may be called with
> any combination of 3 int/double arguments, each one must be tested and
> possibly converted to the target type before calling the actual function.
> For overloaded operators or functions (arithmetics, abs...) there is also
> the decision about which operator is called and then what conversions are
> necessary.

I think we should make this as simple as possible -- in particular I
don't see a lot of value in overloading here. I'd rather have it throw
an error and force you to write the double with a ".0" when the given
value is an integer so that it is parsed as a double, rather than
accepting ambiguous input. Conversely, if you pass a double to the
integer options, raise an error.

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Kouhei Kaigai 2015-11-04 15:13:55 Re: CustomScan support on readfuncs.c
Previous Message Simon Riggs 2015-11-04 15:07:57 Re: Bitmap index scans use of filters on available columns