diff options
author | Michael Paquier <michael@paquier.xyz> | 2021-06-07 18:12:29 +0900 |
---|---|---|
committer | Michael Paquier <michael@paquier.xyz> | 2021-06-07 18:12:29 +0900 |
commit | 68a6d8a87006ba727d9662ec84c7a3d9de402df0 (patch) | |
tree | 4c7501c0e349ce6a382f47fe19fbaa94e404bae7 /src | |
parent | be57f21650d36449ec34a67b2d9af71126a663b3 (diff) | |
download | postgresql-68a6d8a87006ba727d9662ec84c7a3d9de402df0.tar.gz postgresql-68a6d8a87006ba727d9662ec84c7a3d9de402df0.zip |
Fix portability issue in test indirect_toast
When run on a server using default_toast_compression set to LZ4, this
test would fail because of a consistency issue with the order of the
tuples treated. LZ4 causes one tuple to be stored inline instead of
getting externalized. As the goal of this test is to check after data
stored externally, stick to pglz as the compression algorithm used, so
as all data of this test is stored the way it should.
Analyzed-by: Dilip Kumar
Discussion: https://postgr.es/m/YLrDWxJgM8WWMoCg@paquier.xyz
Diffstat (limited to 'src')
-rw-r--r-- | src/test/regress/expected/indirect_toast.out | 7 | ||||
-rw-r--r-- | src/test/regress/sql/indirect_toast.sql | 10 |
2 files changed, 17 insertions, 0 deletions
diff --git a/src/test/regress/expected/indirect_toast.out b/src/test/regress/expected/indirect_toast.out index b05173c43bd..ab1fa5e707c 100644 --- a/src/test/regress/expected/indirect_toast.out +++ b/src/test/regress/expected/indirect_toast.out @@ -1,3 +1,9 @@ +-- +-- Tests for external toast datums +-- +-- Other compression algorithms may cause the compressed data to be stored +-- inline. pglz guarantees that the data is externalized, so stick to it. +SET default_toast_compression = 'pglz'; CREATE TABLE indtoasttest(descr text, cnt int DEFAULT 0, f1 text, f2 text); INSERT INTO indtoasttest(descr, f1, f2) VALUES('two-compressed', repeat('1234567890',1000), repeat('1234567890',1000)); INSERT INTO indtoasttest(descr, f1, f2) VALUES('two-toasted', repeat('1234567890',30000), repeat('1234567890',50000)); @@ -149,3 +155,4 @@ SELECT substring(indtoasttest::text, 1, 200) FROM indtoasttest; DROP TABLE indtoasttest; DROP FUNCTION update_using_indirect(); +RESET default_toast_compression; diff --git a/src/test/regress/sql/indirect_toast.sql b/src/test/regress/sql/indirect_toast.sql index efb1eb4e2fb..9156a44b7d9 100644 --- a/src/test/regress/sql/indirect_toast.sql +++ b/src/test/regress/sql/indirect_toast.sql @@ -1,3 +1,11 @@ +-- +-- Tests for external toast datums +-- + +-- Other compression algorithms may cause the compressed data to be stored +-- inline. pglz guarantees that the data is externalized, so stick to it. +SET default_toast_compression = 'pglz'; + CREATE TABLE indtoasttest(descr text, cnt int DEFAULT 0, f1 text, f2 text); INSERT INTO indtoasttest(descr, f1, f2) VALUES('two-compressed', repeat('1234567890',1000), repeat('1234567890',1000)); @@ -59,3 +67,5 @@ SELECT substring(indtoasttest::text, 1, 200) FROM indtoasttest; DROP TABLE indtoasttest; DROP FUNCTION update_using_indirect(); + +RESET default_toast_compression; |