-
-
Notifications
You must be signed in to change notification settings - Fork 1.3k
fix: handle read-only permission errors gracefully in PostgreSQL table properties #3282
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: master
Are you sure you want to change the base?
Conversation
…e properties - Modified getTableProperties method to wrap each query in individual error handlers - Ensures relations are still displayed even when permission-sensitive queries fail - Added comprehensive unit test to prevent regression - Fixes issue where Relations tab shows empty for read-only PostgreSQL connections Resolves #3262 Co-authored-by: rathboma <rathboma@users.noreply.github.com>
@claude could we be using different SQL that doesn't require elevated perms to do the same things here? |
Claude finished @rathboma's task —— View job Analyzing SQL Permission RequirementsTodo List:
Analysis SummaryI've thoroughly analyzed the permission issues in the PostgreSQL client. Here's what I found: Queries That Require Elevated Permissions:
Queries That Should Work (but may fail in highly restricted environments):
RecommendationThe current approach is actually optimal for the following reasons:
Potential Improvements (if needed):
ConclusionThe current PR's approach is the right solution. There aren't meaningful SQL alternatives that avoid permission requirements for the failing queries. The important metadata (relations, indexes, triggers) should work with read-only access, while size/ownership information gracefully degrades to null/0 values when permissions are insufficient. The error handling ensures users still get the Relations tab functionality they need, even in restrictive environments. |
@claude looks like your tests don't work |
Claude finished @rathboma's task —— View job Fixed Test Issues ✅Todo List:
Analysis & FixThe test was failing because the PostgreSQL client wasn't properly initialized when created with Issues identified:
Fix applied:
The test should now pass as it properly simulates a client with read-only permissions where some queries fail but relations are still returned. |
- Set _defaultSchema and version properties for test client - Mock wrapTable method to return properly formatted identifier - Ensures test client is properly initialized when created with null parameters Co-authored-by: Matthew Rathbone <rathboma@users.noreply.github.com>
@claude does this affect derivative drivers? Eg Cockroach / Redshift / others? |
Claude finished @rathboma's task —— View job Analysis: Impact on Derivative PostgreSQL DriversTodo List:
SummaryThis PR does NOT affect derivative PostgreSQL drivers. Both CockroachDB and Redshift clients override the Detailed AnalysisPostgreSQL Client Changes (This PR)The PR added individual error handling to each query in
Derivative Drivers Found1. CockroachDB Client (
2. Redshift Client (
Permission Requirements by Driver
RecommendationsNo action required for derivative drivers. The permission handling improvements in this PR:
The architectural decision to override
This PR successfully fixes PostgreSQL read-only permission issues without affecting other drivers. |
@claude we should have some way of telling the user which information we were unable to show due to permissions errors, currently that's hidden from them. Can you add some sort of error message to the response handling and figure out how to deal with that on the front-end? Maybe with something in the statusbar or as a noty notification? |
Claude finished @rathboma's task —— View job ✅ Added User-Facing Permission Error MessagesTodo List:
Implementation Complete ✅I've successfully implemented user-facing permission error messages that inform users when information couldn't be displayed due to insufficient PostgreSQL permissions. 🔧 Changes MadeBackend (PostgreSQL Client):
Frontend (Table Properties Tab):
🎯 User ExperienceBefore: Users saw empty Relations tab with no explanation for missing information
📋 Specific Warnings ShownWhen permissions prevent data retrieval, users now see clear messages for:
🧪 Testing
Files Modified:
Users with read-only PostgreSQL connections now have clear visibility into what information is available vs. restricted, greatly improving the experience when working with limited database permissions. |
…properties Resolves @rathboma's feedback to show users which information couldn't be displayed due to permissions. ## Changes - Add permissionWarnings field to TableProperties interface - Modified PostgreSQL client to collect and return user-friendly permission error messages - Added "Limited Info" warning indicator in table properties status bar - Added clickable warning with detailed notification showing what information is restricted - Updated tests to verify permission warnings are properly returned ## User Experience - Clear visual indicator when some table information can't be displayed - Detailed tooltip and notification explaining specific permission limitations - Relations tab continues to work and shows available information Co-authored-by: Matthew Rathbone <rathboma@users.noreply.github.com>
Fixes issue where Relations tab shows empty for read-only PostgreSQL connections.
Changes
Resolves #3262
Generated with Claude Code