Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commitc7d8fd4

Browse files
committed
Fix permission tests
1 parent6d9494d commitc7d8fd4

File tree

2 files changed

+8
-2
lines changed

2 files changed

+8
-2
lines changed

‎expected/pathman_permissions.out

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,7 @@ GRANT SELECT ON permissions.user1_table TO user2;
1919
/* Should fail (don't own parent) */
2020
SET ROLE user2;
2121
SELECT create_range_partitions('permissions.user1_table', 'id', 1, 10, 2);
22-
WARNING: only the owner or superuser can change partitioning configuration of table "user1_table"
23-
ERROR: new row violates row-level security policy for table "pathman_config"
22+
ERROR: only the owner or superuser can change partitioning configuration of table "user1_table"
2423
/* Should be ok */
2524
SET ROLE user1;
2625
SELECT create_range_partitions('permissions.user1_table', 'id', 1, 10, 2);

‎src/pl_funcs.c

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -723,6 +723,13 @@ add_to_pathman_config(PG_FUNCTION_ARGS)
723723
if (!check_relation_exists(relid))
724724
elog(ERROR,"Invalid relation %u",relid);
725725

726+
if (!check_security_policy_internal(relid,GetUserId()))
727+
{
728+
elog(ERROR,"only the owner or superuser can change "
729+
"partitioning configuration of table \"%s\"",
730+
get_rel_name_or_relid(relid));
731+
}
732+
726733
/* Select partitioning type using 'range_interval' */
727734
parttype=PG_ARGISNULL(2) ?PT_HASH :PT_RANGE;
728735

0 commit comments

Comments
 (0)

[8]ページ先頭

©2009-2025 Movatter.jp