|
8 | 8 | * |
9 | 9 | * |
10 | 10 | * IDENTIFICATION |
11 | | - * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.148 2007/07/27 19:09:04 neilc Exp $ |
| 11 | + * $PostgreSQL: pgsql/src/backend/executor/execUtils.c,v 1.149 2007/07/31 16:36:07 tgl Exp $ |
12 | 12 | * |
13 | 13 | *------------------------------------------------------------------------- |
14 | 14 | */ |
@@ -816,15 +816,14 @@ ExecOpenScanRelation(EState *estate, Index scanrelid) |
816 | 816 | LOCKMODElockmode; |
817 | 817 |
|
818 | 818 | /* |
819 | | - * Determine the lock type we need. First, scan to see if target |
820 | | - * relation is a result relation. |
| 819 | + * Determine the lock type we need. First, scan to see if target relation |
| 820 | + * is a result relation. If not, check if it's a FOR UPDATE/FOR SHARE |
| 821 | + * relation. In either of those cases, we got the lock already. |
821 | 822 | */ |
822 | 823 | lockmode=AccessShareLock; |
823 | 824 | if (ExecRelationIsTargetRelation(estate,scanrelid)) |
824 | 825 | lockmode=NoLock; |
825 | | - |
826 | | -/* If not, check if it's a FOR UPDATE/FOR SHARE relation */ |
827 | | -if (lockmode==AccessShareLock) |
| 826 | +else |
828 | 827 | { |
829 | 828 | ListCell*l; |
830 | 829 |
|
|