Re: Operator based on data type - Mailing list pgsql-general

From Chris Angelico
Subject Re: Operator based on data type
Date
Msg-id CAPTjJmqboidv-i8PdpBJhOUL7OuTAvj77kGrzXEr+pUdNb_4=w@mail.gmail.com
Whole thread Raw
In response to Re: Operator based on data type  (Craig Ringer <ringerc@ringerc.id.au>)
List pgsql-general
On Fri, Jan 13, 2012 at 5:27 PM, Craig Ringer <ringerc@ringerc.id.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

pgsql-general by date:

Previous
From: Craig Ringer
Date:
Subject: Re: Compiling C function with VC++ for Windows version
Next
From: Yan Chunlu
Date:
Subject: Re: select statment going slow and slow while using IN (xx,xx)