Fix acl error.

This commit is contained in:
TotaJ
2021-12-16 17:27:04 +08:00
parent eaaf873a9f
commit 974d7e8726
6 changed files with 19 additions and 59 deletions

View File

@ -4727,6 +4727,8 @@ static const char* const not_owner_msg[MAX_ACL_KIND] = {
gettext_noop("must be owner of column encryption key %s"),
/* ACL_KIND_GLOBAL_SETTING */
gettext_noop("must be owner of client master key %s"),
/* ACL_KIND_PACKAGE */
gettext_noop("must be owner of package %s"),
/* ACL_KIND_PUBLICATION */
gettext_noop("must be owner of publication %s"),
/* ACL_KIND_SUBSCRIPTION */

View File

@ -335,8 +335,8 @@ static Node *make_node_from_scanbuf(int start_pos, int end_pos, core_yyscan_t yy
CreateAppWorkloadGroupMappingStmt AlterAppWorkloadGroupMappingStmt DropAppWorkloadGroupMappingStmt
MergeStmt PurgeStmt CreateMatViewStmt RefreshMatViewStmt
CreateWeakPasswordDictionaryStmt DropWeakPasswordDictionaryStmt
CreatePublicationStmt AlterPublicationStmt
CreateSubscriptionStmt AlterSubscriptionStmt DropSubscriptionStmt
CreatePublicationStmt AlterPublicationStmt
CreateSubscriptionStmt AlterSubscriptionStmt DropSubscriptionStmt
/* <DB4AI> */
/* SNAPSHOTS */
@ -988,7 +988,7 @@ stmt :
| AlterForeignTableStmt
| AlterFunctionStmt
| AlterProcedureStmt
| AlterPublicationStmt
| AlterPublicationStmt
| AlterGroupStmt
| AlterNodeGroupStmt
| AlterNodeStmt
@ -998,7 +998,7 @@ stmt :
| AlterResourcePoolStmt
| AlterSeqStmt
| AlterSchemaStmt
| AlterSubscriptionStmt
| AlterSubscriptionStmt
| AlterTableStmt
| AlterSystemStmt
| AlterCompositeTypeStmt
@ -1050,7 +1050,7 @@ stmt :
| CreateRlsPolicyStmt
| CreatePLangStmt
| CreateProcedureStmt
| CreatePublicationStmt
| CreatePublicationStmt
| CreateKeyStmt
| CreatePolicyLabelStmt
| CreateWeakPasswordDictionaryStmt
@ -1067,7 +1067,7 @@ stmt :
| CreateSchemaStmt
| CreateSeqStmt
| CreateStmt
| CreateSubscriptionStmt
| CreateSubscriptionStmt
| CreateSynonymStmt
| CreateTableSpaceStmt
| CreateTrigStmt
@ -1101,7 +1101,7 @@ stmt :
| DropResourcePoolStmt
| DropRuleStmt
| DropStmt
| DropSubscriptionStmt
| DropSubscriptionStmt
| DropSynonymStmt
| DropTableSpaceStmt
| DropTrigStmt
@ -13278,7 +13278,7 @@ AlterOwnerStmt: ALTER AGGREGATE func_name aggr_args OWNER TO RoleId
n->newowner = $6;
$$ = (Node *)n;
}
| ALTER PUBLICATION name OWNER TO RoleId
| ALTER PUBLICATION name OWNER TO RoleId
{
AlterOwnerStmt *n = makeNode(AlterOwnerStmt);
n->objectType = OBJECT_PUBLICATION;
@ -21863,7 +21863,7 @@ unreserved_keyword:
| PRIVILEGES
| PROCEDURAL
| PROFILE
| PUBLICATION
| PUBLICATION
| PUBLISH
| PURGE
| QUERY

View File

@ -878,6 +878,11 @@ void InitCatalogCachePhase2(void)
Assert(u_sess->syscache_cxt.CacheInitialized);
for (cacheId = 0; cacheId < SysCacheSize; cacheId++) {
/*
* We create pg_subscription in upgrade-post script, cause the relmap is full(check apply_map_update),
* and pg_subscription is a shared relation. When we do upgrade, before commit, we can't init cache for
* pg_subscription, cause the pg_subscription is not created yet.
*/
if (t_thrd.proc->workingVersionNum < PUBLICATION_VERSION_NUM &&
(cacheId == SUBSCRIPTIONNAME || cacheId == SUBSCRIPTIONOID)) {
continue;

View File

@ -498,7 +498,7 @@ void CheckPointReplicationOrigin(void)
if (unlikely(stat("pg_logical", &st) != 0)) {
/* maybe other threads have created this directory, so check the errno again */
if ((0 != mkdir("pg_logical", S_IRWXU)) && (errno != EEXIST)) {
if ((mkdir("pg_logical", S_IRWXU) != 0) && (errno != EEXIST)) {
ereport(PANIC, (errcode_for_file_access(), errmsg("could not create directory \"pg_logical\": %m")));
}
}

View File

@ -1,47 +0,0 @@
/*-------------------------------------------------------------------------
*
* pg_publication_namespace.h
* definition of the system catalog for mappings between schemas and
* publications (pg_publication_namespace)
*
* Portions Copyright (c) 1996-2021, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_publication_namespace.h
*
* NOTES
* The Catalog.pm module reads this file and derives schema
* information.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_PUBLICATION_NAMESPACE_H
#define PG_PUBLICATION_NAMESPACE_H
#include "catalog/genbki.h"
// #include "catalog/pg_publication_namespace_d.h"
/* ----------------
* pg_publication_namespace definition. cpp turns this into
* typedef struct FormData_pg_publication_namespace
* ----------------
*/
CATALOG(pg_publication_namespace,8901,PublicationNamespaceRelationId)
{
Oid oid; /* oid */
Oid pnpubid BKI_LOOKUP(pg_publication); /* Oid of the publication */
Oid pnnspid BKI_LOOKUP(pg_namespace); /* Oid of the schema */
} FormData_pg_publication_namespace;
/* ----------------
* Form_pg_publication_namespace corresponds to a pointer to a tuple with
* the format of pg_publication_namespace relation.
* ----------------
*/
typedef FormData_pg_publication_namespace *Form_pg_publication_namespace;
DECLARE_UNIQUE_INDEX_PKEY(pg_publication_namespace_oid_index, 8902, PublicationNamespaceObjectIndexId, on pg_publication_namespace using btree(oid oid_ops));
DECLARE_UNIQUE_INDEX(pg_publication_namespace_pnnspid_pnpubid_index, 8903, PublicationNamespacePnnspidPnpubidIndexId, on pg_publication_namespace using btree(pnnspid oid_ops, pnpubid oid_ops));
#endif /* PG_PUBLICATION_NAMESPACE_H */

View File

@ -272,8 +272,8 @@ typedef enum AclObjectKind {
ACL_KIND_COLUMN_SETTING, /* column setting */
ACL_KIND_GLOBAL_SETTING, /* master client key */
ACL_KIND_PACKAGE, /* pg_package */
ACL_KIND_PUBLICATION, /* pg_publication */
ACL_KIND_SUBSCRIPTION, /* pg_subscription */
ACL_KIND_PUBLICATION, /* pg_publication */
ACL_KIND_SUBSCRIPTION, /* pg_subscription */
MAX_ACL_KIND /* MUST BE LAST */
} AclObjectKind;