summaryrefslogtreecommitdiff
path: root/src/include
diff options
context:
space:
mode:
authorHiroshi Inoue2000-03-09 05:00:26 +0000
committerHiroshi Inoue2000-03-09 05:00:26 +0000
commitfd9ff86bd9c4f1a96f3796212212b4099ca275de (patch)
treedb51e5e26579069c839261a7c6d21a3b329d0c3b /src/include
parent6513946cbbb0b06a9d764900a6db8ff88578f65c (diff)
Trial implementation of ALTER DROP COLUMN.
They are #ifdef'd. Add -D_DROP_COLUMN_HACK__ compile option to evaluate it.
Diffstat (limited to 'src/include')
-rw-r--r--src/include/catalog/pg_attribute.h16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h
index d7a1adb1c6..54f3adc9ee 100644
--- a/src/include/catalog/pg_attribute.h
+++ b/src/include/catalog/pg_attribute.h
@@ -8,7 +8,7 @@
* Portions Copyright (c) 1996-2000, PostgreSQL, Inc
* Portions Copyright (c) 1994, Regents of the University of California
*
- * $Id: pg_attribute.h,v 1.53 2000/01/26 05:57:57 momjian Exp $
+ * $Id: pg_attribute.h,v 1.54 2000/03/09 05:00:26 inoue Exp $
*
* NOTES
* the genbki.sh script reads this file and generates .bki
@@ -178,6 +178,20 @@ typedef FormData_pg_attribute *Form_pg_attribute;
#define Anum_pg_attribute_atthasdef 15
+#ifdef _DROP_COLUMN_HACK__
+/*
+ * CONSTANT and MACROS for DROP COLUMN implementation
+ */
+#define DROP_COLUMN_OFFSET -20
+#define COLUMN_IS_DROPPED(attribute) ((attribute)->attnum <= DROP_COLUMN_OFFSET)
+#define DROPPED_COLUMN_INDEX(attidx) (DROP_COLUMN_OFFSET - attidx)
+#define ATTRIBUTE_DROP_COLUMN(attribute) \
+ Assert((attribute)->attnum > 0); \
+ (attribute)->attnum = DROPPED_COLUMN_INDEX((attribute)->attnum); \
+ (attribute)->atttypid = (Oid) -1; \
+ (attribute)->attnotnull = false; \
+ (attribute)->atthasdef = false;
+#endif /* _DROP_COLUMN_HACK__ */
/* ----------------
* SCHEMA_ macros for declaring hardcoded tuple descriptors.
* these are used in utils/cache/relcache.c