Remove TABLESPACE option of CREATE SEQUENCE; sequences will now always

live in database or schema's default tablespace, as per today's discussion.
Also, remove some unused keywords from the grammar (PATH, PENDANT,
VERSION), and fix ALSO, which was added as a keyword but not added
to the keyword classification lists, thus making it worse-than-reserved.
This commit is contained in:
Tom Lane 2004-07-12 05:38:11 +00:00
parent c5ff895c48
commit c14a43f657
9 changed files with 15 additions and 48 deletions

View File

@ -1,5 +1,5 @@
<!--
$PostgreSQL: pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.40 2004/06/18 06:13:05 tgl Exp $
$PostgreSQL: pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.41 2004/07/12 05:36:56 tgl Exp $
PostgreSQL documentation
-->
@ -23,7 +23,6 @@ PostgreSQL documentation
CREATE [ TEMPORARY | TEMP ] SEQUENCE <replaceable class="parameter">name</replaceable> [ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ]
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> | NO MINVALUE ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> | NO MAXVALUE ]
[ START [ WITH ] <replaceable class="parameter">start</replaceable> ] [ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
[ TABLESPACE <replaceable class="parameter">tablespace</replaceable> ]
</synopsis>
</refsynopsisdiv>
@ -194,19 +193,6 @@ SELECT * FROM <replaceable>name</replaceable>;
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><replaceable class="parameter">tablespace</replaceable></term>
<listitem>
<para>
The optional clause <literal>TABLESPACE</> <replaceable
class="parameter">tablespace</replaceable> specifies
the tablespace in which to create the sequence. If this clause
is not supplied, the tablespace of the sequence's schema will be used.
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.112 2004/06/18 06:13:23 tgl Exp $
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.113 2004/07/12 05:37:03 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -180,7 +180,7 @@ DefineSequence(CreateSeqStmt *seq)
stmt->constraints = NIL;
stmt->hasoids = MUST_NOT_HAVE_OIDS;
stmt->oncommit = ONCOMMIT_NOOP;
stmt->tablespacename = seq->tablespacename;
stmt->tablespacename = NULL;
seqoid = DefineRelation(stmt, RELKIND_SEQUENCE);

View File

@ -15,7 +15,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.287 2004/06/25 21:55:54 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.288 2004/07/12 05:37:21 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -2152,7 +2152,6 @@ _copyCreateSeqStmt(CreateSeqStmt *from)
COPY_NODE_FIELD(sequence);
COPY_NODE_FIELD(options);
COPY_STRING_FIELD(tablespacename);
return newnode;
}

View File

@ -18,7 +18,7 @@
* Portions Copyright (c) 1994, Regents of the University of California
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.226 2004/06/25 21:55:54 tgl Exp $
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.227 2004/07/12 05:37:24 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1170,7 +1170,6 @@ _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
{
COMPARE_NODE_FIELD(sequence);
COMPARE_NODE_FIELD(options);
COMPARE_STRING_FIELD(tablespacename);
return true;
}

View File

@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.306 2004/06/18 06:13:31 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.307 2004/07/12 05:37:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -874,7 +874,6 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
seqstmt = makeNode(CreateSeqStmt);
seqstmt->sequence = makeRangeVar(snamespace, sname);
seqstmt->options = NIL;
seqstmt->tablespacename = NULL;
cxt->blist = lappend(cxt->blist, seqstmt);

View File

