Remove TABLESPACE option of CREATE SEQUENCE; sequences will now always
authorTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Jul 2004 05:38:11 +0000 (05:38 +0000)
committerTom Lane <tgl@sss.pgh.pa.us>
Mon, 12 Jul 2004 05:38:11 +0000 (05:38 +0000)
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.

doc/src/sgml/ref/create_sequence.sgml
src/backend/commands/sequence.c
src/backend/nodes/copyfuncs.c
src/backend/nodes/equalfuncs.c
src/backend/parser/analyze.c
src/backend/parser/gram.y
src/backend/parser/keywords.c
src/bin/pg_dump/pg_dump.c
src/include/nodes/parsenodes.h

index de9fa57ee14f7fdc560354011ddb084e7df1d561..d380d32a7291ce08aabd4d914391d76dd3d870bc 100644 (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>
 
index 1b6538b539c4d06bc8b99a692855ca65aa412d8f..dc66314afee2224ba9d4a5d9ac45740aaa0362c7 100644 (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);
 
index 17adc9cf5fde2ebe12012d9b7202116eea43f8e2..8c550f4911868141c86f0f4338386c56407f1c8c 100644 (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;
 }
index f46c7b44205663e72fbdb4e4d07d27123c2990f0..e2d4d16c782f3c512dd43e75da84368a0b5e1ca4 100644 (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;
 }
index 5450103156217bbd92747aa07b9b3b6375a346ad..1c7be76e72993780696ead273f3ef28e90583884 100644 (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);
 
index e9af75baaa376af864060055322adb96f970bb1d..519bcce7184b654d19be963b3ac456b7ae25d450 100644 (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
index a89f8da7d4ece07765c81037fbff52f38933ee63..cae1ed159b0c496ed83cc61504e1fe2bcedfdb38 100644 (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},
index 00793ebbced6299b55dd5ee87c45e8605c312454..c01ea6ad5ba2e1e41966eade57c91c1a57250ad6 100644 (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,
index 3745972bd50b496e0fefe204456adb8400a8448f..47b09b42a79c2b5687bc94ac7da5e46e579532ea 100644 (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