49 Commits

Author SHA1 Message Date
Daniele Varrazzo
8bdba99642 Fixed hba configuration to test on PG 10
Use env vars instead of hardcoded PG version to select config options.
2017-04-25 15:09:43 +01:00
Daniele Varrazzo
a5a5f3447a Added expected test for postgres 10
The \d output format changed
2017-04-25 15:09:27 +01:00
Daniele Varrazzo
b9b8e60bda Set up travis tests to run with postgres 10 2017-04-25 15:09:27 +01:00
Dmitry Ivanov
4df065891c add missing results to repack_1.out 2017-04-19 14:14:26 +03:00
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
789e819d74 Fix regression test failure. 2017-04-10 23:26:58 +01: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
48c42e1a87 fix regression tests for PostgreSQL <= 9.4 2017-03-30 14:09:59 +03:00
Dmitry Ivanov
9f54321e32 Merge branch 'master' into support_table_inheritance 2017-03-30 13:37:54 +03:00
Daniele Varrazzo
acb73b5a20 Dropped unneeded test results variants 2017-03-29 04:55:44 +01:00
Daniele Varrazzo
329f30e3ce Streamline tests to run only on supported versions 2017-03-29 04:39:02 +01:00
Daniele Varrazzo
62b4ad961b Added tests on pg 9.1 2017-03-29 04:38:35 +01:00
Daniele Varrazzo
2a9ca79772 Added travis configuration for CI tests 2017-03-29 02:34:12 +01:00
Daniele Varrazzo
d0217d81e3 Added output version for Postgres 9.2-9.4 2017-03-29 02:34:12 +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
5781aabb61 Merge pull request #107 from MasahikoSawada/change_to_after_trigger
Change trigger type to AFTER trigger.
2017-02-22 12:08:32 +09:00
Christian Ehrhardt
02ced4650a
drop Debian specific content from tablespace_2.out
Signed-off-by: Christian Ehrhardt <christian.ehrhardt@canonical.com>
2017-02-20 09:13:58 +01:00
Christian Ehrhardt
b85831ea65
Add a variant expected output for the 'tablespace' regression test
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>
2017-02-15 11:30:58 +01: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
Josh Kupershmidt
4002b4e18f Add a variant expected output for the 'repack' regression test
so that older versions of Postgres (pre-c7e27bec) will still
pass tests.

Also fix the 'tablespace' test the same way.
2016-01-24 17:54:48 -05: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
bwtakacy
aff4610d71 Add a expected out file to run the repack regression test successfully.
The 'repack' regression test fails on PostgreSQL 8.4 because the index name
assigned implicitely is different from 9.0 and after.
2015-01-14 15:47:43 +09:00
Josh Kupershmidt
080ebd3ed6 Bump up Copyright notices for 2015 2015-01-11 19:01:37 -05: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
03015f8ee8 Regression tests for the new indexes-repacking features.
Patch from Beena Emerson.
2013-07-04 09:47:31 -04:00
Josh Kupershmidt
b804c150ac Fix existing 'tablespace' regression test so it passes again.
Changes to repack_indexdef() had broken this test.
2013-06-22 06:47:06 -04:00
Josh Kupershmidt
95ce24c2a0 More sed tweaks to Makefile for portability.
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.
2013-05-21 21:45:47 -04:00
Josh Kupershmidt
dc31920616 Move regression tests from ./bin/ to ./regress/ 2013-05-09 21:15:48 -04:00