Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
Skip to content

Commit 6398bae

Browse files
x4mCommitfest Bot
authored and
Commitfest Bot
committed
Simplify recovery after dropping a table by giving restore LSN in logs
Hacked online on postgres.tv by Nik, Kirk and Andrey.
1 parent 890fc82 commit 6398bae

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

src/backend/catalog/dependency.c

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1507,6 +1507,14 @@ AcquireDeletionLock(const ObjectAddress *object, int flags)
15071507
LockRelationOid(object->objectId, ShareUpdateExclusiveLock);
15081508
else
15091509
LockRelationOid(object->objectId, AccessExclusiveLock);
1510+
1511+
if (get_rel_relkind(object->objectId) == RELKIND_RELATION ||
1512+
get_rel_relkind(object->objectId) == RELKIND_PARTITIONED_TABLE)
1513+
{
1514+
XLogRecPtr ptr = GetInsertRecPtr();
1515+
char *relname = get_rel_name(object->objectId);
1516+
elog(LOG, "Aquired drop table lock on table %s. Restore at %X/%X", relname, (uint32)(ptr >> 32), (uint32) ptr);
1517+
}
15101518
}
15111519
else if (object->classId == AuthMemRelationId)
15121520
LockSharedObject(object->classId, object->objectId, 0,

0 commit comments

Comments
 (0)