Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Comparing changes

Choose two branches to see what's changed or to start a new pull request. If you need to, you can also compare across forks.

Open a pull request

Create a new pull request by comparing changes across two branches. If you need to, you can also compare across forks.
...
Checking mergeability… Don't worry, you can still create the pull request.
  • 2 commits
  • 8 files changed
  • 0 commit comments
  • 1 contributor
View
2  Makefile
@@ -1,5 +1,5 @@
MODULE_big = pg_check
-OBJS = src/pg_check.o src/common.o src/heap.o src/index.o
+OBJS = src/pg_check.o src/common.o src/heap.o src/index.o src/item-bitmap.o
EXTENSION = pg_check
DATA = sql/pg_check--0.1.0.sql
View
4 sql/pg_check--0.1.0.sql
@@ -5,12 +5,12 @@ SET search_path = public;
-- pg_check_table()
--
-CREATE OR REPLACE FUNCTION pg_check_table(table_relation regclass, check_indexes bool)
+CREATE OR REPLACE FUNCTION pg_check_table(table_relation regclass, check_indexes bool, cross_check bool)
RETURNS int4
AS '$libdir/pg_check', 'pg_check_table'
LANGUAGE C STRICT;
-COMMENT ON FUNCTION pg_check_table(regclass, bool) IS 'checks consistency of the whole table (and optionally all indexes on it)';
+COMMENT ON FUNCTION pg_check_table(regclass, bool, bool) IS 'checks consistency of the whole table (and optionally all indexes on it)';
CREATE OR REPLACE FUNCTION pg_check_table(table_relation regclass, block_start bigint, block_end bigint)
RETURNS int4
View
4 src/index.c
@@ -104,7 +104,11 @@ uint32 check_index_tuples(Relation rel, PageHeader header, char *buffer, int blo
ereport(DEBUG1, (errmsg("[%d] max number of tuples = %d", block, ntuples)));
+ /* FIXME check btpo_flags (BTP_LEAF, BTP_ROOT, BTP_DELETED, BTP_META, BTP_HALF_DEAD,
+ * BTP_SPLIT_END and BTP_HAS_GARBAGE) and act accordingly */
+
for (i = 0; i < ntuples; i++) {
+ /* FIXME this should check lp_flags, just as the heap check */
nerrs += check_index_tuple(rel, header, block, i, buffer);
}
View
261 src/item-bitmap.c
@@ -0,0 +1,261 @@
+#include "item-bitmap.h"
+
+#include <unistd.h>
+
+#include "access/itup.h"
+
+/* allocate the memory in 1kB chunks */
+#define PALLOC_CHUNK 1024
+
+/* allocate the bitmap (~4.5MB for each 1GB of heap) */
+item_bitmap * bitmap_alloc(int npages) {
+
+ item_bitmap * bitmap = (item_bitmap*)palloc(sizeof(item_bitmap));
+
+ bitmap->npages = npages;
+ bitmap->pages = (int*)palloc(sizeof(int)*npages);
+
+ bitmap->nbytes = 0;
+ bitmap->maxBytes = PALLOC_CHUNK;
+ bitmap->data = (char*)palloc(PALLOC_CHUNK);
+
+ return bitmap;
+
+}
+
+/* allocate the bitmap (~4.5MB for each 1GB of heap) */
+item_bitmap * bitmap_prealloc(item_bitmap * src) {
+
+ item_bitmap * bitmap = (item_bitmap*)palloc(sizeof(item_bitmap));
+
+ bitmap->npages = src->npages;
+
+ bitmap->nbytes = src->nbytes;
+ bitmap->maxBytes = src->maxBytes;
+
+ bitmap->pages = (int*)palloc(sizeof(int)*src->npages);
+ memcpy(bitmap->pages, src->pages, sizeof(int)*src->npages);
+
+ bitmap->data = (char*)palloc(src->maxBytes);
+ memset(bitmap->data, 0, src->maxBytes);
+
+ return bitmap;
+
+}
+
+void bitmap_reset(item_bitmap* bitmap) {
+ memset(bitmap->data, 0, bitmap->maxBytes);
+}
+
+void bitmap_free(item_bitmap* bitmap) {
+ pfree(bitmap->pages);
+ pfree(bitmap->data);
+ pfree(bitmap);
+}
+
+/* needs to be called for paged 0,1,2,3,...npages (not randomly) */
+/* extends the bitmap to handle another page */
+void bitmap_add_page(item_bitmap * bitmap, int page, int items) {
+
+ bitmap->pages[page] = (page == 0) ? items : (items + bitmap->pages[page-1]);
+
+ /* if needed more bytes than */
+ bitmap->nbytes = ((bitmap->pages[page] + 7) / 8);
+ if (bitmap->nbytes > bitmap->maxBytes) {
+ bitmap->maxBytes += PALLOC_CHUNK;
+ bitmap->data = (char*)repalloc(bitmap->data, bitmap->maxBytes);
+ }
+
+}
+
+/* update the bitmap bith all items from a page (tracks number of items) */
+int bitmap_add_heap_items(item_bitmap * bitmap, PageHeader header, char *raw_page, int page) {
+
+ /* tuple checks */
+ int nerrs = 0;
+ int ntuples = PageGetMaxOffsetNumber(raw_page);
+ int item;
+
+ bitmap_add_page(bitmap, page, ntuples);
+
+ /* by default set all LP_REDIRECT / LP_NORMAL items to '1' (we'll remove the HOT chains in the second pass) */
+ /* FIXME what if there is a HOT chain and then an index is created? */
+ for (item = 0; item < ntuples; item++) {
+ if ((header->pd_linp[item].lp_flags == LP_NORMAL) || (header->pd_linp[item].lp_flags == LP_REDIRECT)) {
+ if (! bitmap_set_item(bitmap, page, item, true)) {
+ nerrs++;
+ }
+ }
+ }
+
+ /* second pass - remove the HOT chains */
+ for (item = 0; item < ntuples; item++) {
+
+ if (header->pd_linp[item].lp_flags == LP_REDIRECT) {
+ /* walk only if not walked this HOT chain yet (skip the first item in the chain) */
+ if (bitmap_get_item(bitmap, page, item)) {
+ int next = item;
+ do {
+ next = header->pd_linp[next].lp_off;
+ if (! bitmap_set_item(bitmap, page, next, false)) {
+ nerrs++;
+ }
+ } while (header->pd_linp[next].lp_flags != LP_REDIRECT);
+ }
+ }
+
+ }
+
+ return nerrs;
+
+}
+
+/* checks index tuples on the page, one by one */
+int bitmap_add_index_items(item_bitmap * bitmap, PageHeader header, char *raw_page, int page) {
+
+ /* tuple checks */
+ int nerrs = 0;
+ int ntuples = PageGetMaxOffsetNumber(raw_page);
+ int item;
+
+ for (item = 0; item < ntuples; item++) {
+
+ IndexTuple itup = (IndexTuple)(raw_page + header->pd_linp[item].lp_off);
+ if (! bitmap_set_item(bitmap, BlockIdGetBlockNumber(&(itup->t_tid.ip_blkid)), (itup->t_tid.ip_posid-1), true)) {
+ nerrs++;
+ }
+
+ }
+
+ return nerrs;
+
+}
+
+/* mark the (page,item) as occupied */
+bool bitmap_set_item(item_bitmap * bitmap, int page, int item, bool state) {
+
+ int byteIdx = (GetBitmapIndex(bitmap, page, item)) / 8;
+ int bitIdx = (GetBitmapIndex(bitmap, page, item)) % 8;
+
+ if (page >= bitmap->npages) {
+ elog(WARNING, "invalid page %d (max page %d)", page, bitmap->npages-1);
+ return false;
+ }
+
+ if (byteIdx > bitmap->nbytes) {
+ elog(WARNING, "invalid byte %d (max byte %d)", byteIdx, bitmap->nbytes);
+ return false;
+ }
+
+ if (item >= bitmap->pages[page]) {
+ elog(WARNING, "item %d out of range, page has only %d items", item, bitmap->pages[page]);
+ return false;
+ }
+
+ if (state) {
+ /* set the bit (OR) */
+ bitmap->data[byteIdx] |= (1 << bitIdx);
+ } else {
+ /* remove the bit (XOR) */
+ bitmap->data[byteIdx] &= ~(1 << bitIdx);
+ }
+
+ return true;
+
+}
+
+/* check if the (page,item) is occupied */
+bool bitmap_get_item(item_bitmap * bitmap, int page, int item) {
+
+ int byteIdx = (GetBitmapIndex(bitmap, page, item)) / 8;
+ int bitIdx = (GetBitmapIndex(bitmap, page, item)) % 8;
+
+ if (page >= bitmap->npages) {
+ elog(WARNING, "invalid page %d (max page %d)", page, bitmap->npages-1);
+ return false;
+ }
+
+ if (byteIdx > bitmap->nbytes) {
+ elog(WARNING, "invalid byte %d (max byte %d)", byteIdx, bitmap->nbytes);
+ return false;
+ }
+
+ if (item >= bitmap->pages[page]) {
+ elog(WARNING, "item %d out of range, page has only %d items", item, bitmap->pages[page]);
+ return false;
+ }
+
+ return (bitmap->data[byteIdx] && (1 << bitIdx));
+
+}
+
+/* counts bits set to 1 in the bitmap */
+long bitmap_count(item_bitmap * bitmap) {
+
+ long i, j, items = 0;
+
+ for (i = 0; i < bitmap->nbytes; i++) {
+ for (j = 0; j < 8; j++) {
+ if (bitmap->data[i] & (1 << j)) {
+ items++;
+ }
+ }
+ }
+
+ return items;
+
+}
+
+/* compare bitmaps, returns number of differences */
+long bitmap_compare(item_bitmap * bitmap_a, item_bitmap * bitmap_b) {
+
+ long i, j, ndiff = 0;
+ char diff = 0;
+
+ /* compare number of pages and total items */
+ /* FIXME this rather a sanity check, because these values are copied by bitmap_prealloc */
+ if (bitmap_a->npages != bitmap_b->npages) {
+ elog(WARNING, "bitmaps do not track the same number of pages (%d != %d)",
+ bitmap_a->npages, bitmap_b->npages);
+ return MAX(bitmap_a->pages[bitmap_a->npages-1],
+ bitmap_b->pages[bitmap_b->npages-1]);
+ } else if (bitmap_a->pages[bitmap_a->npages-1] != bitmap_b->pages[bitmap_b->npages-1]) {
+ elog(WARNING, "bitmaps do not track the same number of pages (%d != %d)",
+ bitmap_a->pages[bitmap_a->npages-1], bitmap_b->pages[bitmap_b->npages-1]);
+ }
+
+ /* the actual check, compares the bits one by one */
+ for (i = 0; i < bitmap_a->nbytes; i++) {
+ diff = (bitmap_a->data[i] ^ bitmap_b->data[i]);
+ if (diff != 0) {
+ for (j = 0; j < 8; j++) {
+ if (diff & (1 << j)) {
+ ndiff++;
+ }
+ }
+ }
+ }
+
+ return ndiff;
+
+}
+
+/* print the bitmap (for debugging purposes) */
+/* TODO print details about differences (items missing in heap, items missing in index) */
+void bitmap_print(item_bitmap * bitmap) {
+
+ int i, j, k = 0;
+ char str[bitmap->nbytes*8+1];
+
+ for (i = 0; i < bitmap->nbytes; i++) {
+ for (j = 0; j < 8; j++) {
+ if (bitmap->data[i] & (1 << j)) {
+ str[k++] = '1';
+ } else {
+ str[k++] = '0';
+ }
+ }
+ }
+ str[k++] = 0;
+ elog(WARNING, "bitmap [%s]", str);
+}
View
59 src/item-bitmap.h
@@ -0,0 +1,59 @@
+#ifndef HBITMAP_CHECK_H
+#define HBITMAP_CHECK_H
+
+#include "postgres.h"
+#include "access/heapam.h"
+
+#define GetBitmapIndex(bmap, page, item) \
+ ((page == 0) ? (item) : (bmap->pages[page-1] + item))
+
+#define MAX(a,b) ((a > b) ? a : b)
+
+/* bitmap, used to cross-check heap and indexes */
+typedef struct item_bitmap {
+
+ /* current number of tracked pages */
+ int npages;
+
+ int nbytes; /* used bytes */
+ int maxBytes; /* allocated bytes */
+
+ /* running sum of items on a page, e.g. [10, 20, 30] if
+ there are three pages and there are 10 items on each */
+ int * pages;
+
+ /* data of the bitmap (0/1 for each item) */
+ char * data;
+
+} item_bitmap;
+
+
+/* allocate the bitmap (~4.5MB for each 1GB of heap) */
+item_bitmap * bitmap_alloc(int npages);
+item_bitmap * bitmap_prealloc(item_bitmap* src); /* preallocate empty bitmap */
+void bitmap_free(item_bitmap* bitmap);
+
+void bitmap_reset(item_bitmap* bitmap);
+
+/* extends the bitmap to handle another page */
+void bitmap_add_page(item_bitmap * bitmap, int page, int items);
+
+/* update the bitmap with all items from the table */
+int bitmap_add_heap_items(item_bitmap * bitmap, PageHeader header, char *raw_page, int page);
+int bitmap_add_index_items(item_bitmap * bitmap, PageHeader header, char *raw_page, int page);
+
+/* mark the (page,item) as occupied */
+bool bitmap_set_item(item_bitmap * bitmap, int page, int item, bool state);
+
+/* check if the (page,item) is occupied */
+bool bitmap_get_item(item_bitmap * bitmap, int page, int item);
+
+/* count bits set in the bitmap */
+long bitmap_count(item_bitmap * bitmap);
+
+/* compare bitmaps, returns number of differences */
+long bitmap_compare(item_bitmap * bitmap_a, item_bitmap * bitmap_b);
+
+void bitmap_print(item_bitmap * bitmap);
+
+#endif /* HEAP_CHECK_H */
View
76 src/pg_check.c
@@ -12,6 +12,7 @@
#include "postgres.h"
#include "access/itup.h"
+#include "access/nbtree.h"
#include "catalog/namespace.h"
#include "catalog/pg_class.h"
#include "funcapi.h"
@@ -24,6 +25,9 @@
#include "common.h"
#include "index.h"
#include "heap.h"
+#include "item-bitmap.h"
+
+#define BTPageGetOpaque(page) ((BTPageOpaque) PageGetSpecialPointer(page))
PG_MODULE_MAGIC;
@@ -33,11 +37,11 @@ Datum pg_check_table_pages(PG_FUNCTION_ARGS);
Datum pg_check_index(PG_FUNCTION_ARGS);
Datum pg_check_index_pages(PG_FUNCTION_ARGS);
-static uint32 check_table(Oid relid, bool checkIndexes, BlockNumber blockFrom, BlockNumber blockTo, bool blockRangeGiven);
+static uint32 check_table(Oid relid, bool checkIndexes, bool crossCheckIndexes, BlockNumber blockFrom, BlockNumber blockTo, bool blockRangeGiven);
static uint32 check_index(Oid indexOid, BlockNumber blockFrom, BlockNumber blockTo, bool blockRangeGiven);
-static uint32 check_index_oid(Oid indexOid);
+static uint32 check_index_oid(Oid indexOid, item_bitmap * bitmap);
/*
* pg_check_table
@@ -51,9 +55,10 @@ pg_check_table(PG_FUNCTION_ARGS)
{
Oid relid = PG_GETARG_OID(0);
bool checkIndexes = PG_GETARG_BOOL(1);
+ bool crossCheckIndexes = PG_GETARG_BOOL(2);
uint32 nerrs;
- nerrs = check_table(relid, checkIndexes, 0, 0, false);
+ nerrs = check_table(relid, checkIndexes, crossCheckIndexes, 0, 0, false);
PG_RETURN_INT32(nerrs);
}
@@ -81,7 +86,7 @@ pg_check_table_pages(PG_FUNCTION_ARGS)
ereport(ERROR,
(errmsg("invalid ending block number")));
- nerrs = check_table(relid, false,
+ nerrs = check_table(relid, false, false,
(BlockNumber) blkfrom, (BlockNumber) blkto,
true);
@@ -138,17 +143,21 @@ pg_check_index_pages(PG_FUNCTION_ARGS)
* check the table, acquires AccessShareLock
*/
static uint32
-check_table(Oid relid, bool checkIndexes,
+check_table(Oid relid, bool checkIndexes, bool crossCheckIndexes,
BlockNumber blockFrom, BlockNumber blockTo, bool blockRangeGiven)
{
Relation rel; /* relation for the 'relname' */
char *raw_page; /* raw data of the page */
Buffer buf; /* buffer the page is read into */
- uint32 nerrs = 0; /* number of errors found */
+ uint32 nerrs = 0; /* number of errors found */
BlockNumber blkno; /* current block */
PageHeader header; /* page header */
BufferAccessStrategy strategy; /* bulk strategy to avoid polluting cache */
+ /* used to cross-check heap and indexes */
+ bool bitmap_build = false; /* true only when block range not given */
+ item_bitmap *bitmap_heap = NULL; /* bitmap data */
+
if (!superuser())
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
@@ -175,6 +184,13 @@ check_table(Oid relid, bool checkIndexes,
{
blockFrom = 0;
blockTo = RelationGetNumberOfBlocks(rel);
+
+ /* build the bitmap only when we need to cross-check */
+ if (crossCheckIndexes) {
+ /* FIXME this needs exclusive lock on the relation (and indexes) */
+ bitmap_build = true;
+ bitmap_heap = bitmap_alloc(blockTo);
+ }
}
strategy = GetAccessStrategy(BAS_BULKREAD);
@@ -198,22 +214,60 @@ check_table(Oid relid, bool checkIndexes,
/* FIXME Does that make sense to check the tuples if the page header is corrupted? */
nerrs += check_heap_tuples(rel, header, raw_page, blkno);
+
+ /* update the bitmap with items from this page (but only when needed) */
+ if (bitmap_build) {
+ bitmap_add_heap_items(bitmap_heap, header, raw_page, blkno);
+ }
+
}
/* check indexes */
if (checkIndexes) {
List *list_of_indexes;
ListCell *index;
+
+ item_bitmap * bitmap_idx = NULL;
+
+ if (bitmap_build) {
+ bitmap_idx = bitmap_prealloc(bitmap_heap);
+ }
list_of_indexes = RelationGetIndexList(rel);
foreach(index, list_of_indexes) {
- nerrs += check_index_oid(lfirst_oid(index));
+
+ /* reset the bitmap (if needed) */
+ if (bitmap_build) {
+ bitmap_reset(bitmap_idx);
+ }
+
+ nerrs += check_index_oid(lfirst_oid(index), bitmap_idx);
+
+ /* evaluate the bitmap difference (if needed) */
+ if (bitmap_build) {
+ /* compare the bitmaps */
+ int n = bitmap_compare(bitmap_heap, bitmap_idx);
+ if (n != 0) {
+ elog(WARNING, "there are %d differences between the table and the index", n);
+ }
+ nerrs += n;
+ }
+
+ }
+
+ if (bitmap_build) {
+ bitmap_free(bitmap_idx);
}
list_free(list_of_indexes);
}
+ /* release the the heap bitmap */
+ if (bitmap_build) {
+ bitmap_free(bitmap_heap);
+ }
+
FreeAccessStrategy(strategy);
relation_close(rel, AccessShareLock);
@@ -230,7 +284,7 @@ check_table(Oid relid, bool checkIndexes,
* only a part of the index.
*/
static uint32
-check_index_oid(Oid indexOid)
+check_index_oid(Oid indexOid, item_bitmap * bitmap)
{
Relation rel; /* relation for the 'relname' */
char *raw_page; /* raw data of the page */
@@ -293,6 +347,12 @@ check_index_oid(Oid indexOid)
/* FIXME Does that make sense to check the tuples if the page header is corrupted? */
nerrs += check_index_tuples(rel, header, raw_page, blkno);
+ /* if this is a leaf page (containing actual pointers to the heap),
+ then update the bitmap */
+ if ((bitmap != NULL) && P_ISLEAF(BTPageGetOpaque(raw_page))) {
+ nerrs += bitmap_add_index_items(bitmap, header, raw_page, blkno);
+ }
+
}
}
View
20 test/expected/pg_check.out
@@ -6,13 +6,13 @@ CREATE TABLE test_table (
);
INSERT INTO test_table SELECT NULL FROM generate_series(1,10000) s(i);
CREATE INDEX test_table_index ON test_table (id);
-SELECT pg_check_table('test_table', false);
+SELECT pg_check_table('test_table', false, false);
pg_check_table
----------------
0
(1 row)
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', true, true);
NOTICE: checking index: test_table_index
pg_check_table
----------------
@@ -26,13 +26,13 @@ CREATE TABLE test_table (
);
NOTICE: CREATE TABLE / PRIMARY KEY will create implicit index "test_table_pkey" for table "test_table"
INSERT INTO test_table SELECT i FROM generate_series(1,10000) s(i);
-SELECT pg_check_table('test_table', false);
+SELECT pg_check_table('test_table', false, false);
pg_check_table
----------------
0
(1 row)
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', true, true);
NOTICE: checking index: test_table_pkey
pg_check_table
----------------
@@ -51,13 +51,13 @@ INSERT INTO test_table SELECT i, NULL, NULL FROM generate_series(1,10000) s(i);
CREATE INDEX test_table_a_index ON test_table (val_a);
CREATE INDEX test_table_b_index ON test_table (val_b);
CREATE INDEX test_table_ab_index ON test_table (val_a, val_b);
-SELECT pg_check_table('test_table', false);
+SELECT pg_check_table('test_table', false, false);
pg_check_table
----------------
0
(1 row)
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', true, true);
NOTICE: checking index: test_table_pkey
NOTICE: checking index: test_table_a_index
NOTICE: checking index: test_table_b_index
@@ -79,13 +79,13 @@ INSERT INTO test_table SELECT i, substr(md5(i::text), 0, floor(random()*10)::int
CREATE INDEX test_table_a_index ON test_table (val_a);
CREATE INDEX test_table_b_index ON test_table (val_b);
CREATE INDEX test_table_ab_index ON test_table (val_a, val_b);
-SELECT pg_check_table('test_table', false);
+SELECT pg_check_table('test_table', false, false);
pg_check_table
----------------
0
(1 row)
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', true, true);
NOTICE: checking index: test_table_pkey
NOTICE: checking index: test_table_a_index
NOTICE: checking index: test_table_b_index
@@ -107,13 +107,13 @@ INSERT INTO test_table SELECT i, NULL, substr(md5(i::text), 0, floor(random()*10
CREATE INDEX test_table_a_index ON test_table (val_a);
CREATE INDEX test_table_b_index ON test_table (val_b);
CREATE INDEX test_table_ab_index ON test_table (val_a, val_b);
-SELECT pg_check_table('test_table', false);
+SELECT pg_check_table('test_table', false, false);
pg_check_table
----------------
0
(1 row)
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', true, true);
NOTICE: checking index: test_table_pkey
NOTICE: checking index: test_table_a_index
NOTICE: checking index: test_table_b_index
View
20 test/sql/pg_check.sql
@@ -11,8 +11,8 @@ INSERT INTO test_table SELECT NULL FROM generate_series(1,10000) s(i);
CREATE INDEX test_table_index ON test_table (id);
-SELECT pg_check_table('test_table', false);
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', false, false);
+SELECT pg_check_table('test_table', true, true);
DROP TABLE test_table;
@@ -23,8 +23,8 @@ CREATE TABLE test_table (
INSERT INTO test_table SELECT i FROM generate_series(1,10000) s(i);
-SELECT pg_check_table('test_table', false);
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', false, false);
+SELECT pg_check_table('test_table', true, true);
DROP TABLE test_table;
@@ -41,8 +41,8 @@ CREATE INDEX test_table_a_index ON test_table (val_a);
CREATE INDEX test_table_b_index ON test_table (val_b);
CREATE INDEX test_table_ab_index ON test_table (val_a, val_b);
-SELECT pg_check_table('test_table', false);
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', false, false);
+SELECT pg_check_table('test_table', true, true);
DROP TABLE test_table;
@@ -59,8 +59,8 @@ CREATE INDEX test_table_a_index ON test_table (val_a);
CREATE INDEX test_table_b_index ON test_table (val_b);
CREATE INDEX test_table_ab_index ON test_table (val_a, val_b);
-SELECT pg_check_table('test_table', false);
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', false, false);
+SELECT pg_check_table('test_table', true, true);
DROP TABLE test_table;
@@ -77,8 +77,8 @@ CREATE INDEX test_table_a_index ON test_table (val_a);
CREATE INDEX test_table_b_index ON test_table (val_b);
CREATE INDEX test_table_ab_index ON test_table (val_a, val_b);
-SELECT pg_check_table('test_table', false);
-SELECT pg_check_table('test_table', true);
+SELECT pg_check_table('test_table', false, false);
+SELECT pg_check_table('test_table', true, true);
DROP TABLE test_table;

No commit comments for this range

Something went wrong with that request. Please try again.