summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorBruce Momjian2003-03-20 07:02:11 +0000
committerBruce Momjian2003-03-20 07:02:11 +0000
commit5f65225fa37bd244ee5487448ac542b2b2f47296 (patch)
tree6fa88eb46e3ff9c1fd9fbe2f1d47bbacba2ffbc7 /src/include
parent46bce088c19d0e20152bc9c5e25ce105cff4fa07 (diff)
Todo items:
Add ALTER SEQUENCE to modify min/max/increment/cache/cycle values Also updated create sequence docs to mention NO MINVALUE, & NO MAXVALUE. New Files: doc/src/sgml/ref/alter_sequence.sgml src/test/regress/expected/sequence.out src/test/regress/sql/sequence.sql ALTER SEQUENCE is NOT transactional. It behaves similarly to setval(). It matches the proposed SQL200N spec, as well as Oracle in most ways -- Oracle lacks RESTART WITH for some strange reason. -- Rod Taylor <rbt@rbt.ca>
Diffstat (limited to 'src/include')
-rw-r--r--src/include/commands/sequence.h3
-rw-r--r--src/include/nodes/nodes.h3
-rw-r--r--src/include/nodes/parsenodes.h11
3 files changed, 13 insertions, 4 deletions
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index d4513de8c2e..a0a18f0f330 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -6,7 +6,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: sequence.h,v 1.22 2003/03/20 05:18:15 momjian Exp $
+ * $Id: sequence.h,v 1.23 2003/03/20 07:02:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -84,6 +84,7 @@ extern Datum setval(PG_FUNCTION_ARGS);
extern Datum setval_and_iscalled(PG_FUNCTION_ARGS);
extern void DefineSequence(CreateSeqStmt *stmt);
+extern void AlterSequence(AlterSeqStmt *stmt);
extern void seq_redo(XLogRecPtr lsn, XLogRecord *rptr);
extern void seq_undo(XLogRecPtr lsn, XLogRecord *rptr);
diff --git a/src/include/nodes/nodes.h b/src/include/nodes/nodes.h
index 3304ea89e4e..7ccaeca3484 100644
--- a/src/include/nodes/nodes.h
+++ b/src/include/nodes/nodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: nodes.h,v 1.138 2003/03/10 03:53:51 tgl Exp $
+ * $Id: nodes.h,v 1.139 2003/03/20 07:02:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -220,6 +220,7 @@ typedef enum NodeTag
T_VacuumStmt,
T_ExplainStmt,
T_CreateSeqStmt,
+ T_AlterSeqStmt,
T_VariableSetStmt,
T_VariableShowStmt,
T_VariableResetStmt,
diff --git a/src/include/nodes/parsenodes.h b/src/include/nodes/parsenodes.h
index 216ed04c762..b215f8a98f5 100644
--- a/src/include/nodes/parsenodes.h
+++ b/src/include/nodes/parsenodes.h
@@ -7,7 +7,7 @@
* Portions Copyright (c) 1996-2002, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: parsenodes.h,v 1.233 2003/03/11 19:40:23 tgl Exp $
+ * $Id: parsenodes.h,v 1.234 2003/03/20 07:02:11 momjian Exp $
*
*-------------------------------------------------------------------------
*/
@@ -1043,7 +1043,7 @@ typedef struct DropGroupStmt
} DropGroupStmt;
/* ----------------------
- * Create SEQUENCE Statement
+ * {Create|Alter} SEQUENCE Statement
* ----------------------
*/
@@ -1054,6 +1054,13 @@ typedef struct CreateSeqStmt
List *options;
} CreateSeqStmt;
+typedef struct AlterSeqStmt
+{
+ NodeTag type;
+ RangeVar *sequence; /* the sequence to alter */
+ List *options;
+} AlterSeqStmt;
+
/* ----------------------
* Create {Aggregate|Operator|Type} Statement
* ----------------------