diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-26 22:05:42 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2005-06-26 22:05:42 +0000 |
commit | 943b396245bd699a66c894c5e11303b3ef93ac7b (patch) | |
tree | a08720e308259beb253e4b4b21f2f08e391a4d9f /src/include | |
parent | d395aecffad7cc6bd043e2d81a1bed5b3fe2f5fa (diff) | |
download | postgresql-943b396245bd699a66c894c5e11303b3ef93ac7b.tar.gz postgresql-943b396245bd699a66c894c5e11303b3ef93ac7b.zip |
Add Oracle-compatible GREATEST and LEAST functions. Pavel Stehule
Diffstat (limited to 'src/include')
-rw-r--r-- | src/include/nodes/execnodes.h | 13 | ||||
-rw-r--r-- | src/include/nodes/nodes.h | 4 | ||||
-rw-r--r-- | src/include/nodes/primnodes.h | 19 |
3 files changed, 33 insertions, 3 deletions
diff --git a/src/include/nodes/execnodes.h b/src/include/nodes/execnodes.h index df41c856108..46d27a56f53 100644 --- a/src/include/nodes/execnodes.h +++ b/src/include/nodes/execnodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.135 2005/06/20 18:37:02 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/execnodes.h,v 1.136 2005/06/26 22:05:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -674,6 +674,17 @@ typedef struct CoalesceExprState } CoalesceExprState; /* ---------------- + * MinMaxExprState node + * ---------------- + */ +typedef struct MinMaxExprState +{ + ExprState xprstate; + List *args; /* the arguments */ + FmgrInfo cfunc; /* lookup info for comparison func */ +} MinMaxExprState; + +/* ---------------- * CoerceToDomainState node * ---------------- */ diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h index d9c98321ea3..fd923f72af4 100644 --- a/src/include/nodes/nodes.h +++ b/src/include/nodes/nodes.h @@ -7,7 +7,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.170 2005/06/09 04:19:00 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/nodes.h,v 1.171 2005/06/26 22:05:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -126,6 +126,7 @@ typedef enum NodeTag T_ArrayExpr, T_RowExpr, T_CoalesceExpr, + T_MinMaxExpr, T_NullIfExpr, T_NullTest, T_BooleanTest, @@ -159,6 +160,7 @@ typedef enum NodeTag T_ArrayExprState, T_RowExprState, T_CoalesceExprState, + T_MinMaxExprState, T_CoerceToDomainState, T_DomainConstraintState, diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index a1d1ef3ebf0..279b79738ef 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2005, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.107 2005/04/06 16:34:07 tgl Exp $ + * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.108 2005/06/26 22:05:41 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -658,6 +658,23 @@ typedef struct CoalesceExpr } CoalesceExpr; /* + * MinMaxExpr - a GREATEST or LEAST function + */ +typedef enum MinMaxOp +{ + IS_GREATEST, + IS_LEAST +} MinMaxOp; + +typedef struct MinMaxExpr +{ + Expr xpr; + Oid minmaxtype; /* common type of arguments and result */ + MinMaxOp op; /* function to execute */ + List *args; /* the arguments */ +} MinMaxExpr; + +/* * NullIfExpr - a NULLIF expression * * Like DistinctExpr, this is represented the same as an OpExpr referencing |