From 51972a9d5d068dd34b24ff4923981ffb90e5cc2d Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 16 Feb 2003 02:30:39 +0000 Subject: 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. --- src/include/nodes/execnodes.h | 17 ++++++++++++++--- 1 file changed, 14 insertions(+), 3 deletions(-) (limited to 'src/include/nodes/execnodes.h') diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index 8d2b1305984..591870be515 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $Id: execnodes.h,v 1.94 2003/02/09 00:30:39 tgl Exp $ + * $Id: execnodes.h,v 1.95 2003/02/16 02:30:39 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -441,8 +441,9 @@ typedef struct ArrayRefExprState /* ---------------- * FuncExprState node * - * Although named for FuncExpr, this is also used for OpExpr and DistinctExpr - * nodes; be careful to check what xprstate.expr is actually pointing at! + * Although named for FuncExpr, this is also used for OpExpr, DistinctExpr, + * and NullIf nodes; be careful to check what xprstate.expr is actually + * pointing at! * ---------------- */ typedef struct FuncExprState @@ -539,6 +540,16 @@ typedef struct CaseWhenState ExprState *result; /* substitution result */ } CaseWhenState; +/* ---------------- + * CoalesceExprState node + * ---------------- + */ +typedef struct CoalesceExprState +{ + ExprState xprstate; + List *args; /* the arguments */ +} CoalesceExprState; + /* ---------------- * CoerceToDomainState node * ---------------- -- cgit v1.2.3