mirror of
https://github.com/postgres/postgres.git
synced 2025-11-26 23:43:30 +03:00
Apply fixes for problems with dropped columns whose types have also been
dropped. Add regression test, too.
This commit is contained in:
@@ -1166,3 +1166,44 @@ order by relname, attnum;
|
||||
drop table p1, p2 cascade;
|
||||
NOTICE: Drop cascades to table c1
|
||||
NOTICE: Drop cascades to table gc1
|
||||
-- test that operations with a dropped column do not try to reference
|
||||
-- its datatype
|
||||
create domain mytype as text;
|
||||
create temp table foo (f1 text, f2 mytype, f3 text);
|
||||
insert into foo values('aa','bb','cc');
|
||||
select * from foo;
|
||||
f1 | f2 | f3
|
||||
----+----+----
|
||||
aa | bb | cc
|
||||
(1 row)
|
||||
|
||||
drop domain mytype cascade;
|
||||
NOTICE: Drop cascades to table foo column f2
|
||||
select * from foo;
|
||||
f1 | f3
|
||||
----+----
|
||||
aa | cc
|
||||
(1 row)
|
||||
|
||||
insert into foo values('qq','rr');
|
||||
select * from foo;
|
||||
f1 | f3
|
||||
----+----
|
||||
aa | cc
|
||||
qq | rr
|
||||
(2 rows)
|
||||
|
||||
update foo set f3 = 'zz';
|
||||
select * from foo;
|
||||
f1 | f3
|
||||
----+----
|
||||
aa | zz
|
||||
qq | zz
|
||||
(2 rows)
|
||||
|
||||
select f3,max(f1) from foo group by f3;
|
||||
f3 | max
|
||||
----+-----
|
||||
zz | qq
|
||||
(1 row)
|
||||
|
||||
|
||||
@@ -845,3 +845,21 @@ where relname in ('p1','p2','c1','gc1') and attnum > 0 and not attisdropped
|
||||
order by relname, attnum;
|
||||
|
||||
drop table p1, p2 cascade;
|
||||
|
||||
-- test that operations with a dropped column do not try to reference
|
||||
-- its datatype
|
||||
|
||||
create domain mytype as text;
|
||||
create temp table foo (f1 text, f2 mytype, f3 text);
|
||||
|
||||
insert into foo values('aa','bb','cc');
|
||||
select * from foo;
|
||||
|
||||
drop domain mytype cascade;
|
||||
|
||||
select * from foo;
|
||||
insert into foo values('qq','rr');
|
||||
select * from foo;
|
||||
update foo set f3 = 'zz';
|
||||
select * from foo;
|
||||
select f3,max(f1) from foo group by f3;
|
||||
|
||||
Reference in New Issue
Block a user