forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commite83d1b0
committed
Add support event triggers on authenticated login
This commit introduces trigger on login event, allowing to fire some actionsright on the user connection. This can be useful for logging or connectioncheck purposes as well as for some personalization of environment. Usagedetails are described in the documentation included, but shortly usage isthe same as for other triggers: create function returning event_trigger andthen create event trigger on login event.In order to prevent the connection time overhead when there are no triggersthe commit introduces pg_database.dathasloginevt flag, which indicates databasehas active login triggers. This flag is set by CREATE/ALTER EVENT TRIGGERcommand, and unset at connection time when no active triggers found.Author: Konstantin Knizhnik, Mikhail GribkovDiscussion:https://postgr.es/m/0d46d29f-4558-3af9-9c85-7774e14a7709%40postgrespro.ruReviewed-by: Pavel Stehule, Takayuki Tsunakawa, Greg Nancarrow, Ivan PanchenkoReviewed-by: Daniel Gustafsson, Teodor Sigaev, Robert Haas, Andres FreundReviewed-by: Tom Lane, Andrey Sokolov, Zhihong Yu, Sergey ShinderukReviewed-by: Gregory Stark, Nikita Malakhov, Ted Yu1 parentc558e6f commite83d1b0
File tree
25 files changed
+644
-21
lines changed- doc/src/sgml
- src
- backend
- commands
- storage/lmgr
- tcop
- utils
- cache
- init
- bin
- pg_dump
- psql
- include
- catalog
- commands
- storage
- tcop
- utils
- test
- authentication/t
- recovery/t
- regress
- expected
- sql
25 files changed
+644
-21
lines changedLines changed: 1 addition & 1 deletion
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
184 | 184 |
| |
185 | 185 |
| |
186 | 186 |
| |
187 |
| - | |
| 187 | + | |
188 | 188 |
| |
189 | 189 |
| |
190 | 190 |
| |
|
Lines changed: 13 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
3035 | 3035 |
| |
3036 | 3036 |
| |
3037 | 3037 |
| |
| 3038 | + | |
| 3039 | + | |
| 3040 | + | |
| 3041 | + | |
| 3042 | + | |
| 3043 | + | |
| 3044 | + | |
| 3045 | + | |
| 3046 | + | |
| 3047 | + | |
| 3048 | + | |
| 3049 | + | |
| 3050 | + | |
3038 | 3051 |
| |
3039 | 3052 |
| |
3040 | 3053 |
| |
|
Lines changed: 2 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
4769 | 4769 |
| |
4770 | 4770 |
| |
4771 | 4771 |
| |
| 4772 | + | |
4772 | 4773 |
| |
4773 | 4774 |
| |
4774 | 4775 |
| |
| |||
4793 | 4794 |
| |
4794 | 4795 |
| |
4795 | 4796 |
| |
| 4797 | + | |
4796 | 4798 |
| |
4797 | 4799 |
| |
4798 | 4800 |
| |
|
Lines changed: 94 additions & 0 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
28 | 28 |
| |
29 | 29 |
| |
30 | 30 |
| |
| 31 | + | |
31 | 32 |
| |
32 | 33 |
| |
33 | 34 |
| |
34 | 35 |
| |
35 | 36 |
| |
36 | 37 |
| |
37 | 38 |
| |
| 39 | + | |
| 40 | + | |
| 41 | + | |
| 42 | + | |
| 43 | + | |
| 44 | + | |
| 45 | + | |
| 46 | + | |
| 47 | + | |
| 48 | + | |
| 49 | + | |
| 50 | + | |
| 51 | + | |
| 52 | + | |
| 53 | + | |
| 54 | + | |
| 55 | + | |
| 56 | + | |
38 | 57 |
| |
39 | 58 |
| |
40 | 59 |
| |
| |||
1300 | 1319 |
| |
1301 | 1320 |
| |
1302 | 1321 |
| |
| 1322 | + | |
| 1323 | + | |
| 1324 | + | |
| 1325 | + | |
| 1326 | + | |
| 1327 | + | |
| 1328 | + | |
| 1329 | + | |
| 1330 | + | |
| 1331 | + | |
| 1332 | + | |
| 1333 | + | |
| 1334 | + | |
| 1335 | + | |
| 1336 | + | |
| 1337 | + | |
| 1338 | + | |
| 1339 | + | |
| 1340 | + | |
| 1341 | + | |
| 1342 | + | |
| 1343 | + | |
| 1344 | + | |
| 1345 | + | |
| 1346 | + | |
| 1347 | + | |
| 1348 | + | |
| 1349 | + | |
| 1350 | + | |
| 1351 | + | |
| 1352 | + | |
| 1353 | + | |
| 1354 | + | |
| 1355 | + | |
| 1356 | + | |
| 1357 | + | |
| 1358 | + | |
| 1359 | + | |
| 1360 | + | |
| 1361 | + | |
| 1362 | + | |
| 1363 | + | |
| 1364 | + | |
| 1365 | + | |
| 1366 | + | |
| 1367 | + | |
| 1368 | + | |
| 1369 | + | |
| 1370 | + | |
| 1371 | + | |
| 1372 | + | |
| 1373 | + | |
| 1374 | + | |
| 1375 | + | |
| 1376 | + | |
| 1377 | + | |
| 1378 | + | |
| 1379 | + | |
| 1380 | + | |
| 1381 | + | |
| 1382 | + | |
| 1383 | + | |
| 1384 | + | |
| 1385 | + | |
| 1386 | + | |
| 1387 | + | |
| 1388 | + | |
| 1389 | + | |
| 1390 | + | |
| 1391 | + | |
| 1392 | + | |
| 1393 | + | |
| 1394 | + | |
| 1395 | + | |
| 1396 | + | |
1303 | 1397 |
|
Lines changed: 11 additions & 6 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
116 | 116 |
| |
117 | 117 |
| |
118 | 118 |
| |
119 |
| - | |
| 119 | + | |
120 | 120 |
| |
121 | 121 |
| |
122 | 122 |
| |
| |||
680 | 680 |
| |
681 | 681 |
| |
682 | 682 |
| |
| 683 | + | |
683 | 684 |
| |
684 | 685 |
| |
685 | 686 |
| |
| |||
968 | 969 |
| |
969 | 970 |
| |
970 | 971 |
| |
971 |
| - | |
| 972 | + | |
972 | 973 |
| |
973 | 974 |
| |
974 | 975 |
| |
| |||
1375 | 1376 |
| |
1376 | 1377 |
| |
1377 | 1378 |
| |
| 1379 | + | |
1378 | 1380 |
| |
1379 | 1381 |
| |
1380 | 1382 |
| |
| |||
1603 | 1605 |
| |
1604 | 1606 |
| |
1605 | 1607 |
| |
1606 |
| - | |
| 1608 | + | |
1607 | 1609 |
| |
1608 | 1610 |
| |
1609 | 1611 |
| |
| |||
1817 | 1819 |
| |
1818 | 1820 |
| |
1819 | 1821 |
| |
1820 |
| - | |
| 1822 | + | |
1821 | 1823 |
| |
1822 | 1824 |
| |
1823 | 1825 |
| |
| |||
1927 | 1929 |
| |
1928 | 1930 |
| |
1929 | 1931 |
| |
1930 |
| - | |
| 1932 | + | |
1931 | 1933 |
| |
1932 | 1934 |
| |
1933 | 1935 |
| |
| |||
2693 | 2695 |
| |
2694 | 2696 |
| |
2695 | 2697 |
| |
2696 |
| - | |
| 2698 | + | |
2697 | 2699 |
| |
2698 | 2700 |
| |
2699 | 2701 |
| |
| |||
2778 | 2780 |
| |
2779 | 2781 |
| |
2780 | 2782 |
| |
| 2783 | + | |
| 2784 | + | |
| 2785 | + | |
2781 | 2786 |
| |
2782 | 2787 |
| |
2783 | 2788 |
| |
|
0 commit comments
Comments
(0)