Skip to content

Commit fd1ac9a

Browse files
committed
Make compression.sql regression test independent of default.
This test will fail in "make installcheck" if the installation's default_toast_compression setting is not 'pglz'. Make it robust against that situation. Dilip Kumar Discussion: https://postgr.es/m/CAFiTN-t0w+Rc2U3S+y=7KWcLuOYNB5MfWeGdNa7+pg0UovVdcQ@mail.gmail.com
1 parent ef82387 commit fd1ac9a

File tree

3 files changed

+10
-0
lines changed

3 files changed

+10
-0
lines changed

src/test/regress/expected/compression.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
\set HIDE_TOAST_COMPRESSION false
2+
-- ensure we get stable results regardless of installation's default
3+
SET default_toast_compression = 'pglz';
24
-- test creating table with compression method
35
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
46
CREATE INDEX idx ON cmdata(f1);
@@ -245,6 +247,7 @@ CREATE TABLE cmdata2 (f1 text);
245247
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
246248
f1 | text | | | | extended | lz4 | |
247249

250+
SET default_toast_compression = 'pglz';
248251
-- test alter compression method
249252
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
250253
INSERT INTO cmdata VALUES (repeat('123456789', 4004));

src/test/regress/expected/compression_1.out

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,6 @@
11
\set HIDE_TOAST_COMPRESSION false
2+
-- ensure we get stable results regardless of installation's default
3+
SET default_toast_compression = 'pglz';
24
-- test creating table with compression method
35
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
46
CREATE INDEX idx ON cmdata(f1);
@@ -241,6 +243,7 @@ CREATE TABLE cmdata2 (f1 text);
241243
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
242244
f1 | text | | | | extended | pglz | |
243245

246+
SET default_toast_compression = 'pglz';
244247
-- test alter compression method
245248
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
246249
ERROR: unsupported LZ4 compression method

src/test/regress/sql/compression.sql

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,8 @@
11
\set HIDE_TOAST_COMPRESSION false
22

3+
-- ensure we get stable results regardless of installation's default
4+
SET default_toast_compression = 'pglz';
5+
36
-- test creating table with compression method
47
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
58
CREATE INDEX idx ON cmdata(f1);
@@ -100,6 +103,7 @@ SET default_toast_compression = 'lz4';
100103
DROP TABLE cmdata2;
101104
CREATE TABLE cmdata2 (f1 text);
102105
\d+ cmdata2
106+
SET default_toast_compression = 'pglz';
103107

104108
-- test alter compression method
105109
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;

0 commit comments

Comments
 (0)