This is an automated email from the ASF dual-hosted git repository.
chenjinbao1989 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 7ce9adb3b92 Fix compile errors for catalog
7ce9adb3b92 is described below
commit 7ce9adb3b92c689149a21dfc6525ae13ae7d191e
Author: Jinbao Chen <[email protected]>
AuthorDate: Thu Oct 2 21:25:12 2025 +0800
Fix compile errors for catalog
---
src/backend/catalog/aclchk.c | 66 ++--------------------
src/backend/catalog/catalog.c | 6 +-
src/backend/catalog/heap.c | 5 +-
src/backend/catalog/index.c | 11 ++--
src/backend/catalog/indexing.c | 2 +-
src/backend/catalog/objectaddress.c | 11 ++--
src/backend/catalog/pg_extprotocol.c | 2 +-
src/backend/catalog/pg_proc.c | 15 +----
src/backend/catalog/storage.c | 16 +++---
src/backend/catalog/storage_directory_table.c | 6 +-
src/backend/utils/error/elog.c | 3 +-
src/include/catalog/gp_matview_tables.h | 6 +-
src/include/catalog/gp_segment_configuration.h | 3 +
.../catalog/gp_segment_configuration_indexing.h | 3 -
src/include/catalog/gp_storage_user_mapping.h | 6 +-
src/include/catalog/gp_warehouse.h | 6 +-
src/include/catalog/heap.h | 7 ---
src/include/catalog/index.h | 2 +-
src/include/catalog/pg_attrdef.h | 11 ++--
src/include/catalog/pg_password_history.h | 6 +-
src/include/catalog/pg_profile.h | 9 +--
src/include/catalog/pg_tag_description.h | 9 +--
src/include/catalog/pg_task.h | 6 +-
src/include/catalog/pg_task_run_history.h | 6 +-
src/include/commands/tablecmds.h | 3 +-
src/include/utils/elog.h | 2 +-
26 files changed, 67 insertions(+), 161 deletions(-)
diff --git a/src/backend/catalog/aclchk.c b/src/backend/catalog/aclchk.c
index 1b62530d92e..a573ebfd95f 100644
--- a/src/backend/catalog/aclchk.c
+++ b/src/backend/catalog/aclchk.c
@@ -302,6 +302,7 @@ restrict_and_check_grant(bool is_grant, AclMode
avail_goptions, bool all_privs,
break;
case OBJECT_EXTPROTOCOL:
whole_mask = ACL_ALL_RIGHTS_EXTPROTOCOL;
+ break;
case OBJECT_PARAMETER_ACL:
whole_mask = ACL_ALL_RIGHTS_PARAMETER_ACL;
break;
@@ -561,6 +562,7 @@ ExecuteGrantStmt(GrantStmt *stmt)
case OBJECT_EXTPROTOCOL:
all_privileges = ACL_ALL_RIGHTS_EXTPROTOCOL;
errormsg = gettext_noop("invalid privilege type %s for
external protocol");
+ break;
case OBJECT_PARAMETER_ACL:
all_privileges = ACL_ALL_RIGHTS_PARAMETER_ACL;
errormsg = gettext_noop("invalid privilege type %s for
parameter");
@@ -1691,6 +1693,7 @@ RemoveRoleFromObjectACL(Oid roleid, Oid classid, Oid
objid)
break;
case ExtprotocolRelationId:
istmt.objtype = OBJECT_EXTPROTOCOL;
+ break;
case ParameterAclRelationId:
istmt.objtype = OBJECT_PARAMETER_ACL;
break;
@@ -3403,7 +3406,7 @@ pg_aclmask(ObjectType objtype, Oid object_oid, AttrNumber
attnum, Oid roleid,
case OBJECT_TYPE:
return object_aclmask(TypeRelationId, object_oid,
roleid, mask, how);
case OBJECT_EXTPROTOCOL:
- return pg_extprotocol_aclmask(table_oid, roleid, mask,
how);
+ return pg_extprotocol_aclmask(object_oid, roleid, mask,
how);
default:
elog(ERROR, "unrecognized object type: %d",
(int) objtype);
@@ -3953,7 +3956,7 @@ pg_largeobject_aclmask_snapshot(Oid lobj_oid, Oid roleid,
/*
* Routine for examining a user's privileges for a namespace
*/
-static AclMode
+AclMode
pg_namespace_aclmask(Oid nsp_oid, Oid roleid,
AclMode mask, AclMaskHow how)
{
@@ -4042,65 +4045,6 @@ pg_namespace_aclmask(Oid nsp_oid, Oid roleid,
return result;
}
-/*
- * Exported routine for examining a user's privileges for a storage
- * server.
- */
-AclMode
-gp_storage_server_aclmask(Oid srv_oid, Oid roleid,
- AclMode mask, AclMaskHow how)
-{
- AclMode result;
- HeapTuple tuple;
- Datum aclDatum;
- bool isNull;
- Acl *acl;
- Oid ownerId;
-
- Form_gp_storage_server srvForm;
-
- /* Bypass permission checks for superusers */
- if (superuser_arg(roleid))
- return mask;
-
- tuple = SearchSysCache1(STORAGESERVEROID, ObjectIdGetDatum(srv_oid));
- if (!HeapTupleIsValid(tuple))
- ereport(ERROR,
- (errcode(ERRCODE_UNDEFINED_OBJECT),
- errmsg("storage server with OID %u does not
exist",
- srv_oid)));
- srvForm = (Form_gp_storage_server) GETSTRUCT(tuple);
-
- /*
- * Normal case: get the storage server's ACL from gp_storage_server
- */
- ownerId = srvForm->srvowner;
-
- aclDatum = SysCacheGetAttr(STORAGESERVEROID, tuple,
-
Anum_gp_storage_server_srvacl, &isNull);
- if (isNull)
- {
- /* No ACL, so build default ACL */
- acl = acldefault(OBJECT_STORAGE_SERVER, ownerId);
- aclDatum = (Datum) 0;
- }
- else
- {
- /* detoast rel's ACL if necessary */
- acl = DatumGetAclP(aclDatum);
- }
-
- result = aclmask(acl, roleid, ownerId, mask, how);
-
- /* if we have a detoasted copy, free it */
- if (acl && (Pointer) acl != DatumGetPointer(aclDatum))
- pfree(acl);
-
- ReleaseSysCache(tuple);
-
- return result;
-}
-
/*
* Exported routine for examining a user's privileges for a type.
*/
diff --git a/src/backend/catalog/catalog.c b/src/backend/catalog/catalog.c
index e7c6cb7d4cf..c05feee31bf 100644
--- a/src/backend/catalog/catalog.c
+++ b/src/backend/catalog/catalog.c
@@ -973,7 +973,7 @@ GetNewRelFileNumber(Oid reltablespace, Relation pg_class,
char relpersistence)
collides = GpCheckRelFileCollision(rlocator);
- if (!collides && rnode.node.spcNode != GLOBALTABLESPACE_OID)
+ if (!collides && rlocator.locator.spcOid !=
GLOBALTABLESPACE_OID)
{
/*
* GPDB_91_MERGE_FIXME: check again for a collision
with a temp
@@ -986,9 +986,9 @@ GetNewRelFileNumber(Oid reltablespace, Relation pg_class,
char relpersistence)
* buffers at all. We have to make this additional
check to make
* sure of that.
*/
- rnode.backend = (backend == InvalidBackendId) ?
TempRelBackendId
+ rlocator.backend = (backend == InvalidBackendId) ?
TempRelBackendId
: InvalidBackendId;
- collides = GpCheckRelFileCollision(rnode);
+ collides = GpCheckRelFileCollision(rlocator);
}
} while (collides);
diff --git a/src/backend/catalog/heap.c b/src/backend/catalog/heap.c
index edc96112b61..fd222b096ea 100644
--- a/src/backend/catalog/heap.c
+++ b/src/backend/catalog/heap.c
@@ -460,15 +460,12 @@ heap_create(const char *relname,
*/
if (create_storage)
{
- RelationOpenSmgr(rel);
-
-
if (RELKIND_HAS_TABLE_AM(rel->rd_rel->relkind))
table_relation_set_new_filelocator(rel,
&rel->rd_locator,
relpersistence,
relfrozenxid, relminmxid);
else if (RELKIND_HAS_STORAGE(rel->rd_rel->relkind))
- RelationCreateStorage(rel->rd_locator, relpersistence,
true);
+ RelationCreateStorage(rel->rd_locator, relpersistence,
true, SMGR_MD, rel);
else
Assert(false);
diff --git a/src/backend/catalog/index.c b/src/backend/catalog/index.c
index dc1a71cdb1b..7099a9e2043 100644
--- a/src/backend/catalog/index.c
+++ b/src/backend/catalog/index.c
@@ -792,7 +792,7 @@ index_create(Relation heapRelation,
indexRelationId,
parentIndexRelid,
parentConstraintId,
- relFileNode,
+
relFileNumber,
indexInfo,
indexColNames,
accessMethodObjectId,
@@ -812,7 +812,7 @@ index_create(Relation heapRelation,
indexRelationId,
parentIndexRelid,
parentConstraintId,
- relFileNode,
+
relFileNumber,
indexInfo,
indexColNames,
accessMethodObjectId,
@@ -834,7 +834,7 @@ index_create_internal(Relation heapRelation,
Oid indexRelationId,
Oid parentIndexRelid,
Oid parentConstraintId,
- Oid relFileNode,
+ Oid relFileNumber,
IndexInfo *indexInfo,
List *indexColNames,
Oid accessMethodObjectId,
@@ -3057,9 +3057,6 @@ index_update_stats(Relation rel,
if (reltuples >= 0 && Gp_role != GP_ROLE_DISPATCH)
{
- BlockNumber relpages;
- BlockNumber relallvisible;
-
relpages = RelationGetNumberOfBlocks(rel);
/*
@@ -3231,7 +3228,7 @@ index_build(Relation heapRelation,
!smgrexists(RelationGetSmgr(indexRelation), INIT_FORKNUM))
{
smgrcreate(RelationGetSmgr(indexRelation), INIT_FORKNUM, false);
- log_smgrcreate(&indexRelation->rd_locator, INIT_FORKNUM);
+ log_smgrcreate(&indexRelation->rd_locator, INIT_FORKNUM,
SMGR_MD);
indexRelation->rd_indam->ambuildempty(indexRelation);
}
diff --git a/src/backend/catalog/indexing.c b/src/backend/catalog/indexing.c
index 2fb8162f2dc..f126eddbbe3 100644
--- a/src/backend/catalog/indexing.c
+++ b/src/backend/catalog/indexing.c
@@ -382,6 +382,6 @@ CatalogTupleInsertFrozen(Relation heapRel, HeapTuple tup)
frozen_heap_insert(heapRel, tup);
- CatalogIndexInsert(indstate, tup);
+ CatalogIndexInsert(indstate, tup, TU_All);
CatalogCloseIndexes(indstate);
}
diff --git a/src/backend/catalog/objectaddress.c
b/src/backend/catalog/objectaddress.c
index 22d918172a1..1f8ebcd7572 100644
--- a/src/backend/catalog/objectaddress.c
+++ b/src/backend/catalog/objectaddress.c
@@ -2624,7 +2624,7 @@ check_object_ownership(Oid roleid, ObjectType objtype,
ObjectAddress address,
case OBJECT_DOMAIN:
case OBJECT_ATTRIBUTE:
if (!object_ownercheck(address.classId,
address.objectId, roleid))
- aclcheck_error_type(ACLCHECK_NOT_OWNER,
address.objectId);
+ aclcheck_error_type(ACLCHECK_NOT_OWNER,
address.objectId);\
break;
case OBJECT_DOMCONSTRAINT:
{
@@ -2771,17 +2771,13 @@ check_object_ownership(Oid roleid, ObjectType objtype,
ObjectAddress address,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be superuser")));
break;
- case OBJECT_STATISTIC_EXT:
- if (!object_ownercheck(STATEXTOID, address.objectId,
roleid))
- aclcheck_error(ACLCHECK_NOT_OWNER, objtype,
-
NameListToString(castNode(List, object)));
- break;
case OBJECT_PROFILE:
/* We treat these object types as being owned by
superusers */
if (!superuser_arg(roleid))
ereport(ERROR,
(errcode(ERRCODE_INSUFFICIENT_PRIVILEGE),
errmsg("must be superuser")));
+ break;
case OBJECT_AMOP:
case OBJECT_AMPROC:
case OBJECT_DEFAULT:
@@ -2792,6 +2788,9 @@ check_object_ownership(Oid roleid, ObjectType objtype,
ObjectAddress address,
/* These are currently not supported or don't make
sense here. */
elog(ERROR, "unsupported object type: %d", (int)
objtype);
break;
+ default:
+ elog(ERROR, "unrecognized object type: %d",
+ (int) objtype);
}
}
diff --git a/src/backend/catalog/pg_extprotocol.c
b/src/backend/catalog/pg_extprotocol.c
index e597287701f..476655d08b0 100644
--- a/src/backend/catalog/pg_extprotocol.c
+++ b/src/backend/catalog/pg_extprotocol.c
@@ -258,7 +258,7 @@ ValidateProtocolFunction(List *fnName, ExtPtcFuncType
fntype)
/* Check protocol creator has permission to call the function */
- aclresult = pg_proc_aclcheck(fnOid, GetUserId(), ACL_EXECUTE);
+ aclresult = object_aclcheck(ProcedureRelationId, fnOid, GetUserId(),
ACL_EXECUTE);
if (aclresult != ACLCHECK_OK)
aclcheck_error(aclresult, OBJECT_FUNCTION,
get_func_name(fnOid));
diff --git a/src/backend/catalog/pg_proc.c b/src/backend/catalog/pg_proc.c
index fd54ea7dda2..6285ce06f66 100644
--- a/src/backend/catalog/pg_proc.c
+++ b/src/backend/catalog/pg_proc.c
@@ -1080,6 +1080,7 @@ function_parse_error_transpose(const char *prosrc)
{
int origerrposition;
int newerrposition;
+ const char *queryText;
/*
* Nothing to do unless we are dealing with a syntax error that has a
@@ -1100,18 +1101,8 @@ function_parse_error_transpose(const char *prosrc)
/* Assert(ActivePortal && PortalGetStatus(ActivePortal) ==
PORTAL_ACTIVE); */
queryText = ActivePortal->sourceText;
- /* Try to locate the prosrc in the original text */
- newerrposition = match_prosrc_to_query(prosrc, queryText,
-
origerrposition);
- }
- else
- {
- /*
- * Quietly give up if no ActivePortal. This is an unusual
situation
- * but it can happen in, e.g., logical replication workers.
- */
- newerrposition = -1;
- }
+ /* Try to locate the prosrc in the original text */
+ newerrposition = match_prosrc_to_query(prosrc, queryText,
origerrposition);
if (newerrposition > 0)
{
diff --git a/src/backend/catalog/storage.c b/src/backend/catalog/storage.c
index 06190e942d1..2a9b82d884b 100644
--- a/src/backend/catalog/storage.c
+++ b/src/backend/catalog/storage.c
@@ -87,10 +87,10 @@ StorageDoPendingRelDelete(PendingRelDelete *delete)
* GPDB: backend can only be TempRelBackendId or InvalidBackendId for a
* given relfile since we don't tie temp relations to their backends.
*/
- srel = smgropen(delete->relnode.node,
- delete->relnode.isTempRelation ?
+ srel = smgropen(delete->rlocator.node,
+ delete->rlocator.isTempRelation ?
TempRelBackendId : InvalidBackendId,
- delete->relnode.smgr_which, NULL);
+ delete->rlocator.smgr_which, NULL);
smgrdounlinkall(&srel, 1, false);
smgrclose(srel);
}
@@ -170,11 +170,11 @@ RelationCreateStorage(RelFileLocator rlocator, char
relpersistence, bool registe
return NULL; /* placate compiler */
}
- srel = smgropen(rlocator, backend);
+ srel = smgropen(rlocator, backend, SMGR_MD, rel);
smgrcreate(srel, MAIN_FORKNUM, false);
if (needs_wal)
- log_smgrcreate(&srel->smgr_rlocator.locator, MAIN_FORKNUM);
+ log_smgrcreate(&srel->smgr_rlocator.locator, MAIN_FORKNUM,
SMGR_MD);
/*
* Add the relation to the list of stuff to delete at abort, if we are
@@ -548,8 +548,8 @@ RelationCopyStorage(SMgrRelation src, SMgrRelation dst,
(errcode(ERRCODE_DATA_CORRUPTED),
errmsg("invalid page in block %u of
relation %s",
blkno,
-
relpathbackend(src->smgr_rnode.node,
-
src->smgr_rnode.backend,
+
relpathbackend(src->smgr_rlocator.locator,
+
src->smgr_rlocator.backend,
forkNum))));
/*
* WAL-log the copied page. Unfortunately we don't know what
kind of a
@@ -652,7 +652,7 @@ SerializePendingSyncs(Size maxSize, char *startAddress)
{
Assert(delete->action);
if (delete->atCommit || !(delete->action->flags &
PENDING_REL_DELETE_NEED_SYNC))
- (void) hash_search(tmphash, (void *) &delete->relnode,
+ (void) hash_search(tmphash, (void *) &delete->rlocator,
HASH_REMOVE, NULL);
}
hash_seq_init(&scan, tmphash);
diff --git a/src/backend/catalog/storage_directory_table.c
b/src/backend/catalog/storage_directory_table.c
index e9df27d498e..89dd8cda8bf 100644
--- a/src/backend/catalog/storage_directory_table.c
+++ b/src/backend/catalog/storage_directory_table.c
@@ -171,9 +171,9 @@ UFileAddPendingDelete(Relation rel, Oid spcId, char
*relativePath, bool atCommit
pending->reldelete.atCommit = atCommit; /* delete if abort */
pending->reldelete.nestLevel = GetCurrentTransactionNestLevel();
- pending->reldelete.relnode.node = rel->rd_node;
- pending->reldelete.relnode.isTempRelation = rel->rd_backend ==
TempRelBackendId;
- pending->reldelete.relnode.smgr_which = SMGR_INVALID;
+ pending->reldelete.rlocator.node = rel->rd_locator;
+ pending->reldelete.rlocator.isTempRelation = rel->rd_backend ==
TempRelBackendId;
+ pending->reldelete.rlocator.smgr_which = SMGR_INVALID;
pending->reldelete.action = &ufile_pending_rel_deletes_action;
RegisterPendingDelete(&pending->reldelete);
diff --git a/src/backend/utils/error/elog.c b/src/backend/utils/error/elog.c
index f48664e3588..0ae505131c9 100644
--- a/src/backend/utils/error/elog.c
+++ b/src/backend/utils/error/elog.c
@@ -1434,7 +1434,7 @@ errmsg_plural(const char *fmt_singular, const char
*fmt_plural,
/*
* errdetail --- add a detail error message text to the current error
*/
-void
+int
errdetail(const char *fmt,...)
{
ErrorData *edata = &errordata[errordata_stack_depth];
@@ -1449,6 +1449,7 @@ errdetail(const char *fmt,...)
MemoryContextSwitchTo(oldcontext);
recursion_depth--;
errno = edata->saved_errno; /*CDB*/
+ return 0;
}
diff --git a/src/include/catalog/gp_matview_tables.h
b/src/include/catalog/gp_matview_tables.h
index 9b9cf0d968d..9962d1b6844 100644
--- a/src/include/catalog/gp_matview_tables.h
+++ b/src/include/catalog/gp_matview_tables.h
@@ -55,10 +55,8 @@ CATALOG(gp_matview_tables,7150,GpMatviewTablesId)
*/
typedef FormData_gp_matview_tables *Form_gp_matview_tables;
-DECLARE_UNIQUE_INDEX(gp_matview_tables_mvoid_relid_index, 7151, on
gp_matview_tables using btree(mvoid oid_ops, relid oid_ops));
-#define GpMatviewTablesMvRelIndexId 7151
+DECLARE_UNIQUE_INDEX(gp_matview_tables_mvoid_relid_index, 7151,
GpMatviewTablesMvRelIndexId, on gp_matview_tables using btree(mvoid oid_ops,
relid oid_ops));
-DECLARE_INDEX(gp_matview_tables_relid_index, 7152, on gp_matview_tables using
btree(relid oid_ops));
-#define GpMatviewTablesRelIndexId 7152
+DECLARE_INDEX(gp_matview_tables_relid_index, 7152, GpMatviewTablesRelIndexId,
on gp_matview_tables using btree(relid oid_ops));
#endif /* gp_matview_tables_H */
diff --git a/src/include/catalog/gp_segment_configuration.h
b/src/include/catalog/gp_segment_configuration.h
index 40d9949a770..f442e2bc623 100644
--- a/src/include/catalog/gp_segment_configuration.h
+++ b/src/include/catalog/gp_segment_configuration.h
@@ -73,6 +73,9 @@ DECLARE_TOAST(gp_segment_configuration, 6092, 6093);
#define GpSegmentConfigToastTable 6092
#define GpSegmentConfigToastIndex 6093
+DECLARE_UNIQUE_INDEX(gp_segment_config_content_preferred_role_warehouse_index,
7139, GpSegmentConfigContentPreferred_roleWarehouseIndexId, on
gp_segment_configuration using btree(content int2_ops, preferred_role char_ops,
warehouseid oid_ops));
+DECLARE_UNIQUE_INDEX(gp_segment_config_dbid_warehouse_index, 7140,
GpSegmentConfigDbidWarehouseIndexId, on gp_segment_configuration using
btree(dbid int2_ops, warehouseid oid_ops));
+
extern bool gp_segment_config_has_mirrors(void);
#endif /* GP_SEGMENT_CONFIGURATION_H */
diff --git a/src/include/catalog/gp_segment_configuration_indexing.h
b/src/include/catalog/gp_segment_configuration_indexing.h
index b4d2ac669db..1a00a8d78c9 100644
--- a/src/include/catalog/gp_segment_configuration_indexing.h
+++ b/src/include/catalog/gp_segment_configuration_indexing.h
@@ -14,7 +14,4 @@
#include "catalog/genbki.h"
-DECLARE_UNIQUE_INDEX(gp_segment_config_content_preferred_role_warehouse_index,
7139, GpSegmentConfigContentPreferred_roleWarehouseIndexId, on
gp_segment_configuration using btree(content int2_ops, preferred_role char_ops,
warehouseid oid_ops));
-DECLARE_UNIQUE_INDEX(gp_segment_config_dbid_warehouse_index, 7140,
GpSegmentConfigDbidWarehouseIndexId, on gp_segment_configuration using
btree(dbid int2_ops, warehouseid oid_ops));
-
#endif // GP_SEGMENT_CONFIGURATION_INDEXING_H
diff --git a/src/include/catalog/gp_storage_user_mapping.h
b/src/include/catalog/gp_storage_user_mapping.h
index 4c45793ebd1..06685678de9 100644
--- a/src/include/catalog/gp_storage_user_mapping.h
+++ b/src/include/catalog/gp_storage_user_mapping.h
@@ -61,9 +61,7 @@ DECLARE_TOAST(gp_storage_user_mapping, 6132, 6133);
#define GpStorageUserMappingToastTable 6132
#define GpStorageUserMappingToastIndex 6133
-DECLARE_UNIQUE_INDEX_PKEY(gp_storage_user_mapping_oid_index, 6134, on
gp_storage_user_mapping using btree(oid oid_ops));
-#define StorageUserMappingOidIndexId 6134
-DECLARE_UNIQUE_INDEX(gp_storage_user_mapping_server_index, 6135, on
gp_storage_user_mapping using btree(umuser oid_ops, umserver oid_ops));
-#define StorageUserMappingServerIndexId 6135
+DECLARE_UNIQUE_INDEX_PKEY(gp_storage_user_mapping_oid_index, 6134,
StorageUserMappingOidIndexId, on gp_storage_user_mapping using btree(oid
oid_ops));
+DECLARE_UNIQUE_INDEX(gp_storage_user_mapping_server_index, 6135,
StorageUserMappingServerIndexId, on gp_storage_user_mapping using btree(umuser
oid_ops, umserver oid_ops));
#endif //GP_STORAGE_USER_MAPPING_H
diff --git a/src/include/catalog/gp_warehouse.h
b/src/include/catalog/gp_warehouse.h
index 9fe4cf24d25..9bc23202aa5 100644
--- a/src/include/catalog/gp_warehouse.h
+++ b/src/include/catalog/gp_warehouse.h
@@ -42,9 +42,7 @@ CATALOG(gp_warehouse,8690,GpWarehouseRelationId)
BKI_SHARED_RELATION
typedef FormData_gp_warehouse *Form_gp_warehouse;
-DECLARE_UNIQUE_INDEX(gp_warehouse_oid_index, 8086, on gp_warehouse using
btree(oid oid_ops));
-#define GpWarehouseOidIndexId 8086
-DECLARE_UNIQUE_INDEX(gp_warehouse_name_index, 8059, on gp_warehouse using
btree(warehouse_name text_ops));
-#define GpWarehouseNameIndexId 8059
+DECLARE_UNIQUE_INDEX(gp_warehouse_oid_index, 8086, GpWarehouseOidIndexId, on
gp_warehouse using btree(oid oid_ops));
+DECLARE_UNIQUE_INDEX(gp_warehouse_name_index, 8059, GpWarehouseNameIndexId, on
gp_warehouse using btree(warehouse_name text_ops));
#endif /* GP_WAREHOUSE_H */
diff --git a/src/include/catalog/heap.h b/src/include/catalog/heap.h
index 535fc388243..3e6ae6f688e 100644
--- a/src/include/catalog/heap.h
+++ b/src/include/catalog/heap.h
@@ -138,13 +138,6 @@ extern List *AddRelationConstraints(Relation rel,
extern void RelationClearMissing(Relation rel);
-extern Oid StoreAttrDefault(Relation rel, AttrNumber attnum,
- Node *expr,
- bool *cookedMissingVal,
- Datum *missingval_p,
- bool *missingIsNull_p,
- bool is_internal,
- bool add_column_mode);
extern void StoreAttrMissingVal(Relation rel, AttrNumber attnum,
Datum
missingval);
extern void SetAttrMissing(Oid relid, char *attname, char *value);
diff --git a/src/include/catalog/index.h b/src/include/catalog/index.h
index 3e25fb08766..d0f426af169 100644
--- a/src/include/catalog/index.h
+++ b/src/include/catalog/index.h
@@ -102,7 +102,7 @@ extern Oid index_create_internal(Relation heapRelation,
Oid indexRelationId,
Oid parentIndexRelid,
Oid parentConstraintId,
- Oid relFileNode,
+ Oid relFileNumber,
IndexInfo *indexInfo,
List *indexColNames,
Oid accessMethodObjectId,
diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h
index b241c842cef..6a7b4f5271c 100644
--- a/src/include/catalog/pg_attrdef.h
+++ b/src/include/catalog/pg_attrdef.h
@@ -58,14 +58,17 @@ DECLARE_UNIQUE_INDEX_PKEY(pg_attrdef_oid_index, 2657,
AttrDefaultOidIndexId, on
DECLARE_FOREIGN_KEY((adrelid, adnum), pg_attribute, (attrelid, attnum));
-
-extern Oid StoreAttrDefault(Relation rel, AttrNumber attnum,
- Node *expr, bool
is_internal,
- bool add_column_mode);
extern void RemoveAttrDefault(Oid relid, AttrNumber attnum,
DropBehavior behavior,
bool complain, bool
internal);
extern void RemoveAttrDefaultById(Oid attrdefId);
+extern Oid StoreAttrDefault(Relation rel, AttrNumber attnum,
+ Node *expr,
+ bool
*cookedMissingVal,
+ Datum *missingval_p,
+ bool
*missingIsNull_p,
+ bool is_internal,
+ bool
add_column_mode);
extern Oid GetAttrDefaultOid(Oid relid, AttrNumber attnum);
extern ObjectAddress GetAttrDefaultColumnAddress(Oid attrdefoid);
diff --git a/src/include/catalog/pg_password_history.h
b/src/include/catalog/pg_password_history.h
index e46638cb6be..974c7ea48c6 100644
--- a/src/include/catalog/pg_password_history.h
+++ b/src/include/catalog/pg_password_history.h
@@ -59,9 +59,7 @@ DECLARE_TOAST(pg_password_history, 10143, 10144);
#define PgPasswordHistoryToastTable 10143
#define PgPasswordHistoryToastIndex 10144
-DECLARE_UNIQUE_INDEX(pg_password_history_role_password_index, 10145, on
pg_password_history using btree(passhistroleid oid_ops, passhistpassword
text_ops));
-#define PasswordHistoryRolePasswordIndexId 10145
-DECLARE_INDEX(pg_password_history_role_passwordsetat_index, 10146, on
pg_password_history using btree(passhistroleid oid_ops, passhistpasswordsetat
timestamptz_ops));
-#define PasswordHistoryRolePasswordsetatIndexId 10146
+DECLARE_UNIQUE_INDEX(pg_password_history_role_password_index, 10145,
PasswordHistoryRolePasswordIndexId, on pg_password_history using
btree(passhistroleid oid_ops, passhistpassword text_ops));
+DECLARE_INDEX(pg_password_history_role_passwordsetat_index, 10146,
PasswordHistoryRolePasswordsetatIndexId, on pg_password_history using
btree(passhistroleid oid_ops, passhistpasswordsetat timestamptz_ops));
#endif /*
PG_PASSWORD_HISTORY_H */
diff --git a/src/include/catalog/pg_profile.h b/src/include/catalog/pg_profile.h
index b8c5b902e84..b1e9228c6aa 100644
--- a/src/include/catalog/pg_profile.h
+++ b/src/include/catalog/pg_profile.h
@@ -62,12 +62,9 @@ CATALOG(pg_profile,10135,ProfileRelationId)
BKI_SHARED_RELATION BKI_ROWTYPE_OID(
*/
typedef FormData_pg_profile *Form_pg_profile;
-DECLARE_UNIQUE_INDEX(profile_name_index, 10137, on pg_profile using
btree(prfname name_ops));
-#define ProfilePrfnameIndexId 10137
-DECLARE_UNIQUE_INDEX(profile_oid_index, 10138, on pg_profile using btree(oid
oid_ops));
-#define ProfileOidIndexId 10138
-DECLARE_INDEX(profile_password_verify_function_index, 10139, on pg_profile
using btree(prfpasswordverifyfuncdb oid_ops, prfpasswordverifyfunc oid_ops));
-#define ProfileVerifyFunctionIndexId 10139
+DECLARE_UNIQUE_INDEX(profile_name_index, 10137, ProfilePrfnameIndexId, on
pg_profile using btree(prfname name_ops));
+DECLARE_UNIQUE_INDEX(profile_oid_index, 10138, ProfileOidIndexId, on
pg_profile using btree(oid oid_ops));
+DECLARE_INDEX(profile_password_verify_function_index, 10139,
ProfileVerifyFunctionIndexId, on pg_profile using btree(prfpasswordverifyfuncdb
oid_ops, prfpasswordverifyfunc oid_ops));
#define DefaultProfileOID 10140
diff --git a/src/include/catalog/pg_tag_description.h
b/src/include/catalog/pg_tag_description.h
index 3a70bfd8a67..24d14054daa 100644
--- a/src/include/catalog/pg_tag_description.h
+++ b/src/include/catalog/pg_tag_description.h
@@ -60,11 +60,8 @@ CATALOG(pg_tag_description,6485,TagDescriptionRelationId)
BKI_SHARED_RELATION BK
*/
typedef FormData_pg_tag_description *Form_pg_tag_description;
-DECLARE_UNIQUE_INDEX_PKEY(pg_tag_description_d_c_o_t_index, 6487, on
pg_tag_description using btree(tddatabaseid oid_ops, tdclassid oid_ops, tdobjid
oid_ops, tagid oid_ops));
-#define TagDescriptionIndexId 6487
-DECLARE_UNIQUE_INDEX(pg_tag_description_oid_index, 6488, on pg_tag_description
using btree(oid oid_ops));
-#define TagDescriptionOidIndexId 6488
-DECLARE_INDEX(pg_tag_description_tagidvalue_index, 6489, on pg_tag_description
using btree(tagid oid_ops, tagvalue text_ops));
-#define TagDescriptionTagidvalueIndexId 6489
+DECLARE_UNIQUE_INDEX_PKEY(pg_tag_description_d_c_o_t_index, 6487,
TagDescriptionIndexId, on pg_tag_description using btree(tddatabaseid oid_ops,
tdclassid oid_ops, tdobjid oid_ops, tagid oid_ops));
+DECLARE_UNIQUE_INDEX(pg_tag_description_oid_index, 6488,
TagDescriptionOidIndexId, on pg_tag_description using btree(oid oid_ops));
+DECLARE_INDEX(pg_tag_description_tagidvalue_index, 6489,
TagDescriptionTagidvalueIndexId, on pg_tag_description using btree(tagid
oid_ops, tagvalue text_ops));
#endif /* PG_TAG_DESCRIPTION_H
*/
\ No newline at end of file
diff --git a/src/include/catalog/pg_task.h b/src/include/catalog/pg_task.h
index d586d79ca0d..387d5945748 100644
--- a/src/include/catalog/pg_task.h
+++ b/src/include/catalog/pg_task.h
@@ -51,10 +51,8 @@ CATALOG(pg_task,9637,TaskRelationId) BKI_SHARED_RELATION
typedef FormData_pg_task *Form_pg_task;
-DECLARE_UNIQUE_INDEX(pg_task_jobname_username_index, 8915, on pg_task using
btree(jobname text_ops, username text_ops));
-#define TaskJobNameUserNameIndexId 8915
-DECLARE_UNIQUE_INDEX_PKEY(pg_task_jobid_index, 8916, on pg_task using
btree(jobid oid_ops));
-#define TaskJobIdIndexId 8916
+DECLARE_UNIQUE_INDEX(pg_task_jobname_username_index, 8915,
TaskJobNameUserNameIndexId, on pg_task using btree(jobname text_ops, username
text_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_task_jobid_index, 8916, TaskJobIdIndexId, on
pg_task using btree(jobid oid_ops));
extern Oid TaskCreate(const char *schedule, const char *command,
const char *nodename, int32 nodeport,
diff --git a/src/include/catalog/pg_task_run_history.h
b/src/include/catalog/pg_task_run_history.h
index b9e599aa574..fdb636c7f00 100644
--- a/src/include/catalog/pg_task_run_history.h
+++ b/src/include/catalog/pg_task_run_history.h
@@ -55,10 +55,8 @@ CATALOG(pg_task_run_history,9993,TaskRunHistoryRelationId)
BKI_SHARED_RELATION
typedef FormData_pg_task_run_history *Form_pg_task_run_history;
-DECLARE_INDEX(pg_task_run_history_jobid_index, 8633, on pg_task_run_history
using btree(jobid oid_ops));
-#define TaskRunHistoryJobIdIndexId 8633
-DECLARE_UNIQUE_INDEX_PKEY(pg_task_run_history_runid_index, 8110, on
pg_task_run_history using btree(runid oid_ops));
-#define TaskRunHistoryRunIdIndexId 8110
+DECLARE_INDEX(pg_task_run_history_jobid_index, 8633,
TaskRunHistoryJobIdIndexId, on pg_task_run_history using btree(jobid oid_ops));
+DECLARE_UNIQUE_INDEX_PKEY(pg_task_run_history_runid_index, 8110,
TaskRunHistoryRunIdIndexId, on pg_task_run_history using btree(runid oid_ops));
extern void TaskRunHistoryCreate(Oid runid, int64 *jobid, const char
*database, const char *username,
const char
*command, const char *status);
diff --git a/src/include/commands/tablecmds.h b/src/include/commands/tablecmds.h
index 2f283a7bd51..caf1f43a992 100644
--- a/src/include/commands/tablecmds.h
+++ b/src/include/commands/tablecmds.h
@@ -83,8 +83,7 @@ extern void SetRelationHasSubclass(Oid relationId, bool
relhassubclass);
extern bool CheckRelationTableSpaceMove(Relation rel, Oid newTableSpaceId);
extern void SetRelationTableSpace(Relation rel, Oid newTableSpaceId,
- RelFileNumber
newRelFilenumber,
- Oid newRelFileNode);
+ RelFileNumber
newRelFilenumber);
extern ObjectAddress renameatt(RenameStmt *stmt);
diff --git a/src/include/utils/elog.h b/src/include/utils/elog.h
index bc0b4ee9718..4cd3971d928 100644
--- a/src/include/utils/elog.h
+++ b/src/include/utils/elog.h
@@ -223,7 +223,7 @@ extern void errmsg_internal(const char *fmt,...)
pg_attribute_printf(1, 2);
extern void errmsg_plural(const char *fmt_singular, const char *fmt_plural,
unsigned long n,...)
pg_attribute_printf(1, 4) pg_attribute_printf(2, 4);
-extern void errdetail(const char *fmt,...) pg_attribute_printf(1, 2);
+extern int errdetail(const char *fmt,...) pg_attribute_printf(1, 2);
extern void errdetail_internal(const char *fmt,...) pg_attribute_printf(1, 2);
extern void errdetail_log(const char *fmt,...) pg_attribute_printf(1, 2);
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]