Skip to content

Commit cdd8452

Browse files
committed
Fix rebase conflicts in pgstattuple
1 parent 256d8d8 commit cdd8452

3 files changed

Lines changed: 4 additions & 85 deletions

File tree

contrib/pgstattuple/pgstatapprox.c

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -293,14 +293,9 @@ pgstattuple_approx_internal(Oid relid, FunctionCallInfo fcinfo)
293293
rel->rd_rel->relkind == RELKIND_DIRECTORY_TABLE))
294294
ereport(ERROR,
295295
(errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
296-
<<<<<<< HEAD
297-
errmsg("\"%s\" is not a table, directory table, materialized view, or TOAST table",
298-
RelationGetRelationName(rel))));
299-
=======
300296
errmsg("relation \"%s\" is of wrong relation kind",
301297
RelationGetRelationName(rel)),
302298
errdetail_relkind_not_supported(rel->rd_rel->relkind)));
303-
>>>>>>> REL_16_9
304299

305300
if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
306301
ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),

contrib/pgstattuple/pgstatindex.c

Lines changed: 1 addition & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -758,26 +758,4 @@ GetHashPageStats(Page page, HashIndexStat *stats)
758758
stats->dead_items++;
759759
}
760760
stats->free_space += PageGetExactFreeSpace(page);
761-
}
762-
<<<<<<< HEAD
763-
764-
/*
765-
* check_relation_relkind - convenience routine to check that relation
766-
* is of the relkind supported by the callers
767-
*/
768-
static void
769-
check_relation_relkind(Relation rel)
770-
{
771-
if (rel->rd_rel->relkind != RELKIND_RELATION &&
772-
rel->rd_rel->relkind != RELKIND_INDEX &&
773-
rel->rd_rel->relkind != RELKIND_MATVIEW &&
774-
rel->rd_rel->relkind != RELKIND_SEQUENCE &&
775-
rel->rd_rel->relkind != RELKIND_TOASTVALUE &&
776-
rel->rd_rel->relkind != RELKIND_DIRECTORY_TABLE)
777-
ereport(ERROR,
778-
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
779-
errmsg("\"%s\" is not a table, directory table, index, materialized view, sequence, or TOAST table",
780-
RelationGetRelationName(rel))));
781-
}
782-
=======
783-
>>>>>>> REL_16_9
761+
}

contrib/pgstattuple/pgstattuple.c

Lines changed: 3 additions & 57 deletions
Original file line numberDiff line numberDiff line change
@@ -253,63 +253,10 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
253253
errmsg("cannot access temporary tables of other sessions")));
254254

255255
if (RELKIND_HAS_TABLE_AM(rel->rd_rel->relkind) ||
256-
rel->rd_rel->relkind == RELKIND_SEQUENCE)
256+
rel->rd_rel->relkind == RELKIND_SEQUENCE ||
257+
/* This is CBDB addons */
258+
rel->rd_rel->relkind == RELKIND_DIRECTORY_TABLE)
257259
{
258-
<<<<<<< HEAD
259-
case RELKIND_RELATION:
260-
case RELKIND_MATVIEW:
261-
case RELKIND_TOASTVALUE:
262-
case RELKIND_SEQUENCE:
263-
case RELKIND_AOSEGMENTS:
264-
case RELKIND_AOBLOCKDIR:
265-
case RELKIND_AOVISIMAP:
266-
case RELKIND_DIRECTORY_TABLE:
267-
return pgstat_heap(rel, fcinfo);
268-
case RELKIND_INDEX:
269-
switch (rel->rd_rel->relam)
270-
{
271-
case BTREE_AM_OID:
272-
return pgstat_index(rel, BTREE_METAPAGE + 1,
273-
pgstat_btree_page, fcinfo);
274-
case HASH_AM_OID:
275-
return pgstat_index(rel, HASH_METAPAGE + 1,
276-
pgstat_hash_page, fcinfo);
277-
case GIST_AM_OID:
278-
return pgstat_index(rel, GIST_ROOT_BLKNO + 1,
279-
pgstat_gist_page, fcinfo);
280-
case GIN_AM_OID:
281-
err = "gin index";
282-
break;
283-
case SPGIST_AM_OID:
284-
err = "spgist index";
285-
break;
286-
case BRIN_AM_OID:
287-
err = "brin index";
288-
break;
289-
default:
290-
err = "unknown index";
291-
break;
292-
}
293-
break;
294-
case RELKIND_VIEW:
295-
err = "view";
296-
break;
297-
case RELKIND_COMPOSITE_TYPE:
298-
err = "composite type";
299-
break;
300-
case RELKIND_FOREIGN_TABLE:
301-
err = "foreign table";
302-
break;
303-
case RELKIND_PARTITIONED_TABLE:
304-
err = "partitioned table";
305-
break;
306-
case RELKIND_PARTITIONED_INDEX:
307-
err = "partitioned index";
308-
break;
309-
default:
310-
err = "unknown";
311-
break;
312-
=======
313260
return pgstat_heap(rel, fcinfo);
314261
}
315262
else if (rel->rd_rel->relkind == RELKIND_INDEX)
@@ -357,7 +304,6 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
357304
errmsg("cannot get tuple-level statistics for relation \"%s\"",
358305
RelationGetRelationName(rel)),
359306
errdetail_relkind_not_supported(rel->rd_rel->relkind)));
360-
>>>>>>> REL_16_9
361307
}
362308

363309
return 0; /* should not happen */

0 commit comments

Comments
 (0)