forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit1316be2
committed
Disallow LISTEN in background workers.
It's possible to execute user-defined SQL in some background processes;for example, logical replication workers can fire triggers. This opensthe possibility that someone would try to execute LISTEN in such acontext. But since only regular backends ever callProcessNotifyInterrupt, no messages would actually be received, andthus the registered listener would simply prevent the message queuefrom being cleaned. Eventually NOTIFY would stop working, which is bad.Perhaps someday somebody will invent infrastructure to make listeningin a background worker actually useful. In the meantime, forbid it.Back-patch to v13, which is where we introduced the MyBackendTypevariable. It'd be a lot harder to implement the check without that,and it doesn't seem worth the trouble.Discussion:https://postgr.es/m/153243441449.1404.2274116228506175596@wrigleys.postgresql.org1 parente581360 commit1316be2
1 file changed
+17
-0
lines changedLines changed: 17 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
803 | 803 |
| |
804 | 804 |
| |
805 | 805 |
| |
| 806 | + | |
| 807 | + | |
| 808 | + | |
| 809 | + | |
| 810 | + | |
| 811 | + | |
| 812 | + | |
| 813 | + | |
| 814 | + | |
| 815 | + | |
| 816 | + | |
| 817 | + | |
| 818 | + | |
| 819 | + | |
| 820 | + | |
| 821 | + | |
| 822 | + | |
806 | 823 |
| |
807 | 824 |
| |
808 | 825 |
| |
|
0 commit comments
Comments
(0)