forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commitc3afe8c
committed
Add new predefined role pg_create_subscription.
This role can be granted to non-superusers to allow them to issueCREATE SUBSCRIPTION. The non-superuser must additionally have CREATEpermissions on the database in which the subscription is to becreated.Most forms of ALTER SUBSCRIPTION, including ALTER SUBSCRIPTION .. SKIP,now require only that the role performing the operation own thesubscription, or inherit the privileges of the owner. However, touse ALTER SUBSCRIPTION ... RENAME or ALTER SUBSCRIPTION ... OWNER TO,you also need CREATE permission on the database. This is similar towhat we do for schemas. To change the owner of a schema, you must alsohave permission to SET ROLE to the new owner, similar to what we dofor other object types.Non-superusers are required to specify a password for authenticationand the remote side must use the password, similar to what is requiredfor postgres_fdw and dblink. A superuser who wants a non-superuser toown a subscription that does not rely on password authentication mayset the new password_required=false property on that subscription. Anon-superuser may not set password_required=false and may not modify asubscription that already has password_required=false.This new password_required subscription property works much like theeponymous postgres_fdw property. In both cases, the actual semanticsare that a password is not required if either (1) the property is setto false or (2) the relevant user is the superuser.Patch by me, reviewed by Andres Freund, Jeff Davis, Mark Dilger,and Stephen Frost (but some of those people did not fully endorseall of the decisions that the patch makes).Discussion:http://postgr.es/m/CA+TgmoaDH=0Xj7OBiQnsHTKcF2c4L+=gzPBUKSJLh8zed2_+Dg@mail.gmail.com1 parentb0e9e4d commitc3afe8c
File tree
21 files changed
+384
-60
lines changed- doc/src/sgml
- ref
- src
- backend
- catalog
- commands
- replication
- libpqwalreceiver
- logical
- bin/pg_dump
- include
- catalog
- replication
- test
- regress
- expected
- sql
- subscription/t
21 files changed
+384
-60
lines changedLines changed: 9 additions & 7 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
46 | 46 |
| |
47 | 47 |
| |
48 | 48 |
| |
49 |
| - | |
50 |
| - | |
51 |
| - | |
52 |
| - | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
53 | 54 |
| |
54 | 55 |
| |
55 | 56 |
| |
| |||
223 | 224 |
| |
224 | 225 |
| |
225 | 226 |
| |
226 |
| - | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
227 | 230 |
| |
228 | 231 |
| |
229 | 232 |
| |
| |||
244 | 247 |
| |
245 | 248 |
| |
246 | 249 |
| |
247 |
| - | |
248 |
| - | |
| 250 | + | |
249 | 251 |
| |
250 | 252 |
| |
251 | 253 |
| |
|
Lines changed: 21 additions & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
33 | 33 |
| |
34 | 34 |
| |
35 | 35 |
| |
36 |
| - | |
| 36 | + | |
| 37 | + | |
37 | 38 |
| |
38 | 39 |
| |
39 | 40 |
| |
| |||
49 | 50 |
| |
50 | 51 |
| |
51 | 52 |
| |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
52 | 59 |
| |
53 | 60 |
| |
54 | 61 |
| |
| |||
365 | 372 |
| |
366 | 373 |
| |
367 | 374 |
| |
| 375 | + | |
| 376 | + | |
| 377 | + | |
| 378 | + | |
| 379 | + | |
| 380 | + | |
| 381 | + | |
| 382 | + | |
| 383 | + | |
| 384 | + | |
| 385 | + | |
| 386 | + | |
| 387 | + | |
368 | 388 |
| |
369 | 389 |
| |
370 | 390 |
| |
|
Lines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
34 | 34 |
| |
35 | 35 |
| |
36 | 36 |
| |
37 |
| - | |
| 37 | + | |
38 | 38 |
| |
39 | 39 |
| |
40 | 40 |
| |
|
Lines changed: 6 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
699 | 699 |
| |
700 | 700 |
| |
701 | 701 |
| |
| 702 | + | |
| 703 | + | |
| 704 | + | |
| 705 | + | |
| 706 | + | |
| 707 | + | |
702 | 708 |
| |
703 | 709 |
| |
704 | 710 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
71 | 71 |
| |
72 | 72 |
| |
73 | 73 |
| |
| 74 | + | |
74 | 75 |
| |
75 | 76 |
| |
76 | 77 |
| |
|
Lines changed: 1 addition & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1318 | 1318 |
| |
1319 | 1319 |
| |
1320 | 1320 |
| |
| 1321 | + | |
1321 | 1322 |
| |
1322 | 1323 |
| |
1323 | 1324 |
| |
|
Lines changed: 24 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
24 | 24 |
| |
25 | 25 |
| |
26 | 26 |
| |
| 27 | + | |
27 | 28 |
| |
28 | 29 |
| |
29 | 30 |
| |
| |||
235 | 236 |
| |
236 | 237 |
| |
237 | 238 |
| |
| 239 | + | |
| 240 | + | |
| 241 | + | |
| 242 | + | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
| 248 | + | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
| 254 | + | |
| 255 | + | |
| 256 | + | |
| 257 | + | |
| 258 | + | |
| 259 | + | |
| 260 | + | |
| 261 | + | |
238 | 262 |
| |
239 | 263 |
| |
240 | 264 |
| |
|
0 commit comments
Comments
(0)