28 Commits

Author SHA1 Message Date
Dmitry Ivanov
e1f362e831 resolve conflicts 2017-04-19 14:05:53 +03:00
Masahiko Sawada
a6b2b0e82e Fix a mistake of merging.
Also fix regression test failure.
2017-04-11 23:43:21 +09:00
Masahiko Sawada
d55a08fc1e Merge branch 'master' into toast_storage_param 2017-04-11 23:30:27 +09:00
Masahiko Sawada
5adff6ff0b Set column storage type before first copying table.
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.
2017-04-10 23:25:49 +01:00
Masahiko Sawada
c44306ba74 Fix regression test failure. 2017-04-10 23:21:26 +01:00
Masahiko Sawada
ca5ca11d4d Specify the storage option for TOAST table when create table.
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.
2017-04-10 23:20:50 +01:00
Daniele Varrazzo
6d7b1dbca4 Added test to verify the attribute options are respected 2017-04-10 23:07:40 +01:00
Dmitry Ivanov
4e90fe9b48 resolve conflicts 2017-03-24 16:54:16 +03:00
Dmitry Ivanov
c62488ae13 add regression tests for --exclude-extension (-C) 2017-03-23 16:26:46 +03:00
Dmitry Ivanov
6a51ed209d add regression tests for '--parent-table' option 2017-03-22 15:04:27 +03:00
Nathan Bossart
1f784089a6 Added regression testing for --no-superuser-check option. 2017-03-02 02:58:41 +00:00
masahiko
b329f9e143 Merge pull request #108 from MasahikoSawada/dont_kill_backend
Introduce --no-kill-backend option.
2017-02-23 09:39:36 +09:00
Masahiko Sawada
f6c1304c36 Change the option name to no-kill-backend.
For consistency with other slimilar option such as no-order,
no-analyze.
2017-02-22 03:49:04 +00:00
Masahiko Sawada
34c6506f54 Introduce --dont-kill-backend option.
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.
2017-01-24 14:47:00 +09:00
Masahiko Sawada
375f03c0c3 Change trigger name from a_repack_trigger to repack_trigger.
In AFTER trigger context, since triggered tuple is not changed by
any other triggers we can call it just repack_trigger.
2017-01-24 14:09:05 +09:00
Masahiko Sawada
d83ee3d6a0 Change trigger type to AFTER trigger.
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.
2017-01-19 16:32:54 +09:00
amit
ab70a010a5 Fix regression test output.
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.
2016-01-19 09:30:10 +09:00
Andrew Dunstan
db4ec04cf2 Do get_indexdef calls while the table is already locked.
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.
2014-12-30 16:48:06 -05:00
Andrew Dunstan
9f77a2fd03 Gather index info at the same time as table info, rather than later.
This helps avoid possible problems with later strong table locks.
2014-12-30 10:48:35 -05:00
Josh Kupershmidt
649e72c0a4 Add some ORDER BYs to queries fetching lists of tables/indexes
to be repacked, in order to ensure consistent installcheck results.
2014-05-26 20:57:28 -04:00
Josh Kupershmidt
f0cd787bf5 Merge in Pull Request #20 from Steeve Lennmark.
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.
2014-05-24 15:42:24 -04:00
schmiddy
4eb1cef99e Make the 'repacking index ...' message be displayed
for indexes-only repacks (not just when in dry-run mode).
2014-05-24 00:09:03 -04:00
Steeve Lennmark
f094795178 Clean up tests and fix regression
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.
2014-01-31 08:22:12 +00:00
Steeve Lennmark
d16bdc20d2 Add test for --dry-run
This should probably be rewritten to actually check OID on old/new tables so
that we don't accidentally execute repack during a dry run.
2014-01-30 12:53:48 +00:00
Steeve Lennmark
9b381f5b85 Add second test that tests multiple --schema args 2014-01-30 12:27:32 +00:00
Steeve Lennmark
e7b6719256 Add test for --schema (-c) 2014-01-30 12:19:21 +00:00
Josh Kupershmidt
27ea0fabe4 Several documentation updates for the pending 1.2 release:
* 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
2013-07-05 21:02:28 -04:00
Josh Kupershmidt
dc31920616 Move regression tests from ./bin/ to ./regress/ 2013-05-09 21:15:48 -04:00