diff options
author | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-08 02:39:25 +0000 |
---|---|---|
committer | Tom Lane <tgl@sss.pgh.pa.us> | 2009-10-08 02:39:25 +0000 |
commit | 717fa274d14d9cd25396b85bb92f567e1c623f0c (patch) | |
tree | 4fe298a9faa1fc8f038a9a1f35ee033abc3e41ed /src/include/nodes/primnodes.h | |
parent | 2eda8dfb52ed9962920282d8384da8bb4c22514d (diff) | |
download | postgresql-717fa274d14d9cd25396b85bb92f567e1c623f0c.tar.gz postgresql-717fa274d14d9cd25396b85bb92f567e1c623f0c.zip |
Support use of function argument names to identify which actual arguments
match which function parameters. The syntax uses AS, for example
funcname(value AS arg1, anothervalue AS arg2)
Pavel Stehule
Diffstat (limited to 'src/include/nodes/primnodes.h')
-rw-r--r-- | src/include/nodes/primnodes.h | 25 |
1 files changed, 24 insertions, 1 deletions
diff --git a/src/include/nodes/primnodes.h b/src/include/nodes/primnodes.h index 5f5d4125c65..0320e231553 100644 --- a/src/include/nodes/primnodes.h +++ b/src/include/nodes/primnodes.h @@ -10,7 +10,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.150 2009/07/16 06:33:45 petere Exp $ + * $PostgreSQL: pgsql/src/include/nodes/primnodes.h,v 1.151 2009/10/08 02:39:24 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -314,6 +314,29 @@ typedef struct FuncExpr } FuncExpr; /* + * NamedArgExpr - a named argument of a function + * + * This node type can only appear in the args list of a FuncCall or FuncExpr + * node. We support pure positional call notation (no named arguments), + * named notation (all arguments are named), and mixed notation (unnamed + * arguments followed by named ones). + * + * Parse analysis sets argnumber to the positional index of the argument, + * but doesn't rearrange the argument list. + * + * The planner will convert argument lists to pure positional notation + * during expression preprocessing, so execution never sees a NamedArgExpr. + */ +typedef struct NamedArgExpr +{ + Expr xpr; + Expr *arg; /* the argument expression */ + char *name; /* the name */ + int argnumber; /* argument's number in positional notation */ + int location; /* argument name location, or -1 if unknown */ +} NamedArgExpr; + +/* * OpExpr - expression node for an operator invocation * * Semantically, this is essentially the same as a function call. |