Disallow deletion of CurrentExtensionObject while running extension script.
authorTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Nov 2011 00:12:17 +0000 (19:12 -0500)
committerTom Lane <tgl@sss.pgh.pa.us>
Tue, 29 Nov 2011 00:12:17 +0000 (19:12 -0500)
commit871dd024a6adf7766702b1cdacfb02bd8002d2bb
treebef66a5b4569c410ff49a4504fc6cefa71652089
parent269755ef725aa331fb2e49e33b23f38241d2a13b
Disallow deletion of CurrentExtensionObject while running extension script.

While the deletion in itself wouldn't break things, any further creation
of objects in the script would result in dangling pg_depend entries being
added by recordDependencyOnCurrentExtension().  An example from Phil
Sorber convinced me that this is just barely likely enough to be worth
expending a couple lines of code to defend against.  The resulting error
message might be confusing, but it's better than leaving corrupted catalog
contents for the user to deal with.
src/backend/commands/extension.c