postgresql/src/backend/commands
Tom Lane 08dd23cec7 Fix some issues with temp/transient tables in extension scripts.
Phil Sorber reported that a rewriting ALTER TABLE within an extension
update script failed, because it creates and then drops a placeholder
table; the drop was being disallowed because the table was marked as an
extension member.  We could hack that specific case but it seems likely
that there might be related cases now or in the future, so the most
practical solution seems to be to create an exception to the general rule
that extension member objects can only be dropped by dropping the owning
extension.  To wit: if the DROP is issued within the extension's own
creation or update scripts, we'll allow it, implicitly performing an
"ALTER EXTENSION DROP object" first.  This will simplify cases such as
extension downgrade scripts anyway.

No docs change since we don't seem to have documented the idea that you
would need ALTER EXTENSION DROP for such an action to begin with.

Also, arrange for explicitly temporary tables to not get linked as
extension members in the first place, and the same for the magic
pg_temp_nnn schemas that are created to hold them.  This prevents assorted
unpleasant results if an extension script creates a temp table: the forced
drop at session end would either fail or remove the entire extension, and
neither of those outcomes is desirable.  Note that this doesn't fix the
ALTER TABLE scenario, since the placeholder table is not temp (unless the
table being rewritten is).

Back-patch to 9.1.
2012-03-08 15:53:09 -05:00
..
Makefile Consolidate DROP handling for some object types. 2011-10-19 23:27:19 -04:00
aggregatecmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
alter.c Disallow ALTER DOMAIN on non-domain type everywhere 2012-01-27 21:20:34 +02:00
analyze.c Collect and use element-frequency statistics for arrays. 2012-03-03 20:20:57 -05:00
async.c Add some enumeration commas, for consistency 2012-02-24 11:04:45 +02:00
cluster.c Classify DROP operations by whether or not they are user-initiated. 2012-01-26 09:30:27 -05:00
collationcmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
comment.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
constraint.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
conversioncmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
copy.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
dbcommands.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
define.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
discard.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
dropcmds.c Classify DROP operations by whether or not they are user-initiated. 2012-01-26 09:30:27 -05:00
explain.c Make EXPLAIN (BUFFERS) track blocks dirtied, as well as those written. 2012-02-22 20:33:05 -05:00
extension.c Fix typo in comment. 2012-02-22 19:46:12 -05:00
foreigncmds.c Remove inappropriate quotes 2012-02-23 12:52:17 +02:00
functioncmds.c Allow LEAKPROOF functions for better performance of security views. 2012-02-13 22:21:14 -05:00
indexcmds.c Damage control for yesterday's CheckIndexCompatible changes. 2012-01-26 08:21:31 -05:00
lockcmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
opclasscmds.c Classify DROP operations by whether or not they are user-initiated. 2012-01-26 09:30:27 -05:00
operatorcmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
portalcmds.c Run a portal's cleanup hook immediately when pushing it to FAILED state. 2012-02-15 16:19:01 -05:00
prepare.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
proclang.c Allow LEAKPROOF functions for better performance of security views. 2012-02-13 22:21:14 -05:00
schemacmds.c Fix some issues with temp/transient tables in extension scripts. 2012-03-08 15:53:09 -05:00
seclabel.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
sequence.c Fix transient clobbering of shared buffers during WAL replay. 2012-02-05 15:49:17 -05:00
tablecmds.c ALTER TABLE: skip FK validation when it's safe to do so 2012-02-27 19:10:24 -03:00
tablespace.c Avoid throwing ERROR during WAL replay of DROP TABLESPACE. 2012-02-06 14:44:41 -05:00
trigger.c Require execute permission on the trigger function for CREATE TRIGGER. 2012-02-23 15:38:56 -05:00
tsearchcmds.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
typecmds.c Collect and use element-frequency statistics for arrays. 2012-03-03 20:20:57 -05:00
user.c Make superuser imply replication privilege. The idea of a privilege that 2012-01-14 18:22:16 +02:00
vacuum.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
vacuumlazy.c Fix broken logic in lazy_vacuum_heap. 2012-01-13 08:22:31 -05:00
variable.c Update copyright notices for year 2012. 2012-01-01 18:01:58 -05:00
view.c Remove useless const qualifier 2012-02-26 15:22:27 +02:00