Bug #759: 7.3beta1 DROP COLUMN DEPENDENCY PROBLEM

From: pgsql-bugs(at)postgresql(dot)org
To: pgsql-bugs(at)postgresql(dot)org
Subject: Bug #759: 7.3beta1 DROP COLUMN DEPENDENCY PROBLEM
Date: 2002-09-06 08:31:36
Message-ID: 20020906083136.BB12F476483@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

Tim Knowles (tim(at)ametco(dot)co(dot)uk) reports a bug with a severity of 3
The lower the number the more severe it is.

Short Description
7.3beta1 DROP COLUMN DEPENDENCY PROBLEM

Long Description
Hi,

Been playing with the 7.3beta1 version and I've noticed a small problem with dependency checking when dropping a column. If you have a view which uses JOIN's to join tables then dropping a column will fail on a dependency check, even though the column being dropped is not used at all in the view. If you join the tables in the WHERE clause the column can be dropped without problems.

Please see below some example SQL to demonstrate:

Sample Code
-- wrap it all up in a transaction so we don't do anything permanent

BEGIN;

CREATE TABLE table1 (col_a text, col_b int);
CREATE TABLE table2 (col_b int, col_c text);

CREATE VIEW tester1 AS SELECT A.col_a,B.col_b FROM table1 A, table2 B WHERE (b.col_b=a.col_b);

CREATE VIEW tester2 AS SELECT A.col_a,B.col_b FROM table2 B INNER JOIN table1 A ON (b.col_b=a.col_b);

--Now try and drop column col_c from table2
ALTER TABLE table2 DROP COLUMN col_c RESTRICT;

--You should now get an error to say that col_c is a dependent object in view tester2

ROLLBACK;

No file was uploaded with this report

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message Rod Taylor 2002-09-06 12:25:45 Re: Bug #759: 7.3beta1 DROP COLUMN DEPENDENCY PROBLEM
Previous Message Bruno Wolff III 2002-09-06 04:59:48 atan2 documentation bugs for 7.3 and 7.2