summaryrefslogtreecommitdiff
path: root/src/include/nodes/primnodes.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2003-02-16 02:30:39 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2003-02-16 02:30:39 +0000
commit51972a9d5d068dd34b24ff4923981ffb90e5cc2d (patch)
treec68fddbb3eaafbd332e84afbafe3c171f6372d4e /src/include/nodes/primnodes.h
parentde25638d2fbe9e56ecfc60a7dda8a0c56028317a (diff)
downloadpostgresql-51972a9d5d068dd34b24ff4923981ffb90e5cc2d.tar.gz
COALESCE() and NULLIF() are now first-class expressions, not macros
that turn into CASE expressions. They evaluate their arguments at most once. Patch by Kris Jurka, review and (very light) editorializing by me.
Diffstat (limited to 'src/include/nodes/primnodes.h')
-rw-r--r--src/include/nodes/primnodes.h20
1 files changed, 19 insertions, 1 deletions
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h
index be917c4f26..b8a358d614 100644
--- a/src/include/nodes/primnodes.h
+++ b/src/include/nodes/primnodes.h
@@ -10,7 +10,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: primnodes.h,v 1.79 2003/02/09 00:30:40 tgl Exp $
+ * $Id: primnodes.h,v 1.80 2003/02/16 02:30:39 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -537,6 +537,24 @@ typedef struct CaseWhen
Expr *result; /* substitution result */
} CaseWhen;
+/*
+ * CoalesceExpr - a COALESCE expression
+ */
+typedef struct CoalesceExpr
+{
+ Expr xpr;
+ Oid coalescetype; /* type of expression result */
+ List *args; /* the arguments */
+} CoalesceExpr;
+
+/*
+ * NullIfExpr - a NULLIF expression
+ *
+ * Like DistinctExpr, this is represented the same as an OpExpr referencing
+ * the "=" operator for x and y.
+ */
+typedef OpExpr NullIfExpr;
+
/* ----------------
* NullTest
*