- Notifications
You must be signed in to change notification settings - Fork28
Commit64d4da5
committed
For foreign keys, check REFERENCES privilege only on the referenced table.
We were requiring that the user have REFERENCES permission on both thereferenced and referencing tables --- but this doesn't seem to have anysupport in the SQL standard, which says only that you need REFERENCESpermission on the referenced table. And ALTER TABLE ADD FOREIGN KEY hasalready checked that you own the referencing table, so the check couldonly fail if a table owner has revoked his own REFERENCES permission.Moreover, the symmetric interpretation of this permission is unintuitiveand confusing, as per complaint from Paul Jungwirth. So let's drop thereferencing-side check.In passing, do a bit of wordsmithing on the GRANT reference page so thatall the privilege types are described in similar fashion.Discussion:https://postgr.es/m/8940.1490906755@sss.pgh.pa.us1 parent8f18a88 commit64d4da5
File tree
3 files changed
+20
-15
lines changed- doc/src/sgml/ref
- src/backend/commands
3 files changed
+20
-15
lines changedLines changed: 5 additions & 3 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
750 | 750 |
| |
751 | 751 |
| |
752 | 752 |
| |
753 |
| - | |
754 |
| - | |
755 |
| - | |
| 753 | + | |
| 754 | + | |
| 755 | + | |
| 756 | + | |
| 757 | + | |
756 | 758 |
| |
757 | 759 |
| |
758 | 760 |
| |
|
Lines changed: 9 additions & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
257 | 257 |
| |
258 | 258 |
| |
259 | 259 |
| |
260 |
| - | |
261 |
| - | |
262 |
| - | |
263 |
| - | |
| 260 | + | |
| 261 | + | |
| 262 | + | |
264 | 263 |
| |
265 | 264 |
| |
266 | 265 |
| |
| |||
351 | 350 |
| |
352 | 351 |
| |
353 | 352 |
| |
354 |
| - | |
| 353 | + | |
355 | 354 |
| |
356 | 355 |
| |
357 | 356 |
| |
| |||
360 | 359 |
| |
361 | 360 |
| |
362 | 361 |
| |
363 |
| - | |
364 |
| - | |
| 362 | + | |
| 363 | + | |
365 | 364 |
| |
366 | 365 |
| |
367 |
| - | |
368 |
| - | |
369 |
| - | |
| 366 | + | |
| 367 | + | |
| 368 | + | |
370 | 369 |
| |
371 | 370 |
| |
372 | 371 |
| |
|
Lines changed: 6 additions & 2 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
6817 | 6817 |
| |
6818 | 6818 |
| |
6819 | 6819 |
| |
6820 |
| - | |
6821 | 6820 |
| |
6822 | 6821 |
| |
6823 | 6822 |
| |
| |||
7745 | 7744 |
| |
7746 | 7745 |
| |
7747 | 7746 |
| |
7748 |
| - | |
| 7747 | + | |
| 7748 | + | |
| 7749 | + | |
| 7750 | + | |
| 7751 | + | |
| 7752 | + | |
7749 | 7753 |
| |
7750 | 7754 |
| |
7751 | 7755 |
| |
|
0 commit comments
Comments
(0)