@@ -749,31 +749,31 @@ validate_on_part_init_cb(Oid procid, bool emit_error)
749749 * make sure that current user can change pg_pathman's config. Returns true
750750 * if user can manage relation, false otherwise.
751751 *
752- * XXX currently we just check if user is a table owner. Probably it's better to
753- * check user permissions in order to let other users.
752+ * XXX currently we just check if user is a table owner. Probably it's
753+ * better to check user permissions in order to let other users participate .
754754 */
755755bool
756756check_security_policy_internal (Oid relid )
757757{
758- Oid owner ;
758+ Oid owner ;
759759
760- /*
761- * If user has superuser privileges then he or she can do whatever wants
762- */
760+ /* Superuser is allowed to do anything */
763761 if (superuser ())
764762 return true;
765763
766764 /*
767- * Sometimes the relation doesn't exist anymore but there is still a record
768- * in config. It for example happens in event trigger function. So we
769- * should be able to remove this record
765+ * Sometimes the relation doesn't exist anymore but there is still
766+ * a record in config. For instance, it happens in DDL event trigger.
767+ * Still we should be able to remove this record.
770768 */
771769 if ((owner = get_rel_owner (relid )) == InvalidOid )
772770 return true;
773771
774- /* Check if current user is an owner of the relation */
772+ /* Check if current user is the owner of the relation */
775773 if (owner != GetUserId ())
776- elog (ERROR , "Only table owner or superuser can change partitioning configuration" );
774+ elog (ERROR , "only the owner or superuser can change "
775+ "partitioning configuration of table \"%s\"" ,
776+ get_rel_name_or_relid (relid ));
777777
778778 return true;
779779}
0 commit comments