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

Remove not-really-standard implementation of CREATE TABLE's UNDER clause,

and revert documentation to describe the existing INHERITS clause
instead, per recent discussion in pghackers.  Also fix implementation
of SQL_inheritance SET variable: it is not cool to look at this var
during the initial parsing phase, only during parse_analyze().  See
recent bug report concerning misinterpretation of date constants just
after a SET TIMEZONE command.  gram.y really has to be an invariant
transformation of the query string to a raw parsetree; anything that
can vary with time must be done during parse analysis.
This commit is contained in:
Tom Lane
2001-01-05 06:34:23 +00:00
parent e62c38d0fc
commit 2fb6cc9045
19 changed files with 226 additions and 172 deletions

View File

@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
* $Id: parsenodes.h,v 1.122 2000/11/24 20:16:40 petere Exp $
* $Id: parsenodes.h,v 1.123 2001/01/05 06:34:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -89,6 +89,13 @@ typedef struct Query
} Query;
typedef enum InhOption
{
INH_NO, /* Do NOT scan child tables */
INH_YES, /* DO scan child tables */
INH_DEFAULT /* Use current SQL_inheritance option */
} InhOption;
/*****************************************************************************
* Other Statements (no optimizations required)
*
@@ -100,9 +107,11 @@ typedef struct Query
/* ----------------------
* Alter Table
*
* The fields are used in different ways by the different variants of
* this command.
* ----------------------
*/
/* The fields are used in different ways by the different variants of this command */
typedef struct AlterTableStmt
{
NodeTag type;
@@ -111,7 +120,7 @@ typedef struct AlterTableStmt
* E = add toast table,
* U = change owner */
char *relname; /* table to work on */
bool inh; /* recursively on children? */
InhOption inhOpt; /* recursively act on children? */
char *name; /* column or constraint name to act on, or new owner */
Node *def; /* definition of new column or constraint */
int behavior; /* CASCADE or RESTRICT drop behavior */
@@ -554,7 +563,7 @@ typedef struct RenameStmt
{
NodeTag type;
char *relname; /* relation to be altered */
bool inh; /* recursively alter children? */
InhOption inhOpt; /* recursively act on children? */
char *column; /* if NULL, rename the relation name to
* the new name. Otherwise, rename this
* column name. */
@@ -807,7 +816,7 @@ typedef struct DeleteStmt
NodeTag type;
char *relname; /* relation to delete from */
Node *whereClause; /* qualifications */
bool inh; /* delete from subclasses */
InhOption inhOpt; /* recursively act on children? */
} DeleteStmt;
/* ----------------------
@@ -821,7 +830,7 @@ typedef struct UpdateStmt
List *targetList; /* the target list (of ResTarget) */
Node *whereClause; /* qualifications */
List *fromClause; /* the from clause */
bool inh; /* update subclasses */
InhOption inhOpt; /* recursively act on children? */
} UpdateStmt;
/* ----------------------
@@ -1125,7 +1134,7 @@ typedef struct RangeVar
{
NodeTag type;
char *relname; /* the relation name */
bool inh; /* expand rel by inheritance? */
InhOption inhOpt; /* expand rel by inheritance? */
Attr *name; /* optional table alias & column aliases */
} RangeVar;