{"record":{"id":"aa09494e401f0d50","repo":"prestodb/presto","slug":"permission-denied","errorCode":"PERMISSION_DENIED","errorMessage":"DROP TABLE is disabled in this catalog","messagePattern":"DROP TABLE is disabled in this catalog","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/JdbcMetadata.java","lineNumber":171,"sourceCode":"            }\n            catch (TableNotFoundException e) {\n                // table disappeared during listing operation\n            }\n        }\n        return columns.build();\n    }\n\n    @Override\n    public ColumnMetadata getColumnMetadata(ConnectorSession session, ConnectorTableHandle tableHandle, ColumnHandle columnHandle)\n    {\n        return ((JdbcColumnHandle) columnHandle).getColumnMetadata();\n    }\n\n    @Override\n    public void dropTable(ConnectorSession session, ConnectorTableHandle tableHandle)\n    {\n        if (!allowDropTable) {\n            throw new PrestoException(PERMISSION_DENIED, \"DROP TABLE is disabled in this catalog\");\n        }\n        JdbcTableHandle handle = (JdbcTableHandle) tableHandle;\n        jdbcClient.dropTable(session, JdbcIdentity.from(session), handle);\n        jdbcMetadataCache.invalidateTable(session, handle);\n    }\n\n    @Override\n    public ConnectorOutputTableHandle beginCreateTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, Optional<ConnectorNewTableLayout> layout)\n    {\n        JdbcOutputTableHandle handle = jdbcClient.beginCreateTable(session, tableMetadata);\n        setRollback(() -> jdbcClient.rollbackCreateTable(session, JdbcIdentity.from(session), handle));\n        return handle;\n    }\n\n    @Override\n    public void createTable(ConnectorSession session, ConnectorTableMetadata tableMetadata, boolean ignoreExisting)\n    {\n        jdbcClient.createTable(session, tableMetadata);","sourceCodeStart":153,"sourceCodeEnd":189,"githubUrl":"https://github.com/prestodb/presto/blob/55bb57d202de3b926896fa966c2c4a44c779634e/presto-base-jdbc/src/main/java/com/facebook/presto/plugin/jdbc/JdbcMetadata.java#L153-L189","documentation":"JdbcMetadata.dropTable() refuses to drop tables when the catalog's allowDropTable flag (drop-table configuration) is false, throwing PrestoException(PERMISSION_DENIED, \"DROP TABLE is disabled in this catalog\"). This is an intentional catalog-level guard, not a remote database permission failure.","triggerScenarios":"Running DROP TABLE on any table in a JDBC catalog whose properties do not enable allowDropTable; thrown immediately before any JDBC client call is made.","commonSituations":"Default catalog configuration (drop is disabled by default in many deployments); shared analytics clusters where admins intentionally block DDL; users expecting DB-level grants to control this but the connector blocks it earlier.","solutions":["Set allow-drop-table=true in the catalog properties file and restart the coordinator/workers","Run DROP TABLE against a catalog where dropping is permitted","Have an admin drop the table if you cannot change catalog configuration"],"exampleFix":"// before (catalog properties) - dropping disabled\n# (no allow-drop-table setting)\n// after\nallow-drop-table=true","handlingStrategy":"try-catch","validationCode":"// Check the catalog allows drops before issuing DDL\nboolean dropAllowed = catalogProperties.getProperty(\"allow-drop-table\", \"false\").equalsIgnoreCase(\"true\");\nif (!dropAllowed) {\n    throw new UnsupportedOperationException(\"DROP TABLE is disabled for catalog \" + catalogName);\n}","typeGuard":null,"tryCatchPattern":"try {\n    execute(\"DROP TABLE \" + tableName);\n} catch (PrestoException e) {\n    if (e.getErrorCode() == PERMISSION_DENIED.toErrorCode() && e.getMessage().contains(\"DROP TABLE is disabled\")) {\n        // route the drop through a catalog/admin path where allow-drop-table=true\n    } else throw e;\n}","preventionTips":["Know each catalog's allow-drop-table setting before planning destructive DDL","Keep DDL-protected catalogs for shared/analytics workloads and route drops to a dedicated writable catalog","Document to users that PERMISSION_DENIED from this catalog is a config guard, not a database grant issue"],"tags":["jdbc","ddl","permissions","drop-table","configuration"],"backgroundTag":"drop-table-disabled","analyzedSha":"55bb57d202de3b926896fa966c2c4a44c779634e","analyzedAt":"2026-09-04T12:50:26.162Z","contentChangedAt":"2026-09-04T12:50:26.162Z","schemaVersion":2},"datasetVersion":"2026-09-11T21:17:09.523Z"}