mirror of
https://github.com/postgres/postgres.git
synced 2025-04-22 23:02:54 +03:00
Get rid of last few vestiges of parsetree dependency on grammar token
codes, per discussion from last March. parse.h should now be included *only* by gram.y, scan.l, keywords.c, parser.c. This prevents surprising misbehavior after seemingly-trivial grammar adjustments.
This commit is contained in:
parent
b5956a2f22
commit
c5ba16a83c
@ -15,7 +15,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.242 2003/02/09 06:56:27 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/copyfuncs.c,v 1.243 2003/02/10 04:44:44 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -1198,7 +1198,7 @@ _copyAExpr(A_Expr *from)
|
|||||||
{
|
{
|
||||||
A_Expr *newnode = makeNode(A_Expr);
|
A_Expr *newnode = makeNode(A_Expr);
|
||||||
|
|
||||||
COPY_SCALAR_FIELD(oper);
|
COPY_SCALAR_FIELD(kind);
|
||||||
COPY_NODE_FIELD(name);
|
COPY_NODE_FIELD(name);
|
||||||
COPY_NODE_FIELD(lexpr);
|
COPY_NODE_FIELD(lexpr);
|
||||||
COPY_NODE_FIELD(rexpr);
|
COPY_NODE_FIELD(rexpr);
|
||||||
@ -1669,7 +1669,7 @@ _copyDefineStmt(DefineStmt *from)
|
|||||||
{
|
{
|
||||||
DefineStmt *newnode = makeNode(DefineStmt);
|
DefineStmt *newnode = makeNode(DefineStmt);
|
||||||
|
|
||||||
COPY_SCALAR_FIELD(defType);
|
COPY_SCALAR_FIELD(kind);
|
||||||
COPY_NODE_FIELD(defnames);
|
COPY_NODE_FIELD(defnames);
|
||||||
COPY_NODE_FIELD(definition);
|
COPY_NODE_FIELD(definition);
|
||||||
|
|
||||||
@ -1869,7 +1869,7 @@ _copyTransactionStmt(TransactionStmt *from)
|
|||||||
{
|
{
|
||||||
TransactionStmt *newnode = makeNode(TransactionStmt);
|
TransactionStmt *newnode = makeNode(TransactionStmt);
|
||||||
|
|
||||||
COPY_SCALAR_FIELD(command);
|
COPY_SCALAR_FIELD(kind);
|
||||||
COPY_NODE_FIELD(options);
|
COPY_NODE_FIELD(options);
|
||||||
|
|
||||||
return newnode;
|
return newnode;
|
||||||
@ -2215,7 +2215,7 @@ _copyReindexStmt(ReindexStmt *from)
|
|||||||
{
|
{
|
||||||
ReindexStmt *newnode = makeNode(ReindexStmt);
|
ReindexStmt *newnode = makeNode(ReindexStmt);
|
||||||
|
|
||||||
COPY_SCALAR_FIELD(reindexType);
|
COPY_SCALAR_FIELD(kind);
|
||||||
COPY_NODE_FIELD(relation);
|
COPY_NODE_FIELD(relation);
|
||||||
COPY_STRING_FIELD(name);
|
COPY_STRING_FIELD(name);
|
||||||
COPY_SCALAR_FIELD(force);
|
COPY_SCALAR_FIELD(force);
|
||||||
|
@ -18,7 +18,7 @@
|
|||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.185 2003/02/09 06:56:27 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/equalfuncs.c,v 1.186 2003/02/10 04:44:45 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -730,7 +730,7 @@ _equalCreateStmt(CreateStmt *a, CreateStmt *b)
|
|||||||
static bool
|
static bool
|
||||||
_equalDefineStmt(DefineStmt *a, DefineStmt *b)
|
_equalDefineStmt(DefineStmt *a, DefineStmt *b)
|
||||||
{
|
{
|
||||||
COMPARE_SCALAR_FIELD(defType);
|
COMPARE_SCALAR_FIELD(kind);
|
||||||
COMPARE_NODE_FIELD(defnames);
|
COMPARE_NODE_FIELD(defnames);
|
||||||
COMPARE_NODE_FIELD(definition);
|
COMPARE_NODE_FIELD(definition);
|
||||||
|
|
||||||
@ -898,7 +898,7 @@ _equalUnlistenStmt(UnlistenStmt *a, UnlistenStmt *b)
|
|||||||
static bool
|
static bool
|
||||||
_equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
|
_equalTransactionStmt(TransactionStmt *a, TransactionStmt *b)
|
||||||
{
|
{
|
||||||
COMPARE_SCALAR_FIELD(command);
|
COMPARE_SCALAR_FIELD(kind);
|
||||||
COMPARE_NODE_FIELD(options);
|
COMPARE_NODE_FIELD(options);
|
||||||
|
|
||||||
return true;
|
return true;
|
||||||
@ -1187,7 +1187,7 @@ _equalDropGroupStmt(DropGroupStmt *a, DropGroupStmt *b)
|
|||||||
static bool
|
static bool
|
||||||
_equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
|
_equalReindexStmt(ReindexStmt *a, ReindexStmt *b)
|
||||||
{
|
{
|
||||||
COMPARE_SCALAR_FIELD(reindexType);
|
COMPARE_SCALAR_FIELD(kind);
|
||||||
COMPARE_NODE_FIELD(relation);
|
COMPARE_NODE_FIELD(relation);
|
||||||
COMPARE_STRING_FIELD(name);
|
COMPARE_STRING_FIELD(name);
|
||||||
COMPARE_SCALAR_FIELD(force);
|
COMPARE_SCALAR_FIELD(force);
|
||||||
@ -1276,7 +1276,7 @@ _equalDeallocateStmt(DeallocateStmt *a, DeallocateStmt *b)
|
|||||||
static bool
|
static bool
|
||||||
_equalAExpr(A_Expr *a, A_Expr *b)
|
_equalAExpr(A_Expr *a, A_Expr *b)
|
||||||
{
|
{
|
||||||
COMPARE_SCALAR_FIELD(oper);
|
COMPARE_SCALAR_FIELD(kind);
|
||||||
COMPARE_NODE_FIELD(name);
|
COMPARE_NODE_FIELD(name);
|
||||||
COMPARE_NODE_FIELD(lexpr);
|
COMPARE_NODE_FIELD(lexpr);
|
||||||
COMPARE_NODE_FIELD(rexpr);
|
COMPARE_NODE_FIELD(rexpr);
|
||||||
|
@ -9,7 +9,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.37 2002/12/12 15:49:28 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/makefuncs.c,v 1.38 2003/02/10 04:44:45 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -24,11 +24,11 @@
|
|||||||
* makes an A_Expr node
|
* makes an A_Expr node
|
||||||
*/
|
*/
|
||||||
A_Expr *
|
A_Expr *
|
||||||
makeA_Expr(int oper, List *name, Node *lexpr, Node *rexpr)
|
makeA_Expr(A_Expr_Kind kind, List *name, Node *lexpr, Node *rexpr)
|
||||||
{
|
{
|
||||||
A_Expr *a = makeNode(A_Expr);
|
A_Expr *a = makeNode(A_Expr);
|
||||||
|
|
||||||
a->oper = oper;
|
a->kind = kind;
|
||||||
a->name = name;
|
a->name = name;
|
||||||
a->lexpr = lexpr;
|
a->lexpr = lexpr;
|
||||||
a->rexpr = rexpr;
|
a->rexpr = rexpr;
|
||||||
@ -40,12 +40,12 @@ makeA_Expr(int oper, List *name, Node *lexpr, Node *rexpr)
|
|||||||
* As above, given a simple (unqualified) operator name
|
* As above, given a simple (unqualified) operator name
|
||||||
*/
|
*/
|
||||||
A_Expr *
|
A_Expr *
|
||||||
makeSimpleA_Expr(int oper, const char *name,
|
makeSimpleA_Expr(A_Expr_Kind kind, const char *name,
|
||||||
Node *lexpr, Node *rexpr)
|
Node *lexpr, Node *rexpr)
|
||||||
{
|
{
|
||||||
A_Expr *a = makeNode(A_Expr);
|
A_Expr *a = makeNode(A_Expr);
|
||||||
|
|
||||||
a->oper = oper;
|
a->kind = kind;
|
||||||
a->name = makeList1(makeString((char *) name));
|
a->name = makeList1(makeString((char *) name));
|
||||||
a->lexpr = lexpr;
|
a->lexpr = lexpr;
|
||||||
a->rexpr = rexpr;
|
a->rexpr = rexpr;
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.198 2003/02/09 06:56:27 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/nodes/outfuncs.c,v 1.199 2003/02/10 04:44:45 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* Every node type that can appear in stored rules' parsetrees *must*
|
* Every node type that can appear in stored rules' parsetrees *must*
|
||||||
@ -27,7 +27,6 @@
|
|||||||
#include "nodes/parsenodes.h"
|
#include "nodes/parsenodes.h"
|
||||||
#include "nodes/plannodes.h"
|
#include "nodes/plannodes.h"
|
||||||
#include "nodes/relation.h"
|
#include "nodes/relation.h"
|
||||||
#include "parser/parse.h"
|
|
||||||
#include "utils/datum.h"
|
#include "utils/datum.h"
|
||||||
|
|
||||||
|
|
||||||
@ -1259,19 +1258,27 @@ _outAExpr(StringInfo str, A_Expr *node)
|
|||||||
{
|
{
|
||||||
WRITE_NODE_TYPE("AEXPR");
|
WRITE_NODE_TYPE("AEXPR");
|
||||||
|
|
||||||
switch (node->oper)
|
switch (node->kind)
|
||||||
{
|
{
|
||||||
case AND:
|
case AEXPR_OP:
|
||||||
|
appendStringInfo(str, " ");
|
||||||
|
WRITE_NODE_FIELD(name);
|
||||||
|
break;
|
||||||
|
case AEXPR_AND:
|
||||||
appendStringInfo(str, " AND");
|
appendStringInfo(str, " AND");
|
||||||
break;
|
break;
|
||||||
case OR:
|
case AEXPR_OR:
|
||||||
appendStringInfo(str, " OR");
|
appendStringInfo(str, " OR");
|
||||||
break;
|
break;
|
||||||
case NOT:
|
case AEXPR_NOT:
|
||||||
appendStringInfo(str, " NOT");
|
appendStringInfo(str, " NOT");
|
||||||
break;
|
break;
|
||||||
case OP:
|
case AEXPR_DISTINCT:
|
||||||
appendStringInfo(str, " ");
|
appendStringInfo(str, " DISTINCT ");
|
||||||
|
WRITE_NODE_FIELD(name);
|
||||||
|
break;
|
||||||
|
case AEXPR_OF:
|
||||||
|
appendStringInfo(str, " OF ");
|
||||||
WRITE_NODE_FIELD(name);
|
WRITE_NODE_FIELD(name);
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
#
|
#
|
||||||
# Makefile for parser
|
# Makefile for parser
|
||||||
#
|
#
|
||||||
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.39 2003/01/31 20:58:00 tgl Exp $
|
# $Header: /cvsroot/pgsql/src/backend/parser/Makefile,v 1.40 2003/02/10 04:44:45 tgl Exp $
|
||||||
#
|
#
|
||||||
#-------------------------------------------------------------------------
|
#-------------------------------------------------------------------------
|
||||||
|
|
||||||
@ -64,7 +64,7 @@ endif
|
|||||||
|
|
||||||
# Force these dependencies to be known even without dependency info built:
|
# Force these dependencies to be known even without dependency info built:
|
||||||
|
|
||||||
keywords.o parse_clause.o parse_expr.o parser.o gram.o: $(srcdir)/parse.h
|
gram.o keywords.o parser.o: $(srcdir)/parse.h
|
||||||
|
|
||||||
|
|
||||||
# gram.c, parse.h, and scan.c are in the distribution tarball, so they
|
# gram.c, parse.h, and scan.c are in the distribution tarball, so they
|
||||||
|
@ -11,7 +11,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.400 2003/02/09 06:56:28 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/gram.y,v 2.401 2003/02/10 04:44:45 tgl Exp $
|
||||||
*
|
*
|
||||||
* HISTORY
|
* HISTORY
|
||||||
* AUTHOR DATE MAJOR EVENT
|
* AUTHOR DATE MAJOR EVENT
|
||||||
@ -324,11 +324,11 @@ static void doNegateFloat(Value *v);
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
/* ordinary key words in alphabetical order */
|
/* ordinary key words in alphabetical order */
|
||||||
%token <keyword> ABORT_TRANS ABSOLUTE ACCESS ACTION ADD AFTER
|
%token <keyword> ABORT_P ABSOLUTE ACCESS ACTION ADD AFTER
|
||||||
AGGREGATE ALL ALTER ANALYSE ANALYZE AND ANY AS ASC
|
AGGREGATE ALL ALTER ANALYSE ANALYZE AND ANY AS ASC
|
||||||
ASSERTION ASSIGNMENT AT AUTHORIZATION
|
ASSERTION ASSIGNMENT AT AUTHORIZATION
|
||||||
|
|
||||||
BACKWARD BEFORE BEGIN_TRANS BETWEEN BIGINT BINARY BIT
|
BACKWARD BEFORE BEGIN_P BETWEEN BIGINT BINARY BIT
|
||||||
BOOLEAN BOTH BY
|
BOOLEAN BOTH BY
|
||||||
|
|
||||||
CACHE CALLED CASCADE CASE CAST CHAIN CHAR_P
|
CACHE CALLED CASCADE CASE CAST CHAIN CHAR_P
|
||||||
@ -342,13 +342,13 @@ static void doNegateFloat(Value *v);
|
|||||||
DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS
|
DEFERRABLE DEFERRED DEFINER DELETE_P DELIMITER DELIMITERS
|
||||||
DESC DISTINCT DO DOMAIN_P DOUBLE DROP
|
DESC DISTINCT DO DOMAIN_P DOUBLE DROP
|
||||||
|
|
||||||
EACH ELSE ENCODING ENCRYPTED END_TRANS ESCAPE EXCEPT
|
EACH ELSE ENCODING ENCRYPTED END_P ESCAPE EXCEPT
|
||||||
EXCLUSIVE EXECUTE EXISTS EXPLAIN EXTERNAL EXTRACT
|
EXCLUSIVE EXECUTE EXISTS EXPLAIN EXTERNAL EXTRACT
|
||||||
|
|
||||||
FALSE_P FETCH FLOAT_P FOR FORCE FOREIGN FORWARD
|
FALSE_P FETCH FLOAT_P FOR FORCE FOREIGN FORWARD
|
||||||
FREEZE FROM FULL FUNCTION
|
FREEZE FROM FULL FUNCTION
|
||||||
|
|
||||||
GET GLOBAL GRANT GROUP_P
|
GLOBAL GRANT GROUP_P
|
||||||
|
|
||||||
HANDLER HAVING HOUR_P
|
HANDLER HAVING HOUR_P
|
||||||
|
|
||||||
@ -414,9 +414,6 @@ static void doNegateFloat(Value *v);
|
|||||||
%token <str> IDENT FCONST SCONST NCONST BCONST XCONST Op
|
%token <str> IDENT FCONST SCONST NCONST BCONST XCONST Op
|
||||||
%token <ival> ICONST PARAM
|
%token <ival> ICONST PARAM
|
||||||
|
|
||||||
/* these are not real. they are here so that they get generated as #define's*/
|
|
||||||
%token OP
|
|
||||||
|
|
||||||
/* precedence: lowest to highest */
|
/* precedence: lowest to highest */
|
||||||
%left UNION EXCEPT
|
%left UNION EXCEPT
|
||||||
%left INTERSECT
|
%left INTERSECT
|
||||||
@ -2234,7 +2231,7 @@ DefineStmt:
|
|||||||
CREATE AGGREGATE func_name definition
|
CREATE AGGREGATE func_name definition
|
||||||
{
|
{
|
||||||
DefineStmt *n = makeNode(DefineStmt);
|
DefineStmt *n = makeNode(DefineStmt);
|
||||||
n->defType = AGGREGATE;
|
n->kind = DEFINE_STMT_AGGREGATE;
|
||||||
n->defnames = $3;
|
n->defnames = $3;
|
||||||
n->definition = $4;
|
n->definition = $4;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
@ -2242,7 +2239,7 @@ DefineStmt:
|
|||||||
| CREATE OPERATOR any_operator definition
|
| CREATE OPERATOR any_operator definition
|
||||||
{
|
{
|
||||||
DefineStmt *n = makeNode(DefineStmt);
|
DefineStmt *n = makeNode(DefineStmt);
|
||||||
n->defType = OPERATOR;
|
n->kind = DEFINE_STMT_OPERATOR;
|
||||||
n->defnames = $3;
|
n->defnames = $3;
|
||||||
n->definition = $4;
|
n->definition = $4;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
@ -2250,7 +2247,7 @@ DefineStmt:
|
|||||||
| CREATE TYPE_P any_name definition
|
| CREATE TYPE_P any_name definition
|
||||||
{
|
{
|
||||||
DefineStmt *n = makeNode(DefineStmt);
|
DefineStmt *n = makeNode(DefineStmt);
|
||||||
n->defType = TYPE_P;
|
n->kind = DEFINE_STMT_TYPE;
|
||||||
n->defnames = $3;
|
n->defnames = $3;
|
||||||
n->definition = $4;
|
n->definition = $4;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
@ -2288,14 +2285,6 @@ DefineStmt:
|
|||||||
n->coldeflist = $6;
|
n->coldeflist = $6;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
| CREATE CHARACTER SET opt_as any_name GET definition opt_collate
|
|
||||||
{
|
|
||||||
DefineStmt *n = makeNode(DefineStmt);
|
|
||||||
n->defType = CHARACTER;
|
|
||||||
n->defnames = $5;
|
|
||||||
n->definition = $7;
|
|
||||||
$$ = (Node *)n;
|
|
||||||
}
|
|
||||||
;
|
;
|
||||||
|
|
||||||
definition: '(' def_list ')' { $$ = $2; }
|
definition: '(' def_list ')' { $$ = $2; }
|
||||||
@ -2586,7 +2575,7 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
if ($3 < 0)
|
if ($3 < 0)
|
||||||
{
|
{
|
||||||
$3 = -$3;
|
$3 = -$3;
|
||||||
$2 = (($2 == FORWARD) ? BACKWARD : FORWARD);
|
$2 = (($2 == FETCH_FORWARD) ? FETCH_BACKWARD : FETCH_FORWARD);
|
||||||
}
|
}
|
||||||
n->direction = $2;
|
n->direction = $2;
|
||||||
n->howMany = $3;
|
n->howMany = $3;
|
||||||
@ -2600,11 +2589,11 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
if ($2 < 0)
|
if ($2 < 0)
|
||||||
{
|
{
|
||||||
n->howMany = -$2;
|
n->howMany = -$2;
|
||||||
n->direction = BACKWARD;
|
n->direction = FETCH_BACKWARD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n->direction = FORWARD;
|
n->direction = FETCH_FORWARD;
|
||||||
n->howMany = $2;
|
n->howMany = $2;
|
||||||
}
|
}
|
||||||
n->portalname = $4;
|
n->portalname = $4;
|
||||||
@ -2623,7 +2612,7 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
| FETCH from_in name
|
| FETCH from_in name
|
||||||
{
|
{
|
||||||
FetchStmt *n = makeNode(FetchStmt);
|
FetchStmt *n = makeNode(FetchStmt);
|
||||||
n->direction = FORWARD;
|
n->direction = FETCH_FORWARD;
|
||||||
n->howMany = 1;
|
n->howMany = 1;
|
||||||
n->portalname = $3;
|
n->portalname = $3;
|
||||||
n->ismove = FALSE;
|
n->ismove = FALSE;
|
||||||
@ -2632,7 +2621,7 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
| FETCH name
|
| FETCH name
|
||||||
{
|
{
|
||||||
FetchStmt *n = makeNode(FetchStmt);
|
FetchStmt *n = makeNode(FetchStmt);
|
||||||
n->direction = FORWARD;
|
n->direction = FETCH_FORWARD;
|
||||||
n->howMany = 1;
|
n->howMany = 1;
|
||||||
n->portalname = $2;
|
n->portalname = $2;
|
||||||
n->ismove = FALSE;
|
n->ismove = FALSE;
|
||||||
@ -2644,7 +2633,7 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
if ($3 < 0)
|
if ($3 < 0)
|
||||||
{
|
{
|
||||||
$3 = -$3;
|
$3 = -$3;
|
||||||
$2 = (($2 == FORWARD) ? BACKWARD : FORWARD);
|
$2 = (($2 == FETCH_FORWARD) ? FETCH_BACKWARD : FETCH_FORWARD);
|
||||||
}
|
}
|
||||||
n->direction = $2;
|
n->direction = $2;
|
||||||
n->howMany = $3;
|
n->howMany = $3;
|
||||||
@ -2658,11 +2647,11 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
if ($2 < 0)
|
if ($2 < 0)
|
||||||
{
|
{
|
||||||
n->howMany = -$2;
|
n->howMany = -$2;
|
||||||
n->direction = BACKWARD;
|
n->direction = FETCH_BACKWARD;
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
n->direction = FORWARD;
|
n->direction = FETCH_FORWARD;
|
||||||
n->howMany = $2;
|
n->howMany = $2;
|
||||||
}
|
}
|
||||||
n->portalname = $4;
|
n->portalname = $4;
|
||||||
@ -2681,7 +2670,7 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
| MOVE from_in name
|
| MOVE from_in name
|
||||||
{
|
{
|
||||||
FetchStmt *n = makeNode(FetchStmt);
|
FetchStmt *n = makeNode(FetchStmt);
|
||||||
n->direction = FORWARD;
|
n->direction = FETCH_FORWARD;
|
||||||
n->howMany = 1;
|
n->howMany = 1;
|
||||||
n->portalname = $3;
|
n->portalname = $3;
|
||||||
n->ismove = TRUE;
|
n->ismove = TRUE;
|
||||||
@ -2690,7 +2679,7 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
| MOVE name
|
| MOVE name
|
||||||
{
|
{
|
||||||
FetchStmt *n = makeNode(FetchStmt);
|
FetchStmt *n = makeNode(FetchStmt);
|
||||||
n->direction = FORWARD;
|
n->direction = FETCH_FORWARD;
|
||||||
n->howMany = 1;
|
n->howMany = 1;
|
||||||
n->portalname = $2;
|
n->portalname = $2;
|
||||||
n->ismove = TRUE;
|
n->ismove = TRUE;
|
||||||
@ -2698,14 +2687,14 @@ FetchStmt: FETCH direction fetch_how_many from_in name
|
|||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
direction: FORWARD { $$ = FORWARD; }
|
direction: FORWARD { $$ = FETCH_FORWARD; }
|
||||||
| BACKWARD { $$ = BACKWARD; }
|
| BACKWARD { $$ = FETCH_BACKWARD; }
|
||||||
| RELATIVE { $$ = FORWARD; }
|
| RELATIVE { $$ = FETCH_FORWARD; }
|
||||||
| ABSOLUTE
|
| ABSOLUTE
|
||||||
{
|
{
|
||||||
elog(NOTICE,
|
elog(NOTICE,
|
||||||
"FETCH / ABSOLUTE not supported, using RELATIVE");
|
"FETCH / ABSOLUTE not supported, using RELATIVE");
|
||||||
$$ = FORWARD;
|
$$ = FETCH_FORWARD;
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -3281,7 +3270,7 @@ ReindexStmt:
|
|||||||
REINDEX reindex_type qualified_name opt_force
|
REINDEX reindex_type qualified_name opt_force
|
||||||
{
|
{
|
||||||
ReindexStmt *n = makeNode(ReindexStmt);
|
ReindexStmt *n = makeNode(ReindexStmt);
|
||||||
n->reindexType = $2;
|
n->kind = $2;
|
||||||
n->relation = $3;
|
n->relation = $3;
|
||||||
n->name = NULL;
|
n->name = NULL;
|
||||||
n->force = $4;
|
n->force = $4;
|
||||||
@ -3290,7 +3279,7 @@ ReindexStmt:
|
|||||||
| REINDEX DATABASE name opt_force
|
| REINDEX DATABASE name opt_force
|
||||||
{
|
{
|
||||||
ReindexStmt *n = makeNode(ReindexStmt);
|
ReindexStmt *n = makeNode(ReindexStmt);
|
||||||
n->reindexType = DATABASE;
|
n->kind = REINDEX_DATABASE;
|
||||||
n->name = $3;
|
n->name = $3;
|
||||||
n->relation = NULL;
|
n->relation = NULL;
|
||||||
n->force = $4;
|
n->force = $4;
|
||||||
@ -3299,8 +3288,8 @@ ReindexStmt:
|
|||||||
;
|
;
|
||||||
|
|
||||||
reindex_type:
|
reindex_type:
|
||||||
INDEX { $$ = INDEX; }
|
INDEX { $$ = REINDEX_INDEX; }
|
||||||
| TABLE { $$ = TABLE; }
|
| TABLE { $$ = REINDEX_TABLE; }
|
||||||
;
|
;
|
||||||
|
|
||||||
opt_force: FORCE { $$ = TRUE; }
|
opt_force: FORCE { $$ = TRUE; }
|
||||||
@ -3485,45 +3474,45 @@ UnlistenStmt:
|
|||||||
*****************************************************************************/
|
*****************************************************************************/
|
||||||
|
|
||||||
TransactionStmt:
|
TransactionStmt:
|
||||||
ABORT_TRANS opt_transaction
|
ABORT_P opt_transaction
|
||||||
{
|
{
|
||||||
TransactionStmt *n = makeNode(TransactionStmt);
|
TransactionStmt *n = makeNode(TransactionStmt);
|
||||||
n->command = ROLLBACK;
|
n->kind = TRANS_STMT_ROLLBACK;
|
||||||
n->options = NIL;
|
n->options = NIL;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
| BEGIN_TRANS opt_transaction
|
| BEGIN_P opt_transaction
|
||||||
{
|
{
|
||||||
TransactionStmt *n = makeNode(TransactionStmt);
|
TransactionStmt *n = makeNode(TransactionStmt);
|
||||||
n->command = BEGIN_TRANS;
|
n->kind = TRANS_STMT_BEGIN;
|
||||||
n->options = NIL;
|
n->options = NIL;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
| START TRANSACTION transaction_mode_list_or_empty
|
| START TRANSACTION transaction_mode_list_or_empty
|
||||||
{
|
{
|
||||||
TransactionStmt *n = makeNode(TransactionStmt);
|
TransactionStmt *n = makeNode(TransactionStmt);
|
||||||
n->command = START;
|
n->kind = TRANS_STMT_START;
|
||||||
n->options = $3;
|
n->options = $3;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
| COMMIT opt_transaction
|
| COMMIT opt_transaction
|
||||||
{
|
{
|
||||||
TransactionStmt *n = makeNode(TransactionStmt);
|
TransactionStmt *n = makeNode(TransactionStmt);
|
||||||
n->command = COMMIT;
|
n->kind = TRANS_STMT_COMMIT;
|
||||||
n->options = NIL;
|
n->options = NIL;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
| END_TRANS opt_transaction
|
| END_P opt_transaction
|
||||||
{
|
{
|
||||||
TransactionStmt *n = makeNode(TransactionStmt);
|
TransactionStmt *n = makeNode(TransactionStmt);
|
||||||
n->command = COMMIT;
|
n->kind = TRANS_STMT_COMMIT;
|
||||||
n->options = NIL;
|
n->options = NIL;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
| ROLLBACK opt_transaction
|
| ROLLBACK opt_transaction
|
||||||
{
|
{
|
||||||
TransactionStmt *n = makeNode(TransactionStmt);
|
TransactionStmt *n = makeNode(TransactionStmt);
|
||||||
n->command = ROLLBACK;
|
n->kind = TRANS_STMT_ROLLBACK;
|
||||||
n->options = NIL;
|
n->options = NIL;
|
||||||
$$ = (Node *)n;
|
$$ = (Node *)n;
|
||||||
}
|
}
|
||||||
@ -5467,7 +5456,7 @@ r_expr: row IN_P select_with_parens
|
|||||||
n->operName = makeList1(makeString("="));
|
n->operName = makeList1(makeString("="));
|
||||||
n->subselect = $4;
|
n->subselect = $4;
|
||||||
/* Stick a NOT on top */
|
/* Stick a NOT on top */
|
||||||
$$ = (Node *) makeA_Expr(NOT, NIL, NULL, (Node *) n);
|
$$ = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, (Node *) n);
|
||||||
}
|
}
|
||||||
| row qual_all_Op sub_type select_with_parens
|
| row qual_all_Op sub_type select_with_parens
|
||||||
%prec Op
|
%prec Op
|
||||||
@ -5629,52 +5618,52 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
* also to b_expr and to the MathOp list above.
|
* also to b_expr and to the MathOp list above.
|
||||||
*/
|
*/
|
||||||
| '+' a_expr %prec UMINUS
|
| '+' a_expr %prec UMINUS
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "+", NULL, $2); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2); }
|
||||||
| '-' a_expr %prec UMINUS
|
| '-' a_expr %prec UMINUS
|
||||||
{ $$ = doNegate($2); }
|
{ $$ = doNegate($2); }
|
||||||
| '%' a_expr
|
| '%' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "%", NULL, $2); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", NULL, $2); }
|
||||||
| '^' a_expr
|
| '^' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "^", NULL, $2); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", NULL, $2); }
|
||||||
| a_expr '%'
|
| a_expr '%'
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "%", $1, NULL); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", $1, NULL); }
|
||||||
| a_expr '^'
|
| a_expr '^'
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "^", $1, NULL); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", $1, NULL); }
|
||||||
| a_expr '+' a_expr
|
| a_expr '+' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "+", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", $1, $3); }
|
||||||
| a_expr '-' a_expr
|
| a_expr '-' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "-", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", $1, $3); }
|
||||||
| a_expr '*' a_expr
|
| a_expr '*' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "*", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", $1, $3); }
|
||||||
| a_expr '/' a_expr
|
| a_expr '/' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "/", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", $1, $3); }
|
||||||
| a_expr '%' a_expr
|
| a_expr '%' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "%", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", $1, $3); }
|
||||||
| a_expr '^' a_expr
|
| a_expr '^' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "^", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", $1, $3); }
|
||||||
| a_expr '<' a_expr
|
| a_expr '<' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "<", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", $1, $3); }
|
||||||
| a_expr '>' a_expr
|
| a_expr '>' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, ">", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", $1, $3); }
|
||||||
| a_expr '=' a_expr
|
| a_expr '=' a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "=", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", $1, $3); }
|
||||||
|
|
||||||
| a_expr qual_Op a_expr %prec Op
|
| a_expr qual_Op a_expr %prec Op
|
||||||
{ $$ = (Node *) makeA_Expr(OP, $2, $1, $3); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_OP, $2, $1, $3); }
|
||||||
| qual_Op a_expr %prec Op
|
| qual_Op a_expr %prec Op
|
||||||
{ $$ = (Node *) makeA_Expr(OP, $1, NULL, $2); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_OP, $1, NULL, $2); }
|
||||||
| a_expr qual_Op %prec POSTFIXOP
|
| a_expr qual_Op %prec POSTFIXOP
|
||||||
{ $$ = (Node *) makeA_Expr(OP, $2, $1, NULL); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_OP, $2, $1, NULL); }
|
||||||
|
|
||||||
| a_expr AND a_expr
|
| a_expr AND a_expr
|
||||||
{ $$ = (Node *) makeA_Expr(AND, NIL, $1, $3); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_AND, NIL, $1, $3); }
|
||||||
| a_expr OR a_expr
|
| a_expr OR a_expr
|
||||||
{ $$ = (Node *) makeA_Expr(OR, NIL, $1, $3); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_OR, NIL, $1, $3); }
|
||||||
| NOT a_expr
|
| NOT a_expr
|
||||||
{ $$ = (Node *) makeA_Expr(NOT, NIL, NULL, $2); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, $2); }
|
||||||
|
|
||||||
| a_expr LIKE a_expr
|
| a_expr LIKE a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "~~", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~", $1, $3); }
|
||||||
| a_expr LIKE a_expr ESCAPE a_expr
|
| a_expr LIKE a_expr ESCAPE a_expr
|
||||||
{
|
{
|
||||||
FuncCall *n = makeNode(FuncCall);
|
FuncCall *n = makeNode(FuncCall);
|
||||||
@ -5682,10 +5671,10 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($3, $5);
|
n->args = makeList2($3, $5);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "~~", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
| a_expr NOT LIKE a_expr
|
| a_expr NOT LIKE a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "!~~", $1, $4); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~", $1, $4); }
|
||||||
| a_expr NOT LIKE a_expr ESCAPE a_expr
|
| a_expr NOT LIKE a_expr ESCAPE a_expr
|
||||||
{
|
{
|
||||||
FuncCall *n = makeNode(FuncCall);
|
FuncCall *n = makeNode(FuncCall);
|
||||||
@ -5693,10 +5682,10 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($4, $6);
|
n->args = makeList2($4, $6);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "!~~", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
| a_expr ILIKE a_expr
|
| a_expr ILIKE a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "~~*", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~*", $1, $3); }
|
||||||
| a_expr ILIKE a_expr ESCAPE a_expr
|
| a_expr ILIKE a_expr ESCAPE a_expr
|
||||||
{
|
{
|
||||||
FuncCall *n = makeNode(FuncCall);
|
FuncCall *n = makeNode(FuncCall);
|
||||||
@ -5704,10 +5693,10 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($3, $5);
|
n->args = makeList2($3, $5);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "~~*", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~~*", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
| a_expr NOT ILIKE a_expr
|
| a_expr NOT ILIKE a_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "!~~*", $1, $4); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~*", $1, $4); }
|
||||||
| a_expr NOT ILIKE a_expr ESCAPE a_expr
|
| a_expr NOT ILIKE a_expr ESCAPE a_expr
|
||||||
{
|
{
|
||||||
FuncCall *n = makeNode(FuncCall);
|
FuncCall *n = makeNode(FuncCall);
|
||||||
@ -5715,7 +5704,7 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($4, $6);
|
n->args = makeList2($4, $6);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "!~~*", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~~*", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
|
|
||||||
| a_expr SIMILAR TO a_expr %prec SIMILAR
|
| a_expr SIMILAR TO a_expr %prec SIMILAR
|
||||||
@ -5727,7 +5716,7 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($4, (Node *) c);
|
n->args = makeList2($4, (Node *) c);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "~", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
| a_expr SIMILAR TO a_expr ESCAPE a_expr
|
| a_expr SIMILAR TO a_expr ESCAPE a_expr
|
||||||
{
|
{
|
||||||
@ -5736,7 +5725,7 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($4, $6);
|
n->args = makeList2($4, $6);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "~", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "~", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
| a_expr NOT SIMILAR TO a_expr %prec SIMILAR
|
| a_expr NOT SIMILAR TO a_expr %prec SIMILAR
|
||||||
{
|
{
|
||||||
@ -5747,7 +5736,7 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($5, (Node *) c);
|
n->args = makeList2($5, (Node *) c);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "!~", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
| a_expr NOT SIMILAR TO a_expr ESCAPE a_expr
|
| a_expr NOT SIMILAR TO a_expr ESCAPE a_expr
|
||||||
{
|
{
|
||||||
@ -5756,7 +5745,7 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->args = makeList2($5, $7);
|
n->args = makeList2($5, $7);
|
||||||
n->agg_star = FALSE;
|
n->agg_star = FALSE;
|
||||||
n->agg_distinct = FALSE;
|
n->agg_distinct = FALSE;
|
||||||
$$ = (Node *) makeSimpleA_Expr(OP, "!~", $1, (Node *) n);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "!~", $1, (Node *) n);
|
||||||
}
|
}
|
||||||
|
|
||||||
/* NullTest clause
|
/* NullTest clause
|
||||||
@ -5839,26 +5828,26 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
$$ = (Node *)b;
|
$$ = (Node *)b;
|
||||||
}
|
}
|
||||||
| a_expr IS DISTINCT FROM a_expr %prec IS
|
| a_expr IS DISTINCT FROM a_expr %prec IS
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(DISTINCT, "=", $1, $5); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", $1, $5); }
|
||||||
| a_expr IS OF '(' type_list ')' %prec IS
|
| a_expr IS OF '(' type_list ')' %prec IS
|
||||||
{
|
{
|
||||||
$$ = (Node *) makeSimpleA_Expr(OF, "=", $1, (Node *) $5);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", $1, (Node *) $5);
|
||||||
}
|
}
|
||||||
| a_expr IS NOT OF '(' type_list ')' %prec IS
|
| a_expr IS NOT OF '(' type_list ')' %prec IS
|
||||||
{
|
{
|
||||||
$$ = (Node *) makeSimpleA_Expr(OF, "!=", $1, (Node *) $6);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OF, "!=", $1, (Node *) $6);
|
||||||
}
|
}
|
||||||
| a_expr BETWEEN b_expr AND b_expr %prec BETWEEN
|
| a_expr BETWEEN b_expr AND b_expr %prec BETWEEN
|
||||||
{
|
{
|
||||||
$$ = (Node *) makeA_Expr(AND, NIL,
|
$$ = (Node *) makeA_Expr(AEXPR_AND, NIL,
|
||||||
(Node *) makeSimpleA_Expr(OP, ">=", $1, $3),
|
(Node *) makeSimpleA_Expr(AEXPR_OP, ">=", $1, $3),
|
||||||
(Node *) makeSimpleA_Expr(OP, "<=", $1, $5));
|
(Node *) makeSimpleA_Expr(AEXPR_OP, "<=", $1, $5));
|
||||||
}
|
}
|
||||||
| a_expr NOT BETWEEN b_expr AND b_expr %prec BETWEEN
|
| a_expr NOT BETWEEN b_expr AND b_expr %prec BETWEEN
|
||||||
{
|
{
|
||||||
$$ = (Node *) makeA_Expr(OR, NIL,
|
$$ = (Node *) makeA_Expr(AEXPR_OR, NIL,
|
||||||
(Node *) makeSimpleA_Expr(OP, "<", $1, $4),
|
(Node *) makeSimpleA_Expr(AEXPR_OP, "<", $1, $4),
|
||||||
(Node *) makeSimpleA_Expr(OP, ">", $1, $6));
|
(Node *) makeSimpleA_Expr(AEXPR_OP, ">", $1, $6));
|
||||||
}
|
}
|
||||||
| a_expr IN_P in_expr
|
| a_expr IN_P in_expr
|
||||||
{
|
{
|
||||||
@ -5878,11 +5867,11 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
foreach(l, (List *) $3)
|
foreach(l, (List *) $3)
|
||||||
{
|
{
|
||||||
Node *cmp;
|
Node *cmp;
|
||||||
cmp = (Node *) makeSimpleA_Expr(OP, "=", $1, lfirst(l));
|
cmp = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", $1, lfirst(l));
|
||||||
if (n == NULL)
|
if (n == NULL)
|
||||||
n = cmp;
|
n = cmp;
|
||||||
else
|
else
|
||||||
n = (Node *) makeA_Expr(OR, NIL, n, cmp);
|
n = (Node *) makeA_Expr(AEXPR_OR, NIL, n, cmp);
|
||||||
}
|
}
|
||||||
$$ = n;
|
$$ = n;
|
||||||
}
|
}
|
||||||
@ -5898,7 +5887,7 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
n->lefthand = makeList1($1);
|
n->lefthand = makeList1($1);
|
||||||
n->operName = makeList1(makeString("="));
|
n->operName = makeList1(makeString("="));
|
||||||
/* Stick a NOT on top */
|
/* Stick a NOT on top */
|
||||||
$$ = (Node *) makeA_Expr(NOT, NIL, NULL, (Node *) n);
|
$$ = (Node *) makeA_Expr(AEXPR_NOT, NIL, NULL, (Node *) n);
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
{
|
{
|
||||||
@ -5907,11 +5896,11 @@ a_expr: c_expr { $$ = $1; }
|
|||||||
foreach(l, (List *) $4)
|
foreach(l, (List *) $4)
|
||||||
{
|
{
|
||||||
Node *cmp;
|
Node *cmp;
|
||||||
cmp = (Node *) makeSimpleA_Expr(OP, "<>", $1, lfirst(l));
|
cmp = (Node *) makeSimpleA_Expr(AEXPR_OP, "<>", $1, lfirst(l));
|
||||||
if (n == NULL)
|
if (n == NULL)
|
||||||
n = cmp;
|
n = cmp;
|
||||||
else
|
else
|
||||||
n = (Node *) makeA_Expr(AND, NIL, n, cmp);
|
n = (Node *) makeA_Expr(AEXPR_AND, NIL, n, cmp);
|
||||||
}
|
}
|
||||||
$$ = n;
|
$$ = n;
|
||||||
}
|
}
|
||||||
@ -5956,50 +5945,50 @@ b_expr: c_expr
|
|||||||
| b_expr TYPECAST Typename
|
| b_expr TYPECAST Typename
|
||||||
{ $$ = makeTypeCast($1, $3); }
|
{ $$ = makeTypeCast($1, $3); }
|
||||||
| '+' b_expr %prec UMINUS
|
| '+' b_expr %prec UMINUS
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "+", NULL, $2); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", NULL, $2); }
|
||||||
| '-' b_expr %prec UMINUS
|
| '-' b_expr %prec UMINUS
|
||||||
{ $$ = doNegate($2); }
|
{ $$ = doNegate($2); }
|
||||||
| '%' b_expr
|
| '%' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "%", NULL, $2); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", NULL, $2); }
|
||||||
| '^' b_expr
|
| '^' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "^", NULL, $2); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", NULL, $2); }
|
||||||
| b_expr '%'
|
| b_expr '%'
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "%", $1, NULL); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", $1, NULL); }
|
||||||
| b_expr '^'
|
| b_expr '^'
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "^", $1, NULL); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", $1, NULL); }
|
||||||
| b_expr '+' b_expr
|
| b_expr '+' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "+", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "+", $1, $3); }
|
||||||
| b_expr '-' b_expr
|
| b_expr '-' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "-", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "-", $1, $3); }
|
||||||
| b_expr '*' b_expr
|
| b_expr '*' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "*", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "*", $1, $3); }
|
||||||
| b_expr '/' b_expr
|
| b_expr '/' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "/", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "/", $1, $3); }
|
||||||
| b_expr '%' b_expr
|
| b_expr '%' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "%", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "%", $1, $3); }
|
||||||
| b_expr '^' b_expr
|
| b_expr '^' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "^", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "^", $1, $3); }
|
||||||
| b_expr '<' b_expr
|
| b_expr '<' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "<", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "<", $1, $3); }
|
||||||
| b_expr '>' b_expr
|
| b_expr '>' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, ">", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, ">", $1, $3); }
|
||||||
| b_expr '=' b_expr
|
| b_expr '=' b_expr
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(OP, "=", $1, $3); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_OP, "=", $1, $3); }
|
||||||
| b_expr qual_Op b_expr %prec Op
|
| b_expr qual_Op b_expr %prec Op
|
||||||
{ $$ = (Node *) makeA_Expr(OP, $2, $1, $3); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_OP, $2, $1, $3); }
|
||||||
| qual_Op b_expr %prec Op
|
| qual_Op b_expr %prec Op
|
||||||
{ $$ = (Node *) makeA_Expr(OP, $1, NULL, $2); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_OP, $1, NULL, $2); }
|
||||||
| b_expr qual_Op %prec POSTFIXOP
|
| b_expr qual_Op %prec POSTFIXOP
|
||||||
{ $$ = (Node *) makeA_Expr(OP, $2, $1, NULL); }
|
{ $$ = (Node *) makeA_Expr(AEXPR_OP, $2, $1, NULL); }
|
||||||
| b_expr IS DISTINCT FROM b_expr %prec IS
|
| b_expr IS DISTINCT FROM b_expr %prec IS
|
||||||
{ $$ = (Node *) makeSimpleA_Expr(DISTINCT, "=", $1, $5); }
|
{ $$ = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", $1, $5); }
|
||||||
| b_expr IS OF '(' type_list ')' %prec IS
|
| b_expr IS OF '(' type_list ')' %prec IS
|
||||||
{
|
{
|
||||||
$$ = (Node *) makeSimpleA_Expr(OF, "=", $1, (Node *) $5);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OF, "=", $1, (Node *) $5);
|
||||||
}
|
}
|
||||||
| b_expr IS NOT OF '(' type_list ')' %prec IS
|
| b_expr IS NOT OF '(' type_list ')' %prec IS
|
||||||
{
|
{
|
||||||
$$ = (Node *) makeSimpleA_Expr(OF, "!=", $1, (Node *) $6);
|
$$ = (Node *) makeSimpleA_Expr(AEXPR_OF, "!=", $1, (Node *) $6);
|
||||||
}
|
}
|
||||||
;
|
;
|
||||||
|
|
||||||
@ -6646,7 +6635,7 @@ in_expr: select_with_parens
|
|||||||
* same as CASE WHEN a IS NOT NULL THEN a WHEN b IS NOT NULL THEN b ... END
|
* same as CASE WHEN a IS NOT NULL THEN a WHEN b IS NOT NULL THEN b ... END
|
||||||
* - thomas 1998-11-09
|
* - thomas 1998-11-09
|
||||||
*/
|
*/
|
||||||
case_expr: CASE case_arg when_clause_list case_default END_TRANS
|
case_expr: CASE case_arg when_clause_list case_default END_P
|
||||||
{
|
{
|
||||||
CaseExpr *c = makeNode(CaseExpr);
|
CaseExpr *c = makeNode(CaseExpr);
|
||||||
c->arg = (Expr *) $2;
|
c->arg = (Expr *) $2;
|
||||||
@ -6659,7 +6648,7 @@ case_expr: CASE case_arg when_clause_list case_default END_TRANS
|
|||||||
CaseExpr *c = makeNode(CaseExpr);
|
CaseExpr *c = makeNode(CaseExpr);
|
||||||
CaseWhen *w = makeNode(CaseWhen);
|
CaseWhen *w = makeNode(CaseWhen);
|
||||||
|
|
||||||
w->expr = (Expr *) makeSimpleA_Expr(OP, "=", $3, $5);
|
w->expr = (Expr *) makeSimpleA_Expr(AEXPR_OP, "=", $3, $5);
|
||||||
/* w->result is left NULL */
|
/* w->result is left NULL */
|
||||||
c->args = makeList1(w);
|
c->args = makeList1(w);
|
||||||
c->defresult = (Expr *) $3;
|
c->defresult = (Expr *) $3;
|
||||||
@ -7055,7 +7044,7 @@ ColLabel: IDENT { $$ = $1; }
|
|||||||
/* "Unreserved" keywords --- available for use as any kind of name.
|
/* "Unreserved" keywords --- available for use as any kind of name.
|
||||||
*/
|
*/
|
||||||
unreserved_keyword:
|
unreserved_keyword:
|
||||||
ABORT_TRANS
|
ABORT_P
|
||||||
| ABSOLUTE
|
| ABSOLUTE
|
||||||
| ACCESS
|
| ACCESS
|
||||||
| ACTION
|
| ACTION
|
||||||
@ -7068,7 +7057,7 @@ unreserved_keyword:
|
|||||||
| AT
|
| AT
|
||||||
| BACKWARD
|
| BACKWARD
|
||||||
| BEFORE
|
| BEFORE
|
||||||
| BEGIN_TRANS
|
| BEGIN_P
|
||||||
| BY
|
| BY
|
||||||
| CACHE
|
| CACHE
|
||||||
| CALLED
|
| CALLED
|
||||||
@ -7113,7 +7102,6 @@ unreserved_keyword:
|
|||||||
| FORCE
|
| FORCE
|
||||||
| FORWARD
|
| FORWARD
|
||||||
| FUNCTION
|
| FUNCTION
|
||||||
| GET
|
|
||||||
| GLOBAL
|
| GLOBAL
|
||||||
| HANDLER
|
| HANDLER
|
||||||
| HOUR_P
|
| HOUR_P
|
||||||
@ -7345,7 +7333,7 @@ reserved_keyword:
|
|||||||
| DISTINCT
|
| DISTINCT
|
||||||
| DO
|
| DO
|
||||||
| ELSE
|
| ELSE
|
||||||
| END_TRANS
|
| END_P
|
||||||
| EXCEPT
|
| EXCEPT
|
||||||
| FALSE_P
|
| FALSE_P
|
||||||
| FOR
|
| FOR
|
||||||
@ -7541,19 +7529,19 @@ makeRowExpr(List *opr, List *largs, List *rargs)
|
|||||||
(strcmp(oprname, ">=") == 0))
|
(strcmp(oprname, ">=") == 0))
|
||||||
{
|
{
|
||||||
if (expr == NULL)
|
if (expr == NULL)
|
||||||
expr = (Node *) makeA_Expr(OP, opr, larg, rarg);
|
expr = (Node *) makeA_Expr(AEXPR_OP, opr, larg, rarg);
|
||||||
else
|
else
|
||||||
expr = (Node *) makeA_Expr(AND, NIL, expr,
|
expr = (Node *) makeA_Expr(AEXPR_AND, NIL, expr,
|
||||||
(Node *) makeA_Expr(OP, opr,
|
(Node *) makeA_Expr(AEXPR_OP, opr,
|
||||||
larg, rarg));
|
larg, rarg));
|
||||||
}
|
}
|
||||||
else if (strcmp(oprname, "<>") == 0)
|
else if (strcmp(oprname, "<>") == 0)
|
||||||
{
|
{
|
||||||
if (expr == NULL)
|
if (expr == NULL)
|
||||||
expr = (Node *) makeA_Expr(OP, opr, larg, rarg);
|
expr = (Node *) makeA_Expr(AEXPR_OP, opr, larg, rarg);
|
||||||
else
|
else
|
||||||
expr = (Node *) makeA_Expr(OR, NIL, expr,
|
expr = (Node *) makeA_Expr(AEXPR_OR, NIL, expr,
|
||||||
(Node *) makeA_Expr(OP, opr,
|
(Node *) makeA_Expr(AEXPR_OP, opr,
|
||||||
larg, rarg));
|
larg, rarg));
|
||||||
}
|
}
|
||||||
else
|
else
|
||||||
@ -7585,10 +7573,10 @@ makeDistinctExpr(List *largs, List *rargs)
|
|||||||
rarg = lfirst(rargs);
|
rarg = lfirst(rargs);
|
||||||
|
|
||||||
if (expr == NULL)
|
if (expr == NULL)
|
||||||
expr = (Node *) makeSimpleA_Expr(DISTINCT, "=", larg, rarg);
|
expr = (Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=", larg, rarg);
|
||||||
else
|
else
|
||||||
expr = (Node *) makeA_Expr(OR, NIL, expr,
|
expr = (Node *) makeA_Expr(AEXPR_OR, NIL, expr,
|
||||||
(Node *) makeSimpleA_Expr(DISTINCT, "=",
|
(Node *) makeSimpleA_Expr(AEXPR_DISTINCT, "=",
|
||||||
larg, rarg));
|
larg, rarg));
|
||||||
|
|
||||||
return expr;
|
return expr;
|
||||||
@ -7613,9 +7601,9 @@ makeRowNullTest(NullTestType test, List *args)
|
|||||||
if (expr == NULL)
|
if (expr == NULL)
|
||||||
expr = (Node *) n;
|
expr = (Node *) n;
|
||||||
else if (test == IS_NOT_NULL)
|
else if (test == IS_NOT_NULL)
|
||||||
expr = (Node *) makeA_Expr(OR, NIL, expr, (Node *)n);
|
expr = (Node *) makeA_Expr(AEXPR_OR, NIL, expr, (Node *)n);
|
||||||
else
|
else
|
||||||
expr = (Node *) makeA_Expr(AND, NIL, expr, (Node *)n);
|
expr = (Node *) makeA_Expr(AEXPR_AND, NIL, expr, (Node *)n);
|
||||||
|
|
||||||
return expr;
|
return expr;
|
||||||
}
|
}
|
||||||
@ -7790,7 +7778,7 @@ doNegate(Node *n)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
return (Node *) makeSimpleA_Expr(OP, "-", NULL, n);
|
return (Node *) makeSimpleA_Expr(AEXPR_OP, "-", NULL, n);
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.133 2003/02/03 14:04:24 momjian Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/keywords.c,v 1.134 2003/02/10 04:44:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -30,7 +30,7 @@
|
|||||||
*/
|
*/
|
||||||
static const ScanKeyword ScanKeywords[] = {
|
static const ScanKeyword ScanKeywords[] = {
|
||||||
/* name, value */
|
/* name, value */
|
||||||
{"abort", ABORT_TRANS},
|
{"abort", ABORT_P},
|
||||||
{"absolute", ABSOLUTE},
|
{"absolute", ABSOLUTE},
|
||||||
{"access", ACCESS},
|
{"access", ACCESS},
|
||||||
{"action", ACTION},
|
{"action", ACTION},
|
||||||
@ -51,7 +51,7 @@ static const ScanKeyword ScanKeywords[] = {
|
|||||||
{"authorization", AUTHORIZATION},
|
{"authorization", AUTHORIZATION},
|
||||||
{"backward", BACKWARD},
|
{"backward", BACKWARD},
|
||||||
{"before", BEFORE},
|
{"before", BEFORE},
|
||||||
{"begin", BEGIN_TRANS},
|
{"begin", BEGIN_P},
|
||||||
{"between", BETWEEN},
|
{"between", BETWEEN},
|
||||||
{"bigint", BIGINT},
|
{"bigint", BIGINT},
|
||||||
{"binary", BINARY},
|
{"binary", BINARY},
|
||||||
@ -117,7 +117,7 @@ static const ScanKeyword ScanKeywords[] = {
|
|||||||
{"else", ELSE},
|
{"else", ELSE},
|
||||||
{"encoding", ENCODING},
|
{"encoding", ENCODING},
|
||||||
{"encrypted", ENCRYPTED},
|
{"encrypted", ENCRYPTED},
|
||||||
{"end", END_TRANS},
|
{"end", END_P},
|
||||||
{"escape", ESCAPE},
|
{"escape", ESCAPE},
|
||||||
{"except", EXCEPT},
|
{"except", EXCEPT},
|
||||||
{"exclusive", EXCLUSIVE},
|
{"exclusive", EXCLUSIVE},
|
||||||
@ -137,7 +137,6 @@ static const ScanKeyword ScanKeywords[] = {
|
|||||||
{"from", FROM},
|
{"from", FROM},
|
||||||
{"full", FULL},
|
{"full", FULL},
|
||||||
{"function", FUNCTION},
|
{"function", FUNCTION},
|
||||||
{"get", GET},
|
|
||||||
{"global", GLOBAL},
|
{"global", GLOBAL},
|
||||||
{"grant", GRANT},
|
{"grant", GRANT},
|
||||||
{"group", GROUP_P},
|
{"group", GROUP_P},
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.105 2003/02/09 06:56:28 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_clause.c,v 1.106 2003/02/10 04:44:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -22,7 +22,6 @@
|
|||||||
#include "optimizer/tlist.h"
|
#include "optimizer/tlist.h"
|
||||||
#include "optimizer/var.h"
|
#include "optimizer/var.h"
|
||||||
#include "parser/analyze.h"
|
#include "parser/analyze.h"
|
||||||
#include "parser/parse.h"
|
|
||||||
#include "parser/parsetree.h"
|
#include "parser/parsetree.h"
|
||||||
#include "parser/parse_clause.h"
|
#include "parser/parse_clause.h"
|
||||||
#include "parser/parse_coerce.h"
|
#include "parser/parse_coerce.h"
|
||||||
@ -263,7 +262,7 @@ transformJoinUsingClause(ParseState *pstate, List *leftVars, List *rightVars)
|
|||||||
Node *rvar = (Node *) lfirst(rvars);
|
Node *rvar = (Node *) lfirst(rvars);
|
||||||
A_Expr *e;
|
A_Expr *e;
|
||||||
|
|
||||||
e = makeSimpleA_Expr(OP, "=", copyObject(lvar), copyObject(rvar));
|
e = makeSimpleA_Expr(AEXPR_OP, "=", copyObject(lvar), copyObject(rvar));
|
||||||
|
|
||||||
if (result == NULL)
|
if (result == NULL)
|
||||||
result = (Node *) e;
|
result = (Node *) e;
|
||||||
@ -271,7 +270,7 @@ transformJoinUsingClause(ParseState *pstate, List *leftVars, List *rightVars)
|
|||||||
{
|
{
|
||||||
A_Expr *a;
|
A_Expr *a;
|
||||||
|
|
||||||
a = makeA_Expr(AND, NIL, result, (Node *) e);
|
a = makeA_Expr(AEXPR_AND, NIL, result, (Node *) e);
|
||||||
result = (Node *) a;
|
result = (Node *) a;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.143 2003/02/09 06:56:28 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/parser/parse_expr.c,v 1.144 2003/02/10 04:44:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -23,7 +23,6 @@
|
|||||||
#include "nodes/plannodes.h"
|
#include "nodes/plannodes.h"
|
||||||
#include "parser/analyze.h"
|
#include "parser/analyze.h"
|
||||||
#include "parser/gramparse.h"
|
#include "parser/gramparse.h"
|
||||||
#include "parser/parse.h"
|
|
||||||
#include "parser/parse_coerce.h"
|
#include "parser/parse_coerce.h"
|
||||||
#include "parser/parse_expr.h"
|
#include "parser/parse_expr.h"
|
||||||
#include "parser/parse_func.h"
|
#include "parser/parse_func.h"
|
||||||
@ -178,9 +177,9 @@ transformExpr(ParseState *pstate, Node *expr)
|
|||||||
{
|
{
|
||||||
A_Expr *a = (A_Expr *) expr;
|
A_Expr *a = (A_Expr *) expr;
|
||||||
|
|
||||||
switch (a->oper)
|
switch (a->kind)
|
||||||
{
|
{
|
||||||
case OP:
|
case AEXPR_OP:
|
||||||
{
|
{
|
||||||
/*
|
/*
|
||||||
* Special-case "foo = NULL" and "NULL = foo"
|
* Special-case "foo = NULL" and "NULL = foo"
|
||||||
@ -219,7 +218,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case AND:
|
case AEXPR_AND:
|
||||||
{
|
{
|
||||||
Node *lexpr = transformExpr(pstate,
|
Node *lexpr = transformExpr(pstate,
|
||||||
a->lexpr);
|
a->lexpr);
|
||||||
@ -234,7 +233,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
|||||||
rexpr));
|
rexpr));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OR:
|
case AEXPR_OR:
|
||||||
{
|
{
|
||||||
Node *lexpr = transformExpr(pstate,
|
Node *lexpr = transformExpr(pstate,
|
||||||
a->lexpr);
|
a->lexpr);
|
||||||
@ -249,7 +248,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
|||||||
rexpr));
|
rexpr));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case NOT:
|
case AEXPR_NOT:
|
||||||
{
|
{
|
||||||
Node *rexpr = transformExpr(pstate,
|
Node *rexpr = transformExpr(pstate,
|
||||||
a->rexpr);
|
a->rexpr);
|
||||||
@ -260,7 +259,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
|||||||
makeList1(rexpr));
|
makeList1(rexpr));
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case DISTINCT:
|
case AEXPR_DISTINCT:
|
||||||
{
|
{
|
||||||
Node *lexpr = transformExpr(pstate,
|
Node *lexpr = transformExpr(pstate,
|
||||||
a->lexpr);
|
a->lexpr);
|
||||||
@ -278,18 +277,17 @@ transformExpr(ParseState *pstate, Node *expr)
|
|||||||
NodeSetTag(result, T_DistinctExpr);
|
NodeSetTag(result, T_DistinctExpr);
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
case OF:
|
case AEXPR_OF:
|
||||||
{
|
{
|
||||||
|
/*
|
||||||
|
* Checking an expression for match to type.
|
||||||
|
* Will result in a boolean constant node.
|
||||||
|
*/
|
||||||
List *telem;
|
List *telem;
|
||||||
A_Const *n;
|
A_Const *n;
|
||||||
Oid ltype,
|
Oid ltype,
|
||||||
rtype;
|
rtype;
|
||||||
bool matched = FALSE;
|
bool matched = FALSE;
|
||||||
|
|
||||||
/*
|
|
||||||
* Checking an expression for match to type.
|
|
||||||
* Will result in a boolean constant node.
|
|
||||||
*/
|
|
||||||
Node *lexpr = transformExpr(pstate,
|
Node *lexpr = transformExpr(pstate,
|
||||||
a->lexpr);
|
a->lexpr);
|
||||||
|
|
||||||
@ -530,7 +528,7 @@ transformExpr(ParseState *pstate, Node *expr)
|
|||||||
if (c->arg != NULL)
|
if (c->arg != NULL)
|
||||||
{
|
{
|
||||||
/* shorthand form was specified, so expand... */
|
/* shorthand form was specified, so expand... */
|
||||||
warg = (Node *) makeSimpleA_Expr(OP, "=",
|
warg = (Node *) makeSimpleA_Expr(AEXPR_OP, "=",
|
||||||
(Node *) c->arg,
|
(Node *) c->arg,
|
||||||
warg);
|
warg);
|
||||||
}
|
}
|
||||||
|
@ -8,7 +8,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.314 2003/01/01 21:57:05 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/postgres.c,v 1.315 2003/02/10 04:44:46 tgl Exp $
|
||||||
*
|
*
|
||||||
* NOTES
|
* NOTES
|
||||||
* this is the "main" module of the postgres backend and
|
* this is the "main" module of the postgres backend and
|
||||||
@ -44,7 +44,6 @@
|
|||||||
#include "optimizer/cost.h"
|
#include "optimizer/cost.h"
|
||||||
#include "optimizer/planner.h"
|
#include "optimizer/planner.h"
|
||||||
#include "parser/analyze.h"
|
#include "parser/analyze.h"
|
||||||
#include "parser/parse.h"
|
|
||||||
#include "parser/parser.h"
|
#include "parser/parser.h"
|
||||||
#include "rewrite/rewriteHandler.h"
|
#include "rewrite/rewriteHandler.h"
|
||||||
#include "storage/ipc.h"
|
#include "storage/ipc.h"
|
||||||
@ -666,7 +665,8 @@ pg_exec_query_string(StringInfo query_string, /* string to execute */
|
|||||||
{
|
{
|
||||||
TransactionStmt *stmt = (TransactionStmt *) parsetree;
|
TransactionStmt *stmt = (TransactionStmt *) parsetree;
|
||||||
|
|
||||||
if (stmt->command == COMMIT || stmt->command == ROLLBACK)
|
if (stmt->kind == TRANS_STMT_COMMIT ||
|
||||||
|
stmt->kind == TRANS_STMT_ROLLBACK)
|
||||||
allowit = true;
|
allowit = true;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -1781,7 +1781,7 @@ PostgresMain(int argc, char *argv[], const char *username)
|
|||||||
if (!IsUnderPostmaster)
|
if (!IsUnderPostmaster)
|
||||||
{
|
{
|
||||||
puts("\nPOSTGRES backend interactive interface ");
|
puts("\nPOSTGRES backend interactive interface ");
|
||||||
puts("$Revision: 1.314 $ $Date: 2003/01/01 21:57:05 $\n");
|
puts("$Revision: 1.315 $ $Date: 2003/02/10 04:44:46 $\n");
|
||||||
}
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -2212,21 +2212,21 @@ CreateCommandTag(Node *parsetree)
|
|||||||
{
|
{
|
||||||
TransactionStmt *stmt = (TransactionStmt *) parsetree;
|
TransactionStmt *stmt = (TransactionStmt *) parsetree;
|
||||||
|
|
||||||
switch (stmt->command)
|
switch (stmt->kind)
|
||||||
{
|
{
|
||||||
case BEGIN_TRANS:
|
case TRANS_STMT_BEGIN:
|
||||||
tag = "BEGIN";
|
tag = "BEGIN";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case START:
|
case TRANS_STMT_START:
|
||||||
tag = "START TRANSACTION";
|
tag = "START TRANSACTION";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMMIT:
|
case TRANS_STMT_COMMIT:
|
||||||
tag = "COMMIT";
|
tag = "COMMIT";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROLLBACK:
|
case TRANS_STMT_ROLLBACK:
|
||||||
tag = "ROLLBACK";
|
tag = "ROLLBACK";
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -2329,15 +2329,15 @@ CreateCommandTag(Node *parsetree)
|
|||||||
break;
|
break;
|
||||||
|
|
||||||
case T_DefineStmt:
|
case T_DefineStmt:
|
||||||
switch (((DefineStmt *) parsetree)->defType)
|
switch (((DefineStmt *) parsetree)->kind)
|
||||||
{
|
{
|
||||||
case AGGREGATE:
|
case DEFINE_STMT_AGGREGATE:
|
||||||
tag = "CREATE AGGREGATE";
|
tag = "CREATE AGGREGATE";
|
||||||
break;
|
break;
|
||||||
case OPERATOR:
|
case DEFINE_STMT_OPERATOR:
|
||||||
tag = "CREATE OPERATOR";
|
tag = "CREATE OPERATOR";
|
||||||
break;
|
break;
|
||||||
case TYPE_P:
|
case DEFINE_STMT_TYPE:
|
||||||
tag = "CREATE TYPE";
|
tag = "CREATE TYPE";
|
||||||
break;
|
break;
|
||||||
default:
|
default:
|
||||||
|
@ -10,7 +10,7 @@
|
|||||||
*
|
*
|
||||||
*
|
*
|
||||||
* IDENTIFICATION
|
* IDENTIFICATION
|
||||||
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.190 2003/01/27 00:48:28 tgl Exp $
|
* $Header: /cvsroot/pgsql/src/backend/tcop/utility.c,v 1.191 2003/02/10 04:44:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -42,7 +42,6 @@
|
|||||||
#include "commands/view.h"
|
#include "commands/view.h"
|
||||||
#include "miscadmin.h"
|
#include "miscadmin.h"
|
||||||
#include "nodes/makefuncs.h"
|
#include "nodes/makefuncs.h"
|
||||||
#include "parser/parse.h"
|
|
||||||
#include "parser/parse_clause.h"
|
#include "parser/parse_clause.h"
|
||||||
#include "parser/parse_expr.h"
|
#include "parser/parse_expr.h"
|
||||||
#include "parser/parse_type.h"
|
#include "parser/parse_type.h"
|
||||||
@ -261,9 +260,9 @@ ProcessUtility(Node *parsetree,
|
|||||||
{
|
{
|
||||||
TransactionStmt *stmt = (TransactionStmt *) parsetree;
|
TransactionStmt *stmt = (TransactionStmt *) parsetree;
|
||||||
|
|
||||||
switch (stmt->command)
|
switch (stmt->kind)
|
||||||
{
|
{
|
||||||
case BEGIN_TRANS:
|
case TRANS_STMT_BEGIN:
|
||||||
BeginTransactionBlock();
|
BeginTransactionBlock();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
@ -272,7 +271,7 @@ ProcessUtility(Node *parsetree,
|
|||||||
* Identical to BEGIN, except that it takes a few
|
* Identical to BEGIN, except that it takes a few
|
||||||
* additional options.
|
* additional options.
|
||||||
*/
|
*/
|
||||||
case START:
|
case TRANS_STMT_START:
|
||||||
{
|
{
|
||||||
BeginTransactionBlock();
|
BeginTransactionBlock();
|
||||||
|
|
||||||
@ -295,11 +294,11 @@ ProcessUtility(Node *parsetree,
|
|||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case COMMIT:
|
case TRANS_STMT_COMMIT:
|
||||||
EndTransactionBlock();
|
EndTransactionBlock();
|
||||||
break;
|
break;
|
||||||
|
|
||||||
case ROLLBACK:
|
case TRANS_STMT_ROLLBACK:
|
||||||
UserAbortTransactionBlock();
|
UserAbortTransactionBlock();
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
@ -320,17 +319,10 @@ ProcessUtility(Node *parsetree,
|
|||||||
case T_FetchStmt:
|
case T_FetchStmt:
|
||||||
{
|
{
|
||||||
FetchStmt *stmt = (FetchStmt *) parsetree;
|
FetchStmt *stmt = (FetchStmt *) parsetree;
|
||||||
char *portalName = stmt->portalname;
|
|
||||||
bool forward;
|
|
||||||
long count;
|
|
||||||
|
|
||||||
forward = (bool) (stmt->direction == FORWARD);
|
PerformPortalFetch(stmt->portalname,
|
||||||
|
stmt->direction == FETCH_FORWARD,
|
||||||
/*
|
stmt->howMany,
|
||||||
* parser ensures that count is >= 0
|
|
||||||
*/
|
|
||||||
count = stmt->howMany;
|
|
||||||
PerformPortalFetch(portalName, forward, count,
|
|
||||||
(stmt->ismove) ? None : dest,
|
(stmt->ismove) ? None : dest,
|
||||||
completionTag);
|
completionTag);
|
||||||
}
|
}
|
||||||
@ -693,17 +685,17 @@ ProcessUtility(Node *parsetree,
|
|||||||
{
|
{
|
||||||
DefineStmt *stmt = (DefineStmt *) parsetree;
|
DefineStmt *stmt = (DefineStmt *) parsetree;
|
||||||
|
|
||||||
switch (stmt->defType)
|
switch (stmt->kind)
|
||||||
{
|
{
|
||||||
case OPERATOR:
|
case DEFINE_STMT_AGGREGATE:
|
||||||
|
DefineAggregate(stmt->defnames, stmt->definition);
|
||||||
|
break;
|
||||||
|
case DEFINE_STMT_OPERATOR:
|
||||||
DefineOperator(stmt->defnames, stmt->definition);
|
DefineOperator(stmt->defnames, stmt->definition);
|
||||||
break;
|
break;
|
||||||
case TYPE_P:
|
case DEFINE_STMT_TYPE:
|
||||||
DefineType(stmt->defnames, stmt->definition);
|
DefineType(stmt->defnames, stmt->definition);
|
||||||
break;
|
break;
|
||||||
case AGGREGATE:
|
|
||||||
DefineAggregate(stmt->defnames, stmt->definition);
|
|
||||||
break;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
break;
|
break;
|
||||||
@ -981,17 +973,17 @@ ProcessUtility(Node *parsetree,
|
|||||||
{
|
{
|
||||||
ReindexStmt *stmt = (ReindexStmt *) parsetree;
|
ReindexStmt *stmt = (ReindexStmt *) parsetree;
|
||||||
|
|
||||||
switch (stmt->reindexType)
|
switch (stmt->kind)
|
||||||
{
|
{
|
||||||
case INDEX:
|
case REINDEX_INDEX:
|
||||||
CheckOwnership(stmt->relation, false);
|
CheckOwnership(stmt->relation, false);
|
||||||
ReindexIndex(stmt->relation, stmt->force);
|
ReindexIndex(stmt->relation, stmt->force);
|
||||||
break;
|
break;
|
||||||
case TABLE:
|
case REINDEX_TABLE:
|
||||||
CheckOwnership(stmt->relation, false);
|
CheckOwnership(stmt->relation, false);
|
||||||
ReindexTable(stmt->relation, stmt->force);
|
ReindexTable(stmt->relation, stmt->force);
|
||||||
break;
|
break;
|
||||||
case DATABASE:
|
case REINDEX_DATABASE:
|
||||||
ReindexDatabase(stmt->name, stmt->force, false);
|
ReindexDatabase(stmt->name, stmt->force, false);
|
||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: makefuncs.h,v 1.43 2002/12/12 15:49:40 tgl Exp $
|
* $Id: makefuncs.h,v 1.44 2003/02/10 04:44:46 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -17,9 +17,10 @@
|
|||||||
#include "nodes/parsenodes.h"
|
#include "nodes/parsenodes.h"
|
||||||
|
|
||||||
|
|
||||||
extern A_Expr *makeA_Expr(int oper, List *name, Node *lexpr, Node *rexpr);
|
extern A_Expr *makeA_Expr(A_Expr_Kind kind, List *name,
|
||||||
|
Node *lexpr, Node *rexpr);
|
||||||
|
|
||||||
extern A_Expr *makeSimpleA_Expr(int oper, const char *name,
|
extern A_Expr *makeSimpleA_Expr(A_Expr_Kind kind, const char *name,
|
||||||
Node *lexpr, Node *rexpr);
|
Node *lexpr, Node *rexpr);
|
||||||
|
|
||||||
extern Var *makeVar(Index varno,
|
extern Var *makeVar(Index varno,
|
||||||
|
@ -7,7 +7,7 @@
|
|||||||
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
|
||||||
* Portions Copyright (c) 1994, Regents of the University of California
|
* Portions Copyright (c) 1994, Regents of the University of California
|
||||||
*
|
*
|
||||||
* $Id: parsenodes.h,v 1.228 2003/02/09 06:56:28 tgl Exp $
|
* $Id: parsenodes.h,v 1.229 2003/02/10 04:44:47 tgl Exp $
|
||||||
*
|
*
|
||||||
*-------------------------------------------------------------------------
|
*-------------------------------------------------------------------------
|
||||||
*/
|
*/
|
||||||
@ -165,15 +165,25 @@ typedef struct ParamRef
|
|||||||
} ParamRef;
|
} ParamRef;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* A_Expr - binary expressions
|
* A_Expr - infix, prefix, and postfix expressions
|
||||||
*/
|
*/
|
||||||
|
typedef enum A_Expr_Kind
|
||||||
|
{
|
||||||
|
AEXPR_OP, /* normal operator */
|
||||||
|
AEXPR_AND, /* booleans - name field is unused */
|
||||||
|
AEXPR_OR,
|
||||||
|
AEXPR_NOT,
|
||||||
|
AEXPR_DISTINCT, /* IS DISTINCT FROM - name must be "=" */
|
||||||
|
AEXPR_OF /* IS (not) OF - name must be "=" or "!=" */
|
||||||
|
} A_Expr_Kind;
|
||||||
|
|
||||||
typedef struct A_Expr
|
typedef struct A_Expr
|
||||||
{
|
{
|
||||||
NodeTag type;
|
NodeTag type;
|
||||||
int oper; /* type of operation (OP,OR,AND,NOT) */
|
A_Expr_Kind kind; /* see above */
|
||||||
List *name; /* possibly-qualified name of operator */
|
List *name; /* possibly-qualified name of operator */
|
||||||
Node *lexpr; /* left argument */
|
Node *lexpr; /* left argument, or NULL if none */
|
||||||
Node *rexpr; /* right argument */
|
Node *rexpr; /* right argument, or NULL if none */
|
||||||
} A_Expr;
|
} A_Expr;
|
||||||
|
|
||||||
/*
|
/*
|
||||||
@ -1058,13 +1068,20 @@ typedef struct CreateSeqStmt
|
|||||||
} CreateSeqStmt;
|
} CreateSeqStmt;
|
||||||
|
|
||||||
/* ----------------------
|
/* ----------------------
|
||||||
* Create {Operator|Type|Aggregate} Statement
|
* Create {Aggregate|Operator|Type} Statement
|
||||||
* ----------------------
|
* ----------------------
|
||||||
*/
|
*/
|
||||||
|
typedef enum DefineStmtKind
|
||||||
|
{
|
||||||
|
DEFINE_STMT_AGGREGATE,
|
||||||
|
DEFINE_STMT_OPERATOR,
|
||||||
|
DEFINE_STMT_TYPE
|
||||||
|
} DefineStmtKind;
|
||||||
|
|
||||||
typedef struct DefineStmt
|
typedef struct DefineStmt
|
||||||
{
|
{
|
||||||
NodeTag type;
|
NodeTag type;
|
||||||
int defType; /* OPERATOR|TYPE_P|AGGREGATE */
|
DefineStmtKind kind; /* see above */
|
||||||
List *defnames; /* qualified name (list of Value strings) */
|
List *defnames; /* qualified name (list of Value strings) */
|
||||||
List *definition; /* a list of DefElem */
|
List *definition; /* a list of DefElem */
|
||||||
} DefineStmt;
|
} DefineStmt;
|
||||||
@ -1196,11 +1213,18 @@ typedef struct CommentStmt
|
|||||||
* Fetch Statement
|
* Fetch Statement
|
||||||
* ----------------------
|
* ----------------------
|
||||||
*/
|
*/
|
||||||
|
typedef enum FetchDirection
|
||||||
|
{
|
||||||
|
FETCH_FORWARD,
|
||||||
|
FETCH_BACKWARD
|
||||||
|
/* ABSOLUTE someday? */
|
||||||
|
} FetchDirection;
|
||||||
|
|
||||||
typedef struct FetchStmt
|
typedef struct FetchStmt
|
||||||
{
|
{
|
||||||
NodeTag type;
|
NodeTag type;
|
||||||
int direction; /* FORWARD or BACKWARD */
|
FetchDirection direction; /* see above */
|
||||||
long howMany; /* amount to fetch */
|
long howMany; /* number of rows */
|
||||||
char *portalname; /* name of portal (cursor) */
|
char *portalname; /* name of portal (cursor) */
|
||||||
bool ismove; /* TRUE if MOVE */
|
bool ismove; /* TRUE if MOVE */
|
||||||
} FetchStmt;
|
} FetchStmt;
|
||||||
@ -1357,11 +1381,19 @@ typedef struct UnlistenStmt
|
|||||||
* {Begin|Commit|Rollback} Transaction Statement
|
* {Begin|Commit|Rollback} Transaction Statement
|
||||||
* ----------------------
|
* ----------------------
|
||||||
*/
|
*/
|
||||||
|
typedef enum TransactionStmtKind
|
||||||
|
{
|
||||||
|
TRANS_STMT_BEGIN,
|
||||||
|
TRANS_STMT_START, /* semantically identical to BEGIN */
|
||||||
|
TRANS_STMT_COMMIT,
|
||||||
|
TRANS_STMT_ROLLBACK
|
||||||
|
} TransactionStmtKind;
|
||||||
|
|
||||||
typedef struct TransactionStmt
|
typedef struct TransactionStmt
|
||||||
{
|
{
|
||||||
NodeTag type;
|
NodeTag type;
|
||||||
int command; /* BEGIN_TRANS|START|COMMIT|ROLLBACK */
|
TransactionStmtKind kind; /* see above */
|
||||||
List *options;
|
List *options; /* for BEGIN/START only */
|
||||||
} TransactionStmt;
|
} TransactionStmt;
|
||||||
|
|
||||||
/* ----------------------
|
/* ----------------------
|
||||||
@ -1544,10 +1576,17 @@ typedef struct ConstraintsSetStmt
|
|||||||
* REINDEX Statement
|
* REINDEX Statement
|
||||||
* ----------------------
|
* ----------------------
|
||||||
*/
|
*/
|
||||||
|
typedef enum ReindexStmtKind
|
||||||
|
{
|
||||||
|
REINDEX_INDEX,
|
||||||
|
REINDEX_TABLE,
|
||||||
|
REINDEX_DATABASE
|
||||||
|
} ReindexStmtKind;
|
||||||
|
|
||||||
typedef struct ReindexStmt
|
typedef struct ReindexStmt
|
||||||
{
|
{
|
||||||
NodeTag type;
|
NodeTag type;
|
||||||
int reindexType; /* INDEX|TABLE|DATABASE */
|
ReindexStmtKind kind; /* see above */
|
||||||
RangeVar *relation; /* Table or index to reindex */
|
RangeVar *relation; /* Table or index to reindex */
|
||||||
const char *name; /* name of database to reindex */
|
const char *name; /* name of database to reindex */
|
||||||
bool force;
|
bool force;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user