Re: [Spacewalk-devel] PATCH: make NVL work in PostgreSQL

2010-10-07 Thread Jan Pazdziora
On Mon, Oct 04, 2010 at 11:12:37AM -0400, Tom Lane wrote: I'm affraid we cannot just use = here: I think $1 is not distinct from $2 would be more appropriate, if you Right. Except, that will not work in Oracle, so we couldn't use one syntax for both. expect the null, null, x, y case to

Re: [Spacewalk-devel] PATCH: make NVL work in PostgreSQL

2010-10-04 Thread Jan Pazdziora
On Tue, Aug 10, 2010 at 08:31:19PM +0800, Colin Coe wrote: Hi all Attached is a patch that makes the NVL errors GoAway(tm). Pushed, thanks. -- Jan Pazdziora Principal Software Engineer, Satellite Engineering, Red Hat ___ Spacewalk-devel mailing

Re: [Spacewalk-devel] PATCH: make NVL work in PostgreSQL

2010-10-04 Thread Jan Pazdziora
On Tue, Aug 10, 2010 at 09:12:07PM +0800, Colin Coe wrote: + +create or replace +function decode(value anyelement, s1 anyelement, r1 anyelement, def anyelement) returns anyelement +as +$$ +select case + when +$1=$2 + then +$3 + else +$4 +end; +$$ +LANGUAGE SQL;

Re: [Spacewalk-devel] PATCH: make NVL work in PostgreSQL

2010-10-04 Thread Tom Lane
Jan Pazdziora jpazdzi...@redhat.com writes: On Tue, Aug 10, 2010 at 09:12:07PM +0800, Colin Coe wrote: +create or replace +function decode(value anyelement, s1 anyelement, r1 anyelement, def anyelement) returns anyelement +as +$$ +select case + when +$1=$2 + then +$3 +

Re: [Spacewalk-devel] PATCH: make NVL work in PostgreSQL

2010-08-10 Thread Colin Coe
On Tue, Aug 10, 2010 at 8:31 PM, Colin Coe colin@gmail.com wrote: Hi all Attached is a patch that makes the NVL errors GoAway(tm). Thanks CC This patch overloads the NVL stored procedure as well as adding a decode stored procedure. With this patch and the last, quite a few more pages