!2000 创建订阅时跳过回收站表

Merge pull request !2000 from chenxiaobin/recycle
This commit is contained in:
opengauss-bot
2022-08-08 06:21:13 +00:00
committed by Gitee
3 changed files with 38 additions and 0 deletions

View File

@ -43,6 +43,8 @@
#include "utils/rel.h"
#include "utils/syscache.h"
#include "storage/tcap.h"
/* check if namespace is internal schema, internal schema doesn't need publish */
static inline bool IsInternalSchema(Oid relnamespace)
{
@ -177,6 +179,11 @@ static bool is_publishable_class(Oid relid, HeapTuple tuple, Relation rel)
return false;
}
/* skip recycle relation */
if (TrIsRefRbObjectEx(RelationRelationId, relid, NameStr(reltuple->relname))) {
return false;
}
/* check whether is row table */
bool isRowTable = true;
if (rel != NULL) {

View File

@ -114,3 +114,16 @@ select pg_get_replica_identity_index('replica_test');
drop table replica_test;
\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "audit_system_object" > /dev/null 2>&1
-- skip recycle object
\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_recyclebin = on" > /dev/null 2>&1
create table t_ustore_test1(a int) with (storage_type = ustore);
drop table t_ustore_test1;
select count(*) from pg_class where relname like 'BIN$%';
create publication pub_test for all tables;
select * from pg_publication_tables where tablename like 'BIN$%';
purge table t_ustore_test1;
\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_recyclebin = off" > /dev/null 2>&1

View File

@ -246,3 +246,21 @@ select pg_get_replica_identity_index('replica_test');
drop table replica_test;
\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "audit_system_object" > /dev/null 2>&1
-- skip recycle object
\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_recyclebin = on" > /dev/null 2>&1
create table t_ustore_test1(a int) with (storage_type = ustore);
drop table t_ustore_test1;
select count(*) from pg_class where relname like 'BIN$%';
count
-------
1
(1 row)
create publication pub_test for all tables;
select * from pg_publication_tables where tablename like 'BIN$%';
pubname | schemaname | tablename
---------+------------+-----------
(0 rows)
purge table t_ustore_test1;
\! @abs_bindir@/gs_guc reload -D @abs_srcdir@/tmp_check/datanode1/ -c "enable_recyclebin = off" > /dev/null 2>&1