yuqi1129 opened a new issue, #14714:
URL: https://github.com/apache/gravitino/issues/14714

   ### Version
   
   main branch
   
   ### Describe what's wrong
   
   Dropping a PostgreSQL table that the catalog user cannot drop reports the 
table as missing, and on branch-1.3 it also deletes the table's Gravitino 
metadata:
   
   1. `PostgreSqlTableOperations` drops the table with an unqualified `DROP 
TABLE "<name>"` and resolves it through the search path. PostgreSQL leaves out 
a schema the catalog user has no USAGE privilege on, so the statement fails 
with `42P01` (table does not exist), not `42501` (permission denied).
   2. The drop then returns `false`. On branch-1.3, 
`TableOperationDispatcher.dropTable` still deletes the table registration, with 
its tags and role privileges, including DENY privileges. The table still exists 
in PostgreSQL and loads again as a new entity that the DENY no longer covers.
   
   Main already preserves the registration when a drop returns `false` 
(#12232), but branch-1.3 does not.
   
   ### Error message and/or stacktrace
   
   `DELETE .../tables/t` returns `200 {"dropped": false}` for a table that 
exists.
   
   ### How to reproduce
   
   1. As an admin: `CREATE SCHEMA s; REVOKE ALL ON SCHEMA s FROM PUBLIC; CREATE 
TABLE s.t (id int);`
   2. Create a `jdbc-postgresql` catalog whose user has only CONNECT on the 
database. Load `s.t` as an admin through Gravitino, tag it and add a DENY 
privilege on it.
   3. Drop `s.t` through the catalog: `{"dropped": false}`, the table remains 
in PostgreSQL, and on branch-1.3 the tag and DENY privilege are gone.
   
   ### Additional context
   
   _No response_
   


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to