From eb47ee486538fb0ea81917b3e35d6cff9f7a0ec7 Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Tue, 29 Mar 2005 17:58:51 +0000 Subject: Fix grammar for IN/OUT/INOUT parameters. This commit doesn't actually implement any new feature, it just pushes the 'not implemented' error message deeper into the backend. I also tweaked the grammar to accept Oracle-ish parameter syntax (parameter name first), as well as the SQL99 standard syntax (parameter mode first), since it was easy and people will doubtless try to use both anyway. --- src/include/nodes/parsenodes.h | 17 +++++++++++++++-- 1 file changed, 15 insertions(+), 2 deletions(-) (limited to 'src/include') diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h index 8cf274b14ce..a6a79e3a4fa 100644 --- a/src/include/nodes/parsenodes.h +++ b/src/include/nodes/parsenodes.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/parsenodes.h,v 1.274 2005/03/14 00:19:37 neilc Exp $ + * $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.275 2005/03/29 17:58:51 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -899,6 +899,11 @@ typedef struct PrivGrantee char *groupname; } PrivGrantee; +/* + * Note: FuncWithArgs carries only the types of the input parameters of the + * function. So it is sufficient to identify an existing function, but it + * is not enough info to define a function nor to call it. + */ typedef struct FuncWithArgs { NodeTag type; @@ -1389,12 +1394,20 @@ typedef struct CreateFunctionStmt List *withClause; /* a list of DefElem */ } CreateFunctionStmt; +typedef enum FunctionParameterMode +{ + /* the assigned enum values appear in pg_proc, don't change 'em! */ + FUNC_PARAM_IN = 'i', /* input only */ + FUNC_PARAM_OUT = 'o', /* output only */ + FUNC_PARAM_INOUT = 'b' /* both */ +} FunctionParameterMode; + typedef struct FunctionParameter { NodeTag type; char *name; /* parameter name, or NULL if not given */ TypeName *argType; /* TypeName for parameter type */ - /* someday add IN/OUT/INOUT indicator here */ + FunctionParameterMode mode; /* IN/OUT/INOUT */ } FunctionParameter; typedef struct AlterFunctionStmt -- cgit v1.2.3