DROP COLUMN round 4

From: "Christopher Kings-Lynne" <chriskl(at)familyhealth(dot)com(dot)au>
To: "Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: DROP COLUMN round 4
Date: 2002-07-30 06:55:35
Message-ID: GNELIHDDFBOCMGBFGEFOGEGKCDAA.chriskl@familyhealth.com.au
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches

Hi All,

This is another cut of the DROP COLUMN patch. I have split the drop
function into two parts - and now handle dependencies.

Problems:

1. It cascade deletes objects, but it _always_ cascades, no matter what
behaviour I specify. Also, it doesn't give me indications that it's cascade
deleted an object.

2. I get this in my regression tests:

+ -- test inheritance
+ create table parent (a int, b int, c int);
+ insert into parent values (1, 2, 3);
+ alter table parent drop a;
+ create table child (d varchar(255)) inherits (parent);
+ insert into child values (12, 13, 'testing');
+ select * from parent;
+ b | c
+ ----+----
+ 2 | 3
+ 12 | 13
+ (2 rows)
+
+ select * from child;
+ b | c | d
+ ----+----+---------
+ 12 | 13 | testing
+ (1 row)
+
+ alter table parent drop c;
+ select * from parent;
+ b
+ ----
+ 2
+ 12
+ (2 rows)
+
+ select * from child;
+ b | d
+ ----+---------
+ 12 | testing
+ (1 row)
+
+ drop table child;
+ ERROR: RelationForgetRelation: relation 143905 is still open
+ drop table parent;
+ NOTICE: table child depends on table parent
+ ERROR: Cannot drop table parent because other objects depend on it
+ Use DROP ... CASCADE to drop the dependent objects too

What's with the RelationForgetRelation error??? Am I not closing some
handle somewhere?

Lastly, do we want new SearchSysCache functions or not? I'd be more than
happy for Tom or someone to take this patch off my hands and polish it off -
especially since it's required for proper dependency handling and the beta
date is approaching...

Chris

Attachment Content-Type Size
dropcolumn4.txt.gz application/x-gzip 16.0 KB

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Oleg Bartunov 2002-07-30 07:06:03 Re: Weird manual page
Previous Message eutm 2002-07-30 06:41:04 Patch for "Bug of PL/pgSQL parser"

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2002-07-30 16:08:32 Re: More heap tuple header fixes
Previous Message Christopher Kings-Lynne 2002-07-30 06:00:46 Re: Proposal: stand-alone composite types