Make compression.sql regression test independent of default.
authorTom Lane <[email protected]>
Sun, 21 Mar 2021 20:26:44 +0000 (16:26 -0400)
committerTom Lane <[email protected]>
Sun, 21 Mar 2021 20:26:44 +0000 (16:26 -0400)
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

src/test/regress/expected/compression.out
src/test/regress/expected/compression_1.out
src/test/regress/sql/compression.sql

index 3de2886de07a7a1f66230c68bb6f0dfea1dfa9c8..18ac5f05bbddb9f4a5db184fd038e913ba8c7170 100644 (file)
@@ -1,4 +1,6 @@
 \set HIDE_TOAST_COMPRESSION false
+-- ensure we get stable results regardless of installation's default
+SET default_toast_compression = 'pglz';
 -- test creating table with compression method
 CREATE TABLE cmdata(f1 text COMPRESSION pglz);
 CREATE INDEX idx ON cmdata(f1);
@@ -245,6 +247,7 @@ CREATE TABLE cmdata2 (f1 text);
 --------+------+-----------+----------+---------+----------+-------------+--------------+-------------
  f1     | text |           |          |         | extended | lz4         |              | 
 
+SET default_toast_compression = 'pglz';
 -- test alter compression method
 ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
 INSERT INTO cmdata VALUES (repeat('123456789', 4004));
index 40aad81fa1a83ae673c3debc06f973a2708a8347..c4a2cea4cd8e637a5fc5b8ce4d4c86015075fd3a 100644 (file)
@@ -1,4 +1,6 @@
 \set HIDE_TOAST_COMPRESSION false
+-- ensure we get stable results regardless of installation's default
+SET default_toast_compression = 'pglz';
 -- test creating table with compression method
 CREATE TABLE cmdata(f1 text COMPRESSION pglz);
 CREATE INDEX idx ON cmdata(f1);
@@ -241,6 +243,7 @@ CREATE TABLE cmdata2 (f1 text);
 --------+------+-----------+----------+---------+----------+-------------+--------------+-------------
  f1     | text |           |          |         | extended | pglz        |              | 
 
+SET default_toast_compression = 'pglz';
 -- test alter compression method
 ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
 ERROR:  unsupported LZ4 compression method
index d97e26b6ee3b9c44bcc7b3a0d8ba7a115dbd1d9d..e23669cc94cd3ccbb91d7b4887b5d64860fc3aa9 100644 (file)
@@ -1,5 +1,8 @@
 \set HIDE_TOAST_COMPRESSION false
 
+-- ensure we get stable results regardless of installation's default
+SET default_toast_compression = 'pglz';
+
 -- test creating table with compression method
 CREATE TABLE cmdata(f1 text COMPRESSION pglz);
 CREATE INDEX idx ON cmdata(f1);
@@ -100,6 +103,7 @@ SET default_toast_compression = 'lz4';
 DROP TABLE cmdata2;
 CREATE TABLE cmdata2 (f1 text);
 \d+ cmdata2
+SET default_toast_compression = 'pglz';
 
 -- test alter compression method
 ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;