1
0
mirror of https://github.com/postgres/postgres.git synced 2025-11-06 07:49:08 +03:00

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.
This commit is contained in:
Tom Lane
2005-03-29 17:58:51 +00:00
parent 8c85a34a3b
commit eb47ee4865
5 changed files with 81 additions and 32 deletions

View File

@@ -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