Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit c14a43f

Browse files
committed
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.
1 parent c5ff895 commit c14a43f

File tree

9 files changed

+15
-48
lines changed

9 files changed

+15
-48
lines changed

doc/src/sgml/ref/create_sequence.sgml

Lines changed: 1 addition & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
<!--
2-
$PostgreSQL: pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.40 2004/06/18 06:13:05 tgl Exp $
2+
$PostgreSQL: pgsql/doc/src/sgml/ref/create_sequence.sgml,v 1.41 2004/07/12 05:36:56 tgl Exp $
33
PostgreSQL documentation
44
-->
55

@@ -23,7 +23,6 @@ PostgreSQL documentation
2323
CREATE [ TEMPORARY | TEMP ] SEQUENCE <replaceable class="parameter">name</replaceable> [ INCREMENT [ BY ] <replaceable class="parameter">increment</replaceable> ]
2424
[ MINVALUE <replaceable class="parameter">minvalue</replaceable> | NO MINVALUE ] [ MAXVALUE <replaceable class="parameter">maxvalue</replaceable> | NO MAXVALUE ]
2525
[ START [ WITH ] <replaceable class="parameter">start</replaceable> ] [ CACHE <replaceable class="parameter">cache</replaceable> ] [ [ NO ] CYCLE ]
26-
[ TABLESPACE <replaceable class="parameter">tablespace</replaceable> ]
2726
</synopsis>
2827
</refsynopsisdiv>
2928

@@ -194,19 +193,6 @@ SELECT * FROM <replaceable>name</replaceable>;
194193
</para>
195194
</listitem>
196195
</varlistentry>
197-
198-
<varlistentry>
199-
<term><replaceable class="parameter">tablespace</replaceable></term>
200-
<listitem>
201-
<para>
202-
The optional clause <literal>TABLESPACE</> <replaceable
203-
class="parameter">tablespace</replaceable> specifies
204-
the tablespace in which to create the sequence. If this clause
205-
is not supplied, the tablespace of the sequence's schema will be used.
206-
</para>
207-
</listitem>
208-
</varlistentry>
209-
210196
</variablelist>
211197
</refsect1>
212198

src/backend/commands/sequence.c

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.112 2004/06/18 06:13:23 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/commands/sequence.c,v 1.113 2004/07/12 05:37:03 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -180,7 +180,7 @@ DefineSequence(CreateSeqStmt *seq)
180180
stmt->constraints = NIL;
181181
stmt->hasoids = MUST_NOT_HAVE_OIDS;
182182
stmt->oncommit = ONCOMMIT_NOOP;
183-
stmt->tablespacename = seq->tablespacename;
183+
stmt->tablespacename = NULL;
184184

185185
seqoid = DefineRelation(stmt, RELKIND_SEQUENCE);
186186

src/backend/nodes/copyfuncs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,7 @@
1515
* Portions Copyright (c) 1994, Regents of the University of California
1616
*
1717
* IDENTIFICATION
18-
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.287 2004/06/25 21:55:54 tgl Exp $
18+
* $PostgreSQL: pgsql/src/backend/nodes/copyfuncs.c,v 1.288 2004/07/12 05:37:21 tgl Exp $
1919
*
2020
*-------------------------------------------------------------------------
2121
*/
@@ -2152,7 +2152,6 @@ _copyCreateSeqStmt(CreateSeqStmt *from)
21522152

21532153
COPY_NODE_FIELD(sequence);
21542154
COPY_NODE_FIELD(options);
2155-
COPY_STRING_FIELD(tablespacename);
21562155

21572156
return newnode;
21582157
}

