forked frompostgres/postgres
- Notifications
You must be signed in to change notification settings - Fork6
Commit952365c
committed
Remove unnecessary GetTransactionSnapshot() calls
In get_database_list() and get_subscription_list(), theGetTransactionSnapshot() call is not required because the catalogtable scans use the catalog snapshot, which is held until the end ofthe scan. See table_beginscan_catalog(), which callsRegisterSnapshot(GetCatalogSnapshot(relid)).In InitPostgres, it's a little less obvious that it's not required,but still true I believe. All the catalog lookups in InitPostgres()also use the catalog snapshot, and the looked up values are copiedwhile still holding the snapshot.Furthermore, as the removed FIXME comments said, callingGetTransactionSnapshot() didn't really prevent MyProc->xmin from beingreset anyway.Discussion:https://www.postgresql.org/message-id/7c56f180-b9e1-481e-8c1d-efa63de3ecbb@iki.fi1 parent7ec4b9f commit952365c
File tree
3 files changed
+3
-32
lines changed- src/backend
- postmaster
- replication/logical
- utils/init
3 files changed
+3
-32
lines changedLines changed: 1 addition & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
1799 | 1799 |
| |
1800 | 1800 |
| |
1801 | 1801 |
| |
1802 |
| - | |
1803 |
| - | |
1804 |
| - | |
1805 |
| - | |
1806 |
| - | |
1807 |
| - | |
1808 |
| - | |
1809 |
| - | |
1810 |
| - | |
| 1802 | + | |
1811 | 1803 |
| |
1812 | 1804 |
| |
1813 |
| - | |
1814 | 1805 |
| |
1815 | 1806 |
| |
1816 | 1807 |
| |
|
Lines changed: 1 addition & 10 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
121 | 121 |
| |
122 | 122 |
| |
123 | 123 |
| |
124 |
| - | |
125 |
| - | |
126 |
| - | |
127 |
| - | |
128 |
| - | |
129 |
| - | |
130 |
| - | |
131 |
| - | |
132 |
| - | |
| 124 | + | |
133 | 125 |
| |
134 | 126 |
| |
135 |
| - | |
136 | 127 |
| |
137 | 128 |
| |
138 | 129 |
| |
|
Lines changed: 1 addition & 12 deletions
Original file line number | Diff line number | Diff line change | |
---|---|---|---|
| |||
813 | 813 |
| |
814 | 814 |
| |
815 | 815 |
| |
816 |
| - | |
817 |
| - | |
818 |
| - | |
819 |
| - | |
820 |
| - | |
821 |
| - | |
822 |
| - | |
823 |
| - | |
824 |
| - | |
825 |
| - | |
| 816 | + | |
826 | 817 |
| |
827 | 818 |
| |
828 | 819 |
| |
| |||
837 | 828 |
| |
838 | 829 |
| |
839 | 830 |
| |
840 |
| - | |
841 |
| - | |
842 | 831 |
| |
843 | 832 |
| |
844 | 833 |
| |
|
0 commit comments
Comments
(0)