+ * Emit a WAL record if acquisition of this lock needs to be replayed in a
+ * standby server. Only AccessExclusiveLocks can conflict with lock types
+ * that read-only transactions can acquire in a standby server.
+ *
+ * Make sure this definition matches the one in GetRunningTransactionLocks().
+ *
+ * First we prepare to log, then after lock acquired we issue log record.
+ */
+ if (lockmode >= AccessExclusiveLock &&
+ locktag->locktag_type == LOCKTAG_RELATION &&
+ !RecoveryInProgress() &&
+ XLogStandbyInfoActive())
+ {
+ LogAccessExclusiveLockPrepare();
+ log_lock = true;
+ }
+
+ /*