Hi,

I've been looking at the dependency API and I notice that there is a
function to delete ALL dependencies on an object and a function to add a
dependency, but there doesn't seem to be any way of deleting a dependency
between two _particular_ objects.

Is there any other way of doing this other than manually deleting the row
from the pg_depend table?

I'm messing about with changing column type and I need to drop the
dependency on the old type and add the dependency on the new type....

Chris



Thu, 20 Feb 2003 14:13:43 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
deleting dependencies
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> I've been looking at the dependency API and I notice that there is a
> function to delete ALL dependencies on an object and a function to add a
> dependency, but there doesn't seem to be any way of deleting a dependency
> between two _particular_ objects.

In the ALTER cases that have been implemented so far, it seemed easiest
to wipe the full set of dependencies and then regenerate them from the
altered object.  I think you will find the same is true of altering
column type.  To take just one example, the column default expression
(if any) almost certainly has to be replaced too, and it may contain
dependencies.

			regards, tom lane

Thu, 20 Feb 2003 10:09:21 -0500
Tom Lane <tgl@sss.pgh.pa.us>
Re: deleting dependencies 
> "Christopher Kings-Lynne" <chriskl@familyhealth.com.au> writes:
> > I've been looking at the dependency API and I notice that there is a
> > function to delete ALL dependencies on an object and a function to add a
> > dependency, but there doesn't seem to be any way of deleting a
dependency
> > between two _particular_ objects.
>
> In the ALTER cases that have been implemented so far, it seemed easiest
> to wipe the full set of dependencies and then regenerate them from the
> altered object.  I think you will find the same is true of altering
> column type.  To take just one example, the column default expression
> (if any) almost certainly has to be replaced too, and it may contain
> dependencies.

Phase 1 (which I'm currently doing) will do binary-compatible casts only.
After that, I have to start using code from cluster.c to rewrite the table
methinks...and everything gets a *lot* harder...

Chris



Fri, 21 Feb 2003 09:50:14 +0800
"Christopher Kings-Lynne" <chriskl@familyhealth.com.au>
Re: deleting dependencies 