From: | Chris Angelico <rosuav(at)gmail(dot)com> |
---|---|
To: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: Operator based on data type |
Date: | 2012-01-13 08:03:56 |
Message-ID: | CAPTjJmqboidv-i8PdpBJhOUL7OuTAvj77kGrzXEr+pUdNb_4=w@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
On Fri, Jan 13, 2012 at 5:27 PM, Craig Ringer <ringerc(at)ringerc(dot)id(dot)au> wrote:
> Oooh, that's clever. Nice!
>
> People say function overloading is no good ....
They do??
I wrote a similar set of functions to simplify a particular piece of
UI code. Three functions called 'str2int'; one takes varchar and
returns int, one takes int and returns int, and one takes bigint and
returns bigint. I can pass anything the UI works with through these,
and I have a guarantee that it'll compare as integer. (The varchar one
isn't quite the same as casting to int; it swallows errors and returns
0, because that's what we want to achieve.) Function overloading is
awesome!
ChrisA
From | Date | Subject | |
---|---|---|---|
Next Message | Yan Chunlu | 2012-01-13 08:33:08 | Re: select statment going slow and slow while using IN (xx,xx) |
Previous Message | eshishki | 2012-01-13 07:41:44 | Re: Corrupted index, what do i do?ruc |