Re: [SQL] [GENERAL] problem with overloading the "coalesce" function

2006-03-06 Thread Tom Lane
Richard Huxton writes: > Hmm - looking at the source (and \df in psql) it seems the basic problem > is that COALESCE() isn't a function. If it were an ordinary function, it couldn't satisfy the property of not evaluating "unused" arguments ... regards, tom lane

Re: [SQL] [GENERAL] problem with overloading the "coalesce" function

2006-03-06 Thread Richard Huxton
Emil Rachovsky wrote: --- Richard Huxton wrote: Emil Rachovsky wrote: Hi, I am trying to overload the "coalesce" function to accept an integer and a string. Here it is : CREATE OR REPLACE FUNCTION "coalesce"(a int4, b "varchar") RETURNS "varchar" AS ... I have added it to pg_catalog, b

Re: [SQL] [GENERAL] problem with overloading the "coalesce" function

2006-03-06 Thread Emil Rachovsky
--- Richard Huxton wrote: > Emil Rachovsky wrote: > > > > Hi, > > I am trying to overload the "coalesce" function to > > accept an integer and a string. Here it is : > > > > CREATE OR REPLACE FUNCTION "coalesce"(a int4, b > > "varchar") > > RETURNS "varchar" AS > ... > > I have added it to

Re: [SQL] [GENERAL] problem with overloading the "coalesce" function

2006-03-06 Thread Richard Huxton
Emil Rachovsky wrote: Hi, I am trying to overload the "coalesce" function to accept an integer and a string. Here it is : CREATE OR REPLACE FUNCTION "coalesce"(a int4, b "varchar") RETURNS "varchar" AS ... I have added it to pg_catalog, but still I cant't use it, I get an error on the seco