Skip site navigation (1) Skip section navigation (2)

Re: Unsigned int functions

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Adriaan Joubert <a(dot)joubert(at)albourne(dot)com>
Cc: Postgresql <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Unsigned int functions
Date: 2001-03-29 19:51:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-hackers
Adriaan Joubert <a(dot)joubert(at)albourne(dot)com> writes:
> Question is: should I add these functions? Are we looking at too much
> bloat, i.e. should I replace the (uint2,uint4) combinations with
> (int4,uint2) and (int4,uint4)? Lots of combinations are possible, but I
> do not have a good feel for the trade-offs. 

My guess is that we ought to avoid bloating the system with
cross-datatype functions.  I know there are some already for int2*int4
and so forth, but I'd like to see those go away in favor of a smarter
type promotion scheme --- ie, the parser should be able to figure out
that it ought to do int2_var * uint4_var as
	uint4_mul(uint4(int2_var), uint4_var)
A cross-datatype function ought to exist only if it can usefully do
something different from an implicit promotion.

Aside from bloating the system, providing a plethora of functions also
tends to confuse the ambiguous-function-call resolution mechanism.
See discussion of a few days ago wherein the parser could resolve an
ambiguous situation involving varchar, but could not resolve the same
situation with text, because there are too many possibilities for
coercion of text to something else.

			regards, tom lane

In response to


pgsql-hackers by date

Next:From: Alfred PerlsteinDate: 2001-03-29 19:57:30
Subject: Re: [ADMIN] Re: Re: [PORTS] pgmonitor and Solaris
Previous:From: Adriaan JoubertDate: 2001-03-29 19:16:09
Subject: Unsigned int functions

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group