mirror of
https://github.com/postgres/postgres.git
synced 2025-05-05 09:19:17 +03:00
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
This commit is contained in:
parent
ef82387384
commit
fd1ac9a548
@ -1,4 +1,6 @@
|
|||||||
\set HIDE_TOAST_COMPRESSION false
|
\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
|
-- test creating table with compression method
|
||||||
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
|
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
|
||||||
CREATE INDEX idx ON cmdata(f1);
|
CREATE INDEX idx ON cmdata(f1);
|
||||||
@ -245,6 +247,7 @@ CREATE TABLE cmdata2 (f1 text);
|
|||||||
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
|
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
|
||||||
f1 | text | | | | extended | lz4 | |
|
f1 | text | | | | extended | lz4 | |
|
||||||
|
|
||||||
|
SET default_toast_compression = 'pglz';
|
||||||
-- test alter compression method
|
-- test alter compression method
|
||||||
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
|
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
|
||||||
INSERT INTO cmdata VALUES (repeat('123456789', 4004));
|
INSERT INTO cmdata VALUES (repeat('123456789', 4004));
|
||||||
|
@ -1,4 +1,6 @@
|
|||||||
\set HIDE_TOAST_COMPRESSION false
|
\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
|
-- test creating table with compression method
|
||||||
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
|
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
|
||||||
CREATE INDEX idx ON cmdata(f1);
|
CREATE INDEX idx ON cmdata(f1);
|
||||||
@ -241,6 +243,7 @@ CREATE TABLE cmdata2 (f1 text);
|
|||||||
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
|
--------+------+-----------+----------+---------+----------+-------------+--------------+-------------
|
||||||
f1 | text | | | | extended | pglz | |
|
f1 | text | | | | extended | pglz | |
|
||||||
|
|
||||||
|
SET default_toast_compression = 'pglz';
|
||||||
-- test alter compression method
|
-- test alter compression method
|
||||||
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
|
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
|
||||||
ERROR: unsupported LZ4 compression method
|
ERROR: unsupported LZ4 compression method
|
||||||
|
@ -1,5 +1,8 @@
|
|||||||
\set HIDE_TOAST_COMPRESSION false
|
\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
|
-- test creating table with compression method
|
||||||
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
|
CREATE TABLE cmdata(f1 text COMPRESSION pglz);
|
||||||
CREATE INDEX idx ON cmdata(f1);
|
CREATE INDEX idx ON cmdata(f1);
|
||||||
@ -100,6 +103,7 @@ SET default_toast_compression = 'lz4';
|
|||||||
DROP TABLE cmdata2;
|
DROP TABLE cmdata2;
|
||||||
CREATE TABLE cmdata2 (f1 text);
|
CREATE TABLE cmdata2 (f1 text);
|
||||||
\d+ cmdata2
|
\d+ cmdata2
|
||||||
|
SET default_toast_compression = 'pglz';
|
||||||
|
|
||||||
-- test alter compression method
|
-- test alter compression method
|
||||||
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
|
ALTER TABLE cmdata ALTER COLUMN f1 SET COMPRESSION lz4;
|
||||||
|
Loading…
x
Reference in New Issue
Block a user