66 Commits

Author SHA1 Message Date
Daniele Varrazzo
9c1da1bff1 Fixed tests to match info messages including the public schema 2018-05-19 16:41:56 +01:00
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
a0fe223f8b Forgot to add expected files of regression tests. 2018-03-09 11:00:42 +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
d7b4e75c10 PG 10 expected test result fixed with changes added in 1.4.1 2017-09-25 02:53:11 +01:00
Daniele Varrazzo
7413a65985 Merge remote-tracking branch 'origin/master' into pg10 2017-09-25 02:45:49 +01:00
Daniele Varrazzo
f996fd8fb3 Allow building with PostgreSQL 10rc1
This is what we get:

    $ pg_config --version
    PostgreSQL 10rc1
2017-09-25 02:33:13 +01:00
Masahiko Sawada
f8ba09fd31 Get rid of unnecessary lines in expected file. 2017-08-05 02:49:56 +09: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
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