Commit 8732f87
fix: raise error when table declaration fails due to permissions (#1322)
* fix: raise error when table declaration fails due to permissions
Previously, AccessError during table declaration was silently swallowed,
causing tables with cross-schema foreign keys to fail without any feedback
when the user lacked REFERENCES privilege.
Now:
- If table already exists: suppress error (idempotent declaration)
- If table doesn't exist: raise AccessError with helpful message about
CREATE and REFERENCES privileges
Closes #1161
Co-Authored-By: Claude Opus 4.5 <[email protected]>
* test: update test to expect AccessError at declaration time
The test previously expected silent failure at declaration followed by
error at insert time. Now we fail fast at declaration time (better UX).
Co-Authored-By: Claude Opus 4.5 <[email protected]>
---------
Co-authored-by: Claude Opus 4.5 <[email protected]>1 parent 299ac0d commit 8732f87
2 files changed
+19
-11
lines changed| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
148 | 148 | | |
149 | 149 | | |
150 | 150 | | |
151 | | - | |
152 | | - | |
| 151 | + | |
| 152 | + | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
153 | 160 | | |
154 | 161 | | |
155 | 162 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
90 | 90 | | |
91 | 91 | | |
92 | 92 | | |
| 93 | + | |
93 | 94 | | |
94 | 95 | | |
95 | | - | |
96 | | - | |
97 | | - | |
98 | | - | |
99 | | - | |
100 | | - | |
101 | | - | |
| 96 | + | |
| 97 | + | |
102 | 98 | | |
103 | | - | |
104 | | - | |
| 99 | + | |
| 100 | + | |
| 101 | + | |
| 102 | + | |
| 103 | + | |
| 104 | + | |
| 105 | + | |
105 | 106 | | |
106 | 107 | | |
107 | 108 | | |
| |||
0 commit comments