diff --git a/bin/pg_reorg.c b/bin/pg_reorg.c
index 55c42fc..afd9bba 100755
--- a/bin/pg_reorg.c
+++ b/bin/pg_reorg.c
@@ -9,7 +9,7 @@
* @brief Client Modules
*/
-const char *PROGRAM_VERSION = "1.1.6";
+const char *PROGRAM_VERSION = "1.1.7";
const char *PROGRAM_URL = "http://reorg.projects.postgresql.org/";
const char *PROGRAM_EMAIL = "reorg-general@lists.pgfoundry.org";
diff --git a/doc/pg_reorg-ja.html b/doc/pg_reorg-ja.html
index 652920b..d6c7bb1 100755
--- a/doc/pg_reorg-ja.html
+++ b/doc/pg_reorg-ja.html
@@ -8,7 +8,7 @@
-
Top >
pg_reorg
@@ -308,6 +308,14 @@ $ psql -f $PGSHARE/contrib/pg_reorg.sql -d your_database
DisksRequires amount of disks twice larger than target table and indexes. (If the total size of targets are 1GB, additional 2GB of disks are required.)
+
Releases
+
+- 1.1.7 (2011-08-07)
+ - Bugfix: VIEWs and FUNCTIONs could be corrupted that used a reorganized table which has a dropped column.
+ - Supports PostgreSQL 9.1 and 9.2dev. (but EXTENSION is not yet)
+
+
+
See Also
clusterdb,
vacuumdb
diff --git a/lib/pgut/pgut-be.c b/lib/pgut/pgut-be.c
index a46eb1f..676f4de 100755
--- a/lib/pgut/pgut-be.c
+++ b/lib/pgut/pgut-be.c
@@ -1,8 +1,9 @@
/*-------------------------------------------------------------------------
+ *
* pgut-be.c
*
- * Portions Copyright (c) 2008-2011, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
- * Portions Copyright (c) 2011, Itagaki Takahiro
+ * Copyright (c) 2009-2011, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+ *
*-------------------------------------------------------------------------
*/
@@ -48,4 +49,22 @@ tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc,
tuplestore_puttuple(state, heap_form_tuple(tdesc, values, isnull));
}
+Datum
+ExecFetchSlotTupleDatum(TupleTableSlot *slot)
+{
+ HeapTuple tup;
+ HeapTupleHeader td;
+ TupleDesc tupdesc;
+
+ /* Make sure we can scribble on the slot contents ... */
+ tup = ExecMaterializeSlot(slot);
+ /* ... and set up the composite-Datum header fields, in case not done */
+ td = tup->t_data;
+ tupdesc = slot->tts_tupleDescriptor;
+ HeapTupleHeaderSetDatumLength(td, tup->t_len);
+ HeapTupleHeaderSetTypeId(td, tupdesc->tdtypeid);
+ HeapTupleHeaderSetTypMod(td, tupdesc->tdtypmod);
+ return PointerGetDatum(td);
+}
+
#endif
diff --git a/lib/pgut/pgut-be.h b/lib/pgut/pgut-be.h
index 5d410b1..273220e 100755
--- a/lib/pgut/pgut-be.h
+++ b/lib/pgut/pgut-be.h
@@ -1,8 +1,9 @@
/*-------------------------------------------------------------------------
+ *
* pgut-be.h
*
- * Portions Copyright (c) 2008-2011, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
- * Portions Copyright (c) 2011, Itagaki Takahiro
+ * Copyright (c) 2009-2011, NIPPON TELEGRAPH AND TELEPHONE CORPORATION
+ *
*-------------------------------------------------------------------------
*/
@@ -99,6 +100,8 @@ extern int no_such_variable
#define pgstat_end_function_usage(fcu, finalize) ((void)0)
#define makeRangeVar(schemaname, relname, location) \
makeRangeVar((schemaname), (relname))
+#define tuplestore_gettupleslot(state, forward, copy, slot) \
+ tuplestore_gettupleslot(state, forward, slot)
#define pgstat_track_activity_query_size PGBE_ACTIVITY_SIZE
typedef void *BulkInsertState;
@@ -134,6 +137,7 @@ extern char *text_to_cstring(const text *t);
extern text *cstring_to_text(const char *s);
extern void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc,
Datum *values, bool *isnull);
+extern Datum ExecFetchSlotTupleDatum(TupleTableSlot *slot);
#define CStringGetTextDatum(s) PointerGetDatum(cstring_to_text(s))
#define TextDatumGetCString(d) text_to_cstring((text *) DatumGetPointer(d))
@@ -146,7 +150,13 @@ extern void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc,
reindex_index((indexId))
#define func_signature_string(funcname, nargs, argnames, argtypes) \
func_signature_string((funcname), (nargs), (argtypes))
-#define GetConfigOption(name, restrict_superuser) GetConfigOption((name))
+
+#endif
+
+#if PG_VERSION_NUM < 90200
+
+#define RangeVarGetRelid(relation, lockmode, missing_ok, nowait) \
+ RangeVarGetRelid((relation), (missing_ok))
#endif
@@ -156,6 +166,7 @@ extern void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc,
ATExecChangeOwner((relationOid), (newOwnerId), (recursing))
#define deleteDependencyRecordsFor(classId, objectId, skipExtensionDeps) \
deleteDependencyRecordsFor((classId), (objectId))
+#define PG_GET_COLLATION() (InvalidOid)
#endif
@@ -175,4 +186,12 @@ extern void tuplestore_putvalues(Tuplestorestate *state, TupleDesc tdesc,
FuncnameGetCandidates((names), (nargs), (variadic), (defaults))
#endif
+#if PG_VERSION_NUM < 90000
+#define GetConfigOption(name, missing_ok, restrict_superuser) \
+ GetConfigOption((name))
+#elif PG_VERSION_NUM < 90200
+#define GetConfigOption(name, missing_ok, restrict_superuser) \
+ GetConfigOption((name), (restrict_superuser))
+#endif
+
#endif /* PGUT_BE_H */
diff --git a/lib/reorg.c b/lib/reorg.c
index 1604ade..47da889 100755
--- a/lib/reorg.c
+++ b/lib/reorg.c
@@ -23,6 +23,7 @@
#include "miscadmin.h"
#include "utils/builtins.h"
#include "utils/lsyscache.h"
+#include "utils/rel.h"
#include "utils/relcache.h"
#include "utils/syscache.h"