37 Commits

Author SHA1 Message Date
Daniele Varrazzo
73851d2e5c Test file separated in setup - run - check
The run part has different output across minor versions, the others not.

Dropped test files identification statement as now the variable part is
in small chunks.
2018-03-20 12:49:15 +00:00
Daniele Varrazzo
74d56ef4d6 Dropped now equivalent test output files 2018-03-20 12:31:39 +00:00
Daniele Varrazzo
a5509c7415 No superuser check separated from other tests
The output differs across versions because it can include the context.

This made:

- repack.out = repack_1.out
- repack_3.out = repack_5.out
2018-03-20 12:29:16 +00:00
Daniele Varrazzo
6dfbfffe59 Dropped duplicate test output files 2018-03-20 12:20:06 +00:00
Daniele Varrazzo
0cb08e5512 Variable psql table output moved in separate file
This made:

- repack.out == repack_2.out
- repack_3.out == repack_4.out
- repack_1.out == repack_6.out
2018-03-20 11:39:41 +00:00
Daniele Varrazzo
07e944d9d1 Use the Postgres way to get the version number
Unsurprisingly, there was one.
2018-03-19 19:07:33 +00:00
Daniele Varrazzo
2fd0eb050a A more compact way to verify the identity of the test files 2018-03-09 15:32:26 +00:00
Masahiko Sawada
64c22ffc5f Add expected files for regression tests.
Due to compatibility break by the recent PostgreSQL core code changes
we need to split expected files into each minor releases rather than
each major releases.

Now the mapping between PostgreSQL version and expected file is
complicated as follows.

* version 10
  * >= 10.3 : repack_3.out, tablespace_2.out
  * < 10.3 : repack_2.out, tablespace.out

* version 9.6
  * >= 9.6.8 : repack_4.out, tablespace_2.out
  * < 9.6.8 : repack.out, tablespace.out

* version 9.5
  * >= 9.5.12 : repack_4.out, tablespace_2.out
  * < 9.5.12 : repack.out, tablespace_1.out

* version 9.4
  * >= 9.4.17 : repack_5.out, tablespace_2.out
  * < 9.4.17 : repack_1.out, tablespace_1.out

* version 9.3
  * >= 9.3.22 : repack_6.out, tablespace_3.out
  * < 9.3.22 : repack_1.out, tablespace_1.out

* version 9.2 : repack_1.out, tablespace_1.out

* version 9.1 : repack_1.out, tablespace_1.out
2018-03-09 14:00:04 +09:00
Masahiko Sawada
f690ada80f Change to use only the characters that are printable ASCII.
The regression test could fail on some environments such as where
the encoding is SQL_ASCII.

Fixed issue #130.
2017-10-03 11:51:07 -07:00
Daniele Varrazzo
7413a65985 Merge remote-tracking branch 'origin/master' into pg10 2017-09-25 02:45:49 +01:00
Masahiko Sawada
33f4c30563 Fix reorganize table without sorting.
Commit 5adff6ff0b88d6f162719eff7176069730537c2a separated the
data copy from creating table. This is a cause of bug that
pg_repack doesn't actually sort table during reorganization.
This commit fixes this issue by adding ORDER BY clause to Copy
SQL rather than CREATE TABLE SQL.

Reported by acmzero on issue #138.
2017-08-05 02:31:47 +09:00
Daniele Varrazzo
a7e0b6748e Added identifier to recognize the test output file 2017-04-25 15:50:33 +01:00
Dmitry Ivanov
e1f362e831 resolve conflicts 2017-04-19 14:05:53 +03: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
Daniele Varrazzo
329f30e3ce Streamline tests to run only on supported versions 2017-03-29 04:39:02 +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
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
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
dc31920616 Move regression tests from ./bin/ to ./regress/ 2013-05-09 21:15:48 -04:00