This is an automated email from the ASF dual-hosted git repository.

reshke pushed a commit to branch cbdb-postgres-merge
in repository https://gitbox.apache.org/repos/asf/cloudberry.git


The following commit(s) were added to refs/heads/cbdb-postgres-merge by this 
push:
     new b5d2b90925c Fix rebase conflicts in pgstattuple (#1487)
b5d2b90925c is described below

commit b5d2b90925c33ef56fdc057250896673033fd056
Author: reshke <[email protected]>
AuthorDate: Thu Dec 11 12:39:51 2025 +0500

    Fix rebase conflicts in pgstattuple (#1487)
    
    
    
    `make installcheck` succeeds.
    
    rebase with respect to postgres/postgres@37b2764 and 
postgres/postgres@2ed532e
---
 contrib/pgstattuple/pgstatapprox.c |  5 ----
 contrib/pgstattuple/pgstatindex.c  | 24 +--------------
 contrib/pgstattuple/pgstattuple.c  | 60 ++------------------------------------
 3 files changed, 4 insertions(+), 85 deletions(-)

diff --git a/contrib/pgstattuple/pgstatapprox.c 
b/contrib/pgstattuple/pgstatapprox.c
index 450f3671dce..77c660cbd66 100644
--- a/contrib/pgstattuple/pgstatapprox.c
+++ b/contrib/pgstattuple/pgstatapprox.c
@@ -293,14 +293,9 @@ pgstattuple_approx_internal(Oid relid, FunctionCallInfo 
fcinfo)
                  rel->rd_rel->relkind == RELKIND_DIRECTORY_TABLE))
                ereport(ERROR,
                                (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
-<<<<<<< HEAD
-                                errmsg("\"%s\" is not a table, directory 
table, materialized view, or TOAST table",
-                                               RelationGetRelationName(rel))));
-=======
                                 errmsg("relation \"%s\" is of wrong relation 
kind",
                                                RelationGetRelationName(rel)),
                                 
errdetail_relkind_not_supported(rel->rd_rel->relkind)));
->>>>>>> REL_16_9
 
        if (rel->rd_rel->relam != HEAP_TABLE_AM_OID)
                ereport(ERROR, (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
diff --git a/contrib/pgstattuple/pgstatindex.c 
b/contrib/pgstattuple/pgstatindex.c
index 3c5aa0eecea..07c5e26dd34 100644
--- a/contrib/pgstattuple/pgstatindex.c
+++ b/contrib/pgstattuple/pgstatindex.c
@@ -758,26 +758,4 @@ GetHashPageStats(Page page, HashIndexStat *stats)
                        stats->dead_items++;
        }
        stats->free_space += PageGetExactFreeSpace(page);
-}
-<<<<<<< HEAD
-
-/*
- * check_relation_relkind - convenience routine to check that relation
- * is of the relkind supported by the callers
- */
-static void
-check_relation_relkind(Relation rel)
-{
-       if (rel->rd_rel->relkind != RELKIND_RELATION &&
-               rel->rd_rel->relkind != RELKIND_INDEX &&
-               rel->rd_rel->relkind != RELKIND_MATVIEW &&
-               rel->rd_rel->relkind != RELKIND_SEQUENCE &&
-               rel->rd_rel->relkind != RELKIND_TOASTVALUE &&
-               rel->rd_rel->relkind != RELKIND_DIRECTORY_TABLE)
-               ereport(ERROR,
-                               (errcode(ERRCODE_WRONG_OBJECT_TYPE),
-                                errmsg("\"%s\" is not a table, directory 
table, index, materialized view, sequence, or TOAST table",
-                                               RelationGetRelationName(rel))));
-}
-=======
->>>>>>> REL_16_9
+}
\ No newline at end of file
diff --git a/contrib/pgstattuple/pgstattuple.c 
b/contrib/pgstattuple/pgstattuple.c
index 16e97511daa..b577683d555 100644
--- a/contrib/pgstattuple/pgstattuple.c
+++ b/contrib/pgstattuple/pgstattuple.c
@@ -253,63 +253,10 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
                                 errmsg("cannot access temporary tables of 
other sessions")));
 
        if (RELKIND_HAS_TABLE_AM(rel->rd_rel->relkind) ||
-               rel->rd_rel->relkind == RELKIND_SEQUENCE)
+               rel->rd_rel->relkind == RELKIND_SEQUENCE ||
+               /* This is CBDB addons */
+               rel->rd_rel->relkind == RELKIND_DIRECTORY_TABLE)
        {
-<<<<<<< HEAD
-               case RELKIND_RELATION:
-               case RELKIND_MATVIEW:
-               case RELKIND_TOASTVALUE:
-               case RELKIND_SEQUENCE:
-               case RELKIND_AOSEGMENTS:
-               case RELKIND_AOBLOCKDIR:
-               case RELKIND_AOVISIMAP:
-               case RELKIND_DIRECTORY_TABLE:
-                       return pgstat_heap(rel, fcinfo);
-               case RELKIND_INDEX:
-                       switch (rel->rd_rel->relam)
-                       {
-                               case BTREE_AM_OID:
-                                       return pgstat_index(rel, BTREE_METAPAGE 
+ 1,
-                                                                               
pgstat_btree_page, fcinfo);
-                               case HASH_AM_OID:
-                                       return pgstat_index(rel, HASH_METAPAGE 
+ 1,
-                                                                               
pgstat_hash_page, fcinfo);
-                               case GIST_AM_OID:
-                                       return pgstat_index(rel, 
GIST_ROOT_BLKNO + 1,
-                                                                               
pgstat_gist_page, fcinfo);
-                               case GIN_AM_OID:
-                                       err = "gin index";
-                                       break;
-                               case SPGIST_AM_OID:
-                                       err = "spgist index";
-                                       break;
-                               case BRIN_AM_OID:
-                                       err = "brin index";
-                                       break;
-                               default:
-                                       err = "unknown index";
-                                       break;
-                       }
-                       break;
-               case RELKIND_VIEW:
-                       err = "view";
-                       break;
-               case RELKIND_COMPOSITE_TYPE:
-                       err = "composite type";
-                       break;
-               case RELKIND_FOREIGN_TABLE:
-                       err = "foreign table";
-                       break;
-               case RELKIND_PARTITIONED_TABLE:
-                       err = "partitioned table";
-                       break;
-               case RELKIND_PARTITIONED_INDEX:
-                       err = "partitioned index";
-                       break;
-               default:
-                       err = "unknown";
-                       break;
-=======
                return pgstat_heap(rel, fcinfo);
        }
        else if (rel->rd_rel->relkind == RELKIND_INDEX)
@@ -357,7 +304,6 @@ pgstat_relation(Relation rel, FunctionCallInfo fcinfo)
                                 errmsg("cannot get tuple-level statistics for 
relation \"%s\"",
                                                RelationGetRelationName(rel)),
                                 
errdetail_relkind_not_supported(rel->rd_rel->relkind)));
->>>>>>> REL_16_9
        }
 
        return 0;                                       /* should not happen */


---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]

Reply via email to