From a40b1e0bf32b1da46c1baa9bc7da87f207cd37d8 Mon Sep 17 00:00:00 2001 From: Robert Haas Date: Thu, 27 Jan 2011 08:35:34 -0500 Subject: Restore ALTER TABLE .. ADD COLUMN w/DEFAULT restriction. This reverts commit a06e41deebdf74b8b5109329dc75b2e9d9057962 of 2011-01-26. Per discussion, this behavior is not wanted, as it would need to change if we ever made composite types support DEFAULT. --- src/test/regress/expected/rowtypes.out | 9 +++------ src/test/regress/sql/rowtypes.sql | 8 ++------ 2 files changed, 5 insertions(+), 12 deletions(-) (limited to 'src/test') diff --git a/src/test/regress/expected/rowtypes.out b/src/test/regress/expected/rowtypes.out index 3d5f4d6c95b..e5cd71421c6 100644 --- a/src/test/regress/expected/rowtypes.out +++ b/src/test/regress/expected/rowtypes.out @@ -82,14 +82,11 @@ select * from people; (Joe,Blow) | 01-10-1984 (1 row) --- the default doesn't need to propagate through to the rowtypes, so this is OK +-- at the moment this will not work due to ALTER TABLE inadequacy: alter table fullname add column suffix text default ''; -alter table fullname drop column suffix; --- this one, without a default, is OK too -alter table fullname add column suffix text default null; --- but this should fail, due to ALTER TABLE inadequacy -alter table fullname alter column suffix set data type integer using null; ERROR: cannot alter table "fullname" because column "people"."fn" uses its rowtype +-- but this should work: +alter table fullname add column suffix text default null; select * from people; fn | bd -------------+------------ diff --git a/src/test/regress/sql/rowtypes.sql b/src/test/regress/sql/rowtypes.sql index 257213d969e..9041df147fe 100644 --- a/src/test/regress/sql/rowtypes.sql +++ b/src/test/regress/sql/rowtypes.sql @@ -45,16 +45,12 @@ insert into people values ('(Joe,Blow)', '1984-01-10'); select * from people; --- the default doesn't need to propagate through to the rowtypes, so this is OK +-- at the moment this will not work due to ALTER TABLE inadequacy: alter table fullname add column suffix text default ''; -alter table fullname drop column suffix; --- this one, without a default, is OK too +-- but this should work: alter table fullname add column suffix text default null; --- but this should fail, due to ALTER TABLE inadequacy -alter table fullname alter column suffix set data type integer using null; - select * from people; -- test insertion/updating of subfields -- cgit v1.2.3