src/backend/nodes/equalfuncs.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -18,7 +18,7 @@
1818
* Portions Copyright (c) 1994, Regents of the University of California
1919
*
2020
* IDENTIFICATION
21-
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.226 2004/06/25 21:55:54 tgl Exp $
21+
* $PostgreSQL: pgsql/src/backend/nodes/equalfuncs.c,v 1.227 2004/07/12 05:37:24 tgl Exp $
2222
*
2323
*-------------------------------------------------------------------------
2424
*/
@@ -1170,7 +1170,6 @@ _equalCreateSeqStmt(CreateSeqStmt *a, CreateSeqStmt *b)
11701170
{
11711171
COMPARE_NODE_FIELD(sequence);
11721172
COMPARE_NODE_FIELD(options);
1173-
COMPARE_STRING_FIELD(tablespacename);
11741173

11751174
return true;
11761175
}

src/backend/parser/analyze.c

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
77
* Portions Copyright (c) 1994, Regents of the University of California
88
*
9-
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.306 2004/06/18 06:13:31 tgl Exp $
9+
* $PostgreSQL: pgsql/src/backend/parser/analyze.c,v 1.307 2004/07/12 05:37:44 tgl Exp $
1010
*
1111
*-------------------------------------------------------------------------
1212
*/
@@ -874,7 +874,6 @@ transformColumnDefinition(ParseState *pstate, CreateStmtContext *cxt,
874874
seqstmt = makeNode(CreateSeqStmt);
875875
seqstmt->sequence = makeRangeVar(snamespace, sname);
876876
seqstmt->options = NIL;
877-
seqstmt->tablespacename = NULL;
878877

879878
cxt->blist = lappend(cxt->blist, seqstmt);
880879

src/backend/parser/gram.y

Lines changed: 6 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
*
1212
*
1313
* IDENTIFICATION
14-
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.466 2004/07/11 23:13:54 tgl Exp $
14+
* $PostgreSQL: pgsql/src/backend/parser/gram.y,v 2.467 2004/07/12 05:37:44 tgl Exp $
1515
*
1616
* HISTORY
1717
* AUTHOR DATE MAJOR EVENT
@@ -380,7 +380,7 @@ static void doNegateFloat(Value *v);
380380
OBJECT_P OF OFF OFFSET OIDS OLD ON ONLY OPERATOR OPTION OR
381381
ORDER OUT_P OUTER_P OVERLAPS OVERLAY OWNER
382382

383-
PARTIAL PASSWORD PATH_P PENDANT PLACING POSITION
383+
PARTIAL PASSWORD PLACING POSITION
384384
PRECISION PRESERVE PREPARE PRIMARY
385385
PRIOR PRIVILEGES PROCEDURAL PROCEDURE
386386

@@ -403,7 +403,7 @@ static void doNegateFloat(Value *v);
403403
UPDATE USAGE USER USING
404404

405405
VACUUM VALID VALIDATOR VALUES VARCHAR VARYING
406-
VERBOSE VERSION VIEW VOLATILE
406+
VERBOSE VIEW VOLATILE
407407

408408
WHEN WHERE WITH WITHOUT WORK WRITE
409409

@@ -417,7 +417,7 @@ static void doNegateFloat(Value *v);
417417
*/
418418
%token UNIONJOIN
419419

420-
/* Special keywords, not in the query language - see the "lex" file */
420+
/* Special token types, not actually keywords - see the "lex" file */
421421
%token <str> IDENT FCONST SCONST BCONST XCONST Op
422422
%token <ival> ICONST PARAM
423423

@@ -1994,13 +1994,12 @@ CreateAsElement:
19941994
*****************************************************************************/
19951995

19961996
CreateSeqStmt:
1997-
CREATE OptTemp SEQUENCE qualified_name OptSeqList OptTableSpace
1997+
CREATE OptTemp SEQUENCE qualified_name OptSeqList
19981998
{
19991999
CreateSeqStmt *n = makeNode(CreateSeqStmt);
20002000
$4->istemp = $2;
20012001
n->sequence = $4;
20022002
n->options = $5;
2003-
n->tablespacename = $6;
20042003
$$ = (Node *)n;
20052004
}
20062005
;
@@ -7572,6 +7571,7 @@ unreserved_keyword:
75727571
| ADD
75737572
| AFTER
75747573
| AGGREGATE
7574+
| ALSO
75757575
| ALTER
75767576
| ASSERTION
75777577
| ASSIGNMENT
@@ -7677,8 +7677,6 @@ unreserved_keyword:
76777677
| OWNER
76787678
| PARTIAL
76797679
| PASSWORD
7680-
| PATH_P
7681-
| PENDANT
76827680
| PREPARE
76837681
| PRESERVE
76847682
| PRIOR
@@ -7743,7 +7741,6 @@ unreserved_keyword:
77437741
| VALIDATOR
77447742
| VALUES
77457743
| VARYING
7746-
| VERSION
77477744
| VIEW
77487745
| VOLATILE
77497746
| WITH

src/backend/parser/keywords.c

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@
88
*
99
*
1010
* IDENTIFICATION
11-
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.150 2004/06/18 06:13:31 tgl Exp $
11+
* $PostgreSQL: pgsql/src/backend/parser/keywords.c,v 1.151 2004/07/12 05:37:44 tgl Exp $
1212
*
1313
*-------------------------------------------------------------------------
1414
*/
@@ -237,8 +237,6 @@ static const ScanKeyword ScanKeywords[] = {
237237
{"owner", OWNER},
238238
{"partial", PARTIAL},
239239
{"password", PASSWORD},
240-
{"path", PATH_P},
241-
{"pendant", PENDANT},
242240
{"placing", PLACING},
243241
{"position", POSITION},
244242
{"precision", PRECISION},
@@ -333,7 +331,6 @@ static const ScanKeyword ScanKeywords[] = {
333331
{"varchar", VARCHAR},
334332
{"varying", VARYING},
335333
{"verbose", VERBOSE},
336-
{"version", VERSION},
337334
{"view", VIEW},
338335
{"volatile", VOLATILE},
339336
{"when", WHEN},

src/bin/pg_dump/pg_dump.c

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
* by PostgreSQL
1313
*
1414
* IDENTIFICATION
15-
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.377 2004/06/25 17:20:26 tgl Exp $
15+
* $PostgreSQL: pgsql/src/bin/pg_dump/pg_dump.c,v 1.378 2004/07/12 05:37:53 tgl Exp $
1616
*
1717
*-------------------------------------------------------------------------
1818
*/
@@ -7298,15 +7298,6 @@ dumpSequence(Archive *fout, TableInfo *tbinfo)
72987298
" CACHE %s%s",
72997299
cache, (cycled ? "\n CYCLE" : ""));
73007300

7301-
/* Output tablespace clause if necessary */
7302-
if (strlen(tbinfo->reltablespace) != 0 &&
7303-
strcmp(tbinfo->reltablespace,
7304-
tbinfo->dobj.namespace->nsptablespace) != 0)
7305-
{
7306-
appendPQExpBuffer(query, " TABLESPACE %s",
7307-
fmtId(tbinfo->reltablespace));
7308-
}
7309-
73107301
appendPQExpBuffer(query, ";\n");
73117302

73127303
ArchiveEntry(fout, tbinfo->dobj.catId, tbinfo->dobj.dumpId,

src/include/nodes/parsenodes.h

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@
77
* Portions Copyright (c) 1996-2003, PostgreSQL Global Development Group
88
* Portions Copyright (c) 1994, Regents of the University of California
99
*
10-
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.261 2004/07/11 23:13:58 tgl Exp $
10+
* $PostgreSQL: pgsql/src/include/nodes/parsenodes.h,v 1.262 2004/07/12 05:38:11 tgl Exp $
1111
*
1212
*-------------------------------------------------------------------------
1313
*/
@@ -1165,7 +1165,6 @@ typedef struct CreateSeqStmt
11651165
NodeTag type;
11661166
RangeVar *sequence; /* the sequence to create */
11671167
List *options;
1168-
char *tablespacename; /* tablespace, or NULL for default */
11691168
} CreateSeqStmt;
11701169

11711170
typedef struct AlterSeqStmt

0 commit comments

Comments
 (0)