@ -11,7 +11,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.466 2004/07/11 23:13:54 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.467 2004/07/12 05:37:44 tgl Exp $
*
* HISTORY
* AUTHOR DATE MAJOR EVENT
@ -380,7 +380,7 @@ static void doNegateFloat(Value *v);
OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OR
ORDER OUT_P OUTER_P OVERLAPS OVERLAY OWNER
PARTIAL PASSWORD PATH_P PENDANT PLACING POSITION
PARTIAL PASSWORD PLACING POSITION
PRECISION PRESERVE PREPARE PRIMARY
PRIOR PRIVILEGES PROCEDURAL PROCEDURE
@ -403,7 +403,7 @@ static void doNegateFloat(Value *v);
UPDATE USAGE USER USING
VACUUM VALID VALIDATOR VALUES VARCHAR VARYING
VERBOSE VERSION VIEW VOLATILE
VERBOSE VIEW VOLATILE
WHEN WHERE WITH WITHOUT WORK WRITE
@ -417,7 +417,7 @@ static void doNegateFloat(Value *v);
*/
%token UNIONJOIN
/* Special keywords, not in the query language - see the "lex" file */
/* Special token types, not actually keywords - see the "lex" file */
%token <str> IDENT FCONST SCONST BCONST XCONST Op
%token <ival> ICONST PARAM
@ -1994,13 +1994,12 @@ CreateAsElement:
*****************************************************************************/
CreateSeqStmt:
CREATE OptTemp SEQUENCE qualified_name OptSeqList OptTableSpace
CREATE OptTemp SEQUENCE qualified_name OptSeqList
{
CreateSeqStmt *n = makeNode(CreateSeqStmt);
$4->istemp = $2;
n->sequence = $4;
n->options = $5;
n->tablespacename = $6;
$$ = (Node *)n;
}
;
@ -7572,6 +7571,7 @@ unreserved_keyword:
| ADD
| AFTER
| AGGREGATE
| ALSO
| ALTER
| ASSERTION
| ASSIGNMENT
@ -7677,8 +7677,6 @@ unreserved_keyword:
| OWNER
| PARTIAL
| PASSWORD
| PATH_P
| PENDANT
| PREPARE
| PRESERVE
| PRIOR
@ -7743,7 +7741,6 @@ unreserved_keyword:
| VALIDATOR
| VALUES
| VARYING
| VERSION
| VIEW
| VOLATILE
| WITH

View File

@ -8,7 +8,7 @@
*
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.150 2004/06/18 06:13:31 tgl Exp $
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.151 2004/07/12 05:37:44 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -237,8 +237,6 @@ static const ScanKeyword ScanKeywords[] = {
{"owner", OWNER},
{"partial", PARTIAL},
{"password", PASSWORD},
{"path", PATH_P},
{"pendant", PENDANT},
{"placing", PLACING},
{"position", POSITION},
{"precision", PRECISION},
@ -333,7 +331,6 @@ static const ScanKeyword ScanKeywords[] = {
{"varchar", VARCHAR},
{"varying", VARYING},
{"verbose", VERBOSE},
{"version", VERSION},
{"view", VIEW},
{"volatile", VOLATILE},
{"when", WHEN},

View File

@ -12,7 +12,7 @@
* by PostgreSQL
*
* IDENTIFICATION
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.377 2004/06/25 17:20:26 tgl Exp $
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.378 2004/07/12 05:37:53 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -7298,15 +7298,6 @@ dumpSequence(Archive *fout, TableInfo *tbinfo)
" CACHE %s%s",
cache, (cycled ? "\n CYCLE" : ""));
/* Output tablespace clause if necessary */
if (strlen(tbinfo->reltablespace) != 0 &&
strcmp(tbinfo->reltablespace,
tbinfo->dobj.namespace->nsptablespace) != 0)
{
appendPQExpBuffer(query, " TABLESPACE %s",
fmtId(tbinfo->reltablespace));
}
appendPQExpBuffer(query, ";\n");
ArchiveEntry(fout, tbinfo->dobj.catId, tbinfo->dobj.dumpId,

View File

@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.261 2004/07/11 23:13:58 tgl Exp $
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.262 2004/07/12 05:38:11 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@ -1165,7 +1165,6 @@ typedef struct CreateSeqStmt
NodeTag type;
RangeVar *sequence; /* the sequence to create */
List *options;
char *tablespacename; /* tablespace, or NULL for default */
} CreateSeqStmt;
typedef struct AlterSeqStmt