Re: 7.2.1: coalesce double-calls function? - Mailing list pgsql-general

From Tom Lane
Subject Re: 7.2.1: coalesce double-calls function?
Date
Msg-id 15607.1044383175@sss.pgh.pa.us
Whole thread Raw
In response to 7.2.1: coalesce double-calls function?  ("SZŰCS Gábor" <surrano@mailbox.hu>)
List pgsql-general
Kris Jurka <books@ejurka.com> writes:
> I have been looking at this and the NULLIF case seems complicatd.
> Essentially for NULLIF(left,right) I want to ExecEvalExpr(left,...)
> and construct a Const node with the result.  Then makeSimpleA_Expr for
> const left = right.

Uh, no; you are confusing parse-time and run-time work.  What you
probably want is a new node type that includes the OID of the
appropriate "=" operator but does different things with the result
than a normal "=" invocation would do.

Actually, thinking about it that way, it might just be a small variant
on the DistinctExpr node type that exists in current sources.  Certainly
DistinctExpr would be a good model to look at.

            regards, tom lane

pgsql-general by date:

Previous
From: "Johnson, Shaunn"
Date:
Subject: looking for system tables via ODBC
Next
From: Jeff Eckermann
Date:
Subject: Re: Dealing with complex queries