aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAmit Kapila <akapila@postgresql.org>2019-02-04 10:08:29 +0530
committerAmit Kapila <akapila@postgresql.org>2019-02-04 10:08:29 +0530
commit08ecdfe7e5e0a31efbe1d58fefbe085b53bc79ca (patch)
tree5b14919a915799c4cbfc74c1fdf0420e189a0a4d
parentb0eaa4c51bbff3e3c600b11e5d104d6feb9ca77f (diff)
downloadpostgresql-08ecdfe7e5e0a31efbe1d58fefbe085b53bc79ca.tar.gz
postgresql-08ecdfe7e5e0a31efbe1d58fefbe085b53bc79ca.zip
Make FSM test portable.
In b0eaa4c51b, we allow FSM to be created only after 4 pages. One of the tests check the FSM contents and to do that it populates many tuples in the relation. The FSM contents depend on the availability of freespace in the page and it could vary because of the alignment of tuples. This commit removes the dependency on FSM contents. Author: Amit Kapila Discussion: https://postgr.es/m/CAA4eK1KADF6K1bagr0--mGv3dMcZ%3DH_Z-Qtvdfbp5PjaC6PJJA%40mail.gmail.com
-rw-r--r--contrib/pageinspect/expected/page.out23
-rw-r--r--contrib/pageinspect/sql/page.sql3
2 files changed, 7 insertions, 19 deletions
diff --git a/contrib/pageinspect/expected/page.out b/contrib/pageinspect/expected/page.out
index 89b73ca9917..74454801f5c 100644
--- a/contrib/pageinspect/expected/page.out
+++ b/contrib/pageinspect/expected/page.out
@@ -35,24 +35,11 @@ ERROR: relation "xxx" does not exist
SELECT octet_length(get_raw_page('test_rel_forks', 'xxx', 0));
ERROR: invalid fork name
HINT: Valid fork names are "main", "fsm", "vm", and "init".
-SELECT * FROM fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0));
- fsm_page_contents
--------------------
- 0: 39 +
- 1: 39 +
- 3: 39 +
- 7: 39 +
- 15: 39 +
- 31: 39 +
- 63: 39 +
- 127: 39 +
- 255: 39 +
- 511: 39 +
- 1023: 39 +
- 2047: 39 +
- 4095: 39 +
- fp_next_slot: 0 +
-
+EXPLAIN (costs off, analyze on, timing off, summary off) SELECT * FROM
+ fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0));
+ QUERY PLAN
+------------------------------------------------------------
+ Function Scan on fsm_page_contents (actual rows=1 loops=1)
(1 row)
SELECT get_raw_page('test_rel_forks', 0) = get_raw_page('test_rel_forks', 'main', 0);
diff --git a/contrib/pageinspect/sql/page.sql b/contrib/pageinspect/sql/page.sql
index 67166ef54c4..e88598a48e7 100644
--- a/contrib/pageinspect/sql/page.sql
+++ b/contrib/pageinspect/sql/page.sql
@@ -22,7 +22,8 @@ SELECT octet_length(get_raw_page('test_rel_forks', 'vm', 1)) AS vm_1;
SELECT octet_length(get_raw_page('xxx', 'main', 0));
SELECT octet_length(get_raw_page('test_rel_forks', 'xxx', 0));
-SELECT * FROM fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0));
+EXPLAIN (costs off, analyze on, timing off, summary off) SELECT * FROM
+ fsm_page_contents(get_raw_page('test_rel_forks', 'fsm', 0));
SELECT get_raw_page('test_rel_forks', 0) = get_raw_page('test_rel_forks', 'main', 0);