aboutsummaryrefslogtreecommitdiff
path: root/src/include/commands/sequence.h
diff options
context:
space:
mode:
authorTom Lane <tgl@sss.pgh.pa.us>2001-08-16 20:38:56 +0000
committerTom Lane <tgl@sss.pgh.pa.us>2001-08-16 20:38:56 +0000
commitd4f4b971a4eb7992add4e70752aa9d0936c43dcc (patch)
tree59ef607b44a6bedc3eeb9b06cc77850649ca7ae0 /src/include/commands/sequence.h
parentbcb0ccf5be9ef9e1a76968e773cb2bd11565ef9c (diff)
downloadpostgresql-d4f4b971a4eb7992add4e70752aa9d0936c43dcc.tar.gz
postgresql-d4f4b971a4eb7992add4e70752aa9d0936c43dcc.zip
Sequences are now based on int8, not int4, arithmetic. SERIAL pseudo-type
has an alias SERIAL4 and a sister SERIAL8. SERIAL8 is just the same except the created column is type int8 not int4. initdb forced. Note this also breaks any chance of pg_upgrade from 7.1, unless we hack up pg_upgrade to drop and recreate sequences. (Which is not out of the question, but I don't wanna do it.)
Diffstat (limited to 'src/include/commands/sequence.h')
-rw-r--r--src/include/commands/sequence.h29
1 files changed, 27 insertions, 2 deletions
diff --git a/src/include/commands/sequence.h b/src/include/commands/sequence.h
index 75b2311481d..77a5470f439 100644
--- a/src/include/commands/sequence.h
+++ b/src/include/commands/sequence.h
@@ -3,6 +3,10 @@
* sequence.h
* prototypes for sequence.c.
*
+ * Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
+ * Portions Copyright (c) 1994, Regents of the University of California
+ *
+ * $Id: sequence.h,v 1.16 2001/08/16 20:38:55 tgl Exp $
*
*-------------------------------------------------------------------------
*/
@@ -12,17 +16,38 @@
#include "nodes/parsenodes.h"
#include "access/xlog.h"
+/*
+ * On a machine with no 64-bit-int C datatype, sizeof(int64) will not be 8,
+ * but we need this struct type to line up with the way that a sequence
+ * table is defined --- and pg_type will say that int8 is 8 bytes anyway.
+ * So, we need padding. Ugly but necessary.
+ */
typedef struct FormData_pg_sequence
{
NameData sequence_name;
+#ifndef INT64_IS_BUSTED
+ int64 last_value;
+ int64 increment_by;
+ int64 max_value;
+ int64 min_value;
+ int64 cache_value;
+ int64 log_cnt;
+#else
int32 last_value;
+ int32 pad1;
int32 increment_by;
+ int32 pad2;
int32 max_value;
+ int32 pad3;
int32 min_value;
+ int32 pad4;
int32 cache_value;
+ int32 pad5;
int32 log_cnt;
- char is_cycled;
- char is_called;
+ int32 pad6;
+#endif
+ bool is_cycled;
+ bool is_called;
} FormData_pg_sequence;
typedef FormData_pg_sequence *Form_pg_sequence;