Previously, even if the table whose column storage type has been
changed the pg_repack did first copy the data to table without changing
column storage paramater. This cause of that the existing data is
pushed out to its toast table even if actual column storage type is
"main".
Issue #94.
The storage option such as AUTOVACUUM_VACUUM_SCALE_FACTOR can be
set to both heap table and TOAST table. But the storage parameter
for TOAST table had gone after repacked. This change create new
function get_storage_param which returns all storage paramters
including for TOAST table and OID setting.
Issue #10.
The recent stable update changed output for calls to
repack.repack_indexdef with the third arg being NULL.
Output gets an additional "TABLESPACE pg_default". So add
another variant of expected output to cover 9.6.2, 9.5.6,
9.4.11 and 9.3.16.
Stable update at https://www.postgresql.org/about/news/1733/
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
pg_repack needs to take an exclusive lock at the end of the
reorganization. If the lock cannot be taken after duration
--wait-timeout option specified and this option is true,
pg_repack gives up to repack a target table instead of
cancelling conflicting backend. False by default.
During repacking table, if a transaction executes INSERT CONFLICT
ON UPDATE/DO NOTHING, because we define BEFORE trigger on target
table, the contents of operation log table becomes inconsistent
easliy. As a result, pg_reapck fails with a high probability.
To resolve this issue, this changes the trigger type from BEFORE
to AFTER. We define AFTER trigger that is the first of the AFTER
trigger to fire on the table.
Upstream changes now cause reloption values to be emitted with surrounding
quotes. That breaks, for example, the output of \d commands in one of the
tests.
These calls can require an access share lock on the table, which might
conflict with an existing or later acquires lock. So perform these calls
while we already have an exclusive lock on the table. This unfortuantely
means that we ave to remove the constness of the table parameter to
repack_one_table, as it is not modifying the table object to set up the
indexes.
Adds support for repacking only the tables in a specified schema. This
doesn't support --only-indexes mode, but that seems alright for now.
Fix merge conflicts, and make a few tweaks along the way:
* bump version to 1.3-dev0
* add Beena to list of maintainers
* documentation wordsmithing
* fix up the INFO message printed for each index in --index or
--only-indexes mode, so that it is only printed once per index, and
prints the name of the original index, not that of the transient
index_%u name.
It was possible to specify both --schema and --table which probably
-should- be legal but would need some code to be rewritten. This patch
adds a check that both can't be specified and returns an error telling
the user to use schema.table notation instead. A regression test
checking this behaviour was added.
* More mentions of new --only-indexes feature
* Note we now support up to Postgres 9.3, and get rid of outdated list
of supported operating systems. (As far as we know, pg_repack should
build on any platforms supported by PostgreSQL itself, although no one
has tested the Windows build in a long time.)
* Remove most of the warnings about data corruption possible with concurrent
DDL: this should no longer be a concern now that we hold an ACCESS SHARE
lock during full-table repacks. Keep a short warning about old versions
being susceptible to this problem, just to make clear that it's fixed now
and as an enticement to upgrade.
* A few grammar, phrasing, and typo fixes
The -E flag to specify extended regular expressions apparently is
not portable to all platforms, such as CentOS 4.5. Use an uglier
but hopefully more portable basic regular expression in Makefiles.