Skip site navigation (1) Skip section navigation (2)

Re: BUG #6172: DROP EXTENSION error without CASCADE

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr>
Cc: "Hitoshi Harada" <umi(dot)tanuki(at)gmail(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: BUG #6172: DROP EXTENSION error without CASCADE
Date: 2011-08-22 13:52:40
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-bugs
Dimitri Fontaine <dimitri(at)2ndQuadrant(dot)fr> writes:
> But in makeOperatorDependencies() we find the following piece of code:

> 	/* In case we are updating a shell, delete any existing entries */
> 	deleteDependencyRecordsFor(myself.classId, myself.objectId, false);

> false is for bool skipExtensionDeps.

> And now at the end of the same function, dependency is recorded back,
> except in some case:

> 			oldext = getExtensionOfObject(object->classId, object->objectId);
> 			if (OidIsValid(oldext))
> 			{
> 				/* If already a member of this extension, nothing to do */
> 				if (oldext == CurrentExtensionObject)
> 					return;

> The problem lies in catalog scans and SnapshotNow, I think.

[ light goes on... ]  We need a CommandCounterIncrement in there.
Else, the code that looks to see if the object is already part of the
extension does not see the pg_depend row as deleted (yet).

Not sure offhand where the cleanest place to put it is.

			regards, tom lane

In response to

pgsql-bugs by date

Next:From: Kevin GrittnerDate: 2011-08-22 13:53:12
Subject: Re: BUG #6171: Sockets Issue
Previous:From: Tom LaneDate: 2011-08-22 13:27:03
Subject: Re: BUG #6171: Sockets Issue

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group