|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.132 2002/09/04 20:31:13 momjian Exp $ |
| 11 | + * $Header: /cvsroot/pgsql/src/backend/access/transam/xact.c,v 1.133 2002/10/21 19:46:45 tgl Exp $ |
12 | 12 | * |
13 | 13 | * NOTES |
14 | 14 | *Transaction aborts can now occur two ways: |
|
167 | 167 | #include"catalog/namespace.h" |
168 | 168 | #include"commands/async.h" |
169 | 169 | #include"commands/trigger.h" |
| 170 | +#include"commands/user.h" |
170 | 171 | #include"executor/spi.h" |
171 | 172 | #include"libpq/be-fsstubs.h" |
172 | 173 | #include"miscadmin.h" |
@@ -959,18 +960,25 @@ CommitTransaction(void) |
959 | 960 | s->state=TRANS_COMMIT; |
960 | 961 |
|
961 | 962 | /* |
962 | | - * do commit processing |
| 963 | + * Do pre-commit processing (most of this stuff requires database |
| 964 | + * access, and in fact could still cause an error...) |
963 | 965 | */ |
964 | 966 |
|
| 967 | +AtEOXact_portals(); |
| 968 | + |
965 | 969 | /* handle commit for large objects [ PA, 7/17/98 ] */ |
| 970 | +/* XXX probably this does not belong here */ |
966 | 971 | lo_commit(true); |
967 | 972 |
|
968 | | -/* NOTIFY commit mustalsocome before lower-level cleanup */ |
| 973 | +/* NOTIFY commit must come before lower-level cleanup */ |
969 | 974 | AtCommit_Notify(); |
970 | 975 |
|
971 | | -AtEOXact_portals(); |
| 976 | +/* Update the flat password file if we changed pg_shadow or pg_group */ |
| 977 | +AtEOXact_UpdatePasswordFile(true); |
972 | 978 |
|
973 | | -/* Here is where we really truly commit. */ |
| 979 | +/* |
| 980 | + * Here is where we really truly commit. |
| 981 | + */ |
974 | 982 | RecordTransactionCommit(); |
975 | 983 |
|
976 | 984 | /* |
@@ -1013,7 +1021,6 @@ CommitTransaction(void) |
1013 | 1021 | AtEOXact_CatCache(true); |
1014 | 1022 | AtCommit_Memory(); |
1015 | 1023 | AtEOXact_Buffers(true); |
1016 | | -smgrabort(); |
1017 | 1024 | AtEOXact_Files(); |
1018 | 1025 |
|
1019 | 1026 | /* Count transaction commit in statistics collector */ |
@@ -1080,9 +1087,10 @@ AbortTransaction(void) |
1080 | 1087 | * do abort processing |
1081 | 1088 | */ |
1082 | 1089 | DeferredTriggerAbortXact(); |
| 1090 | +AtEOXact_portals(); |
1083 | 1091 | lo_commit(false);/* 'false' means it's abort */ |
1084 | 1092 | AtAbort_Notify(); |
1085 | | -AtEOXact_portals(); |
| 1093 | +AtEOXact_UpdatePasswordFile(false); |
1086 | 1094 |
|
1087 | 1095 | /* Advertise the fact that we aborted in pg_clog. */ |
1088 | 1096 | RecordTransactionAbort(); |
@@ -1114,6 +1122,7 @@ AbortTransaction(void) |
1114 | 1122 | AtEOXact_CatCache(false); |
1115 | 1123 | AtAbort_Memory(); |
1116 | 1124 | AtEOXact_Buffers(false); |
| 1125 | +smgrabort(); |
1117 | 1126 | AtEOXact_Files(); |
1118 | 1127 | AtAbort_Locks(); |
1119 | 1128 |
|
|