Re: [GENERAL] Operator based on data type

2012-01-13 Thread Chris Angelico
On Fri, Jan 13, 2012 at 5:27 PM, Craig Ringer 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 t

Re: [GENERAL] Operator based on data type

2012-01-12 Thread Craig Ringer
On 12/01/2012 9:20 PM, Daniel McGreal wrote: I have ended up writing a function (more accurately, two functions) which always convert a value into an array, either by returning the array immediately or by nesting it inside one so that all queries can use the second form, above. CREATE OR REPL

[GENERAL] Operator based on data type

2012-01-12 Thread Daniel McGreal
Good day! I started off writing a question to this list, but in so doing I thought of a solution! :) So, I'll try and record the result, in case anyone else finds themselves in this unfortunate situation or has suggestions for improvements (especially any regarding query performance). My system g

[GENERAL] Operator based on data type

2012-01-12 Thread Daniel McGreal
Good day! I started off writing a question to this list, but in so doing I thought of a solution! :) So, I'll try and record the result, in case anyone else finds themselves in this unfortunate situation or has suggestions for improvements (especially any regarding query performance). My system g