diff options
| author | Tom Lane <tgl@sss.pgh.pa.us> | 2015-12-26 12:56:09 -0500 |
|---|---|---|
| committer | Tom Lane <tgl@sss.pgh.pa.us> | 2015-12-26 12:56:09 -0500 |
| commit | 3d2b31e30e2931b3edb5ab9d0eafca13e7bcffe5 (patch) | |
| tree | 5dec95112a845024db94f4647531904397e659b7 /src/test/regress/sql/brin.sql | |
| parent | 8014c44e8275b2fedfc4740c911577c6f1668b56 (diff) | |
| download | postgresql-3d2b31e30e2931b3edb5ab9d0eafca13e7bcffe5.tar.gz | |
Fix brin_summarize_new_values() to check index type and ownership.
brin_summarize_new_values() did not check that the passed OID was for
an index at all, much less that it was a BRIN index, and would fail in
obscure ways if it wasn't (possibly damaging data first?). It also
lacked any permissions test; by analogy to VACUUM, we should only allow
the table's owner to summarize.
Noted by Jeff Janes, fix by Michael Paquier and me
Diffstat (limited to 'src/test/regress/sql/brin.sql')
| -rw-r--r-- | src/test/regress/sql/brin.sql | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/src/test/regress/sql/brin.sql b/src/test/regress/sql/brin.sql index db78d05ff3..9e4836e17e 100644 --- a/src/test/regress/sql/brin.sql +++ b/src/test/regress/sql/brin.sql @@ -416,3 +416,8 @@ VACUUM brintest; -- force a summarization cycle in brinidx UPDATE brintest SET int8col = int8col * int4col; UPDATE brintest SET textcol = '' WHERE textcol IS NOT NULL; + +-- Tests for brin_summarize_new_values +SELECT brin_summarize_new_values('brintest'); -- error, not an index +SELECT brin_summarize_new_values('tenk1_unique1'); -- error, not a BRIN index +SELECT brin_summarize_new_values('brinidx'); -- ok, no change expected |
