postgresql7.1 select case when exists (select 1 from acs_attributes a, acs_object_types t where t.dynamic_p = 't' and a.object_type = t.object_type and a.attribute_id = :value) then 1 else 0 end select case when exists (select 1 from acs_attributes a where (a.attribute_name = :attribute or a.column_name = :attribute) and a.object_type = :object_type) then 1 else 0 end select coalesce(a.column_name, a.attribute_name) as name, a.pretty_name, a.attribute_id, a.datatype, v.enum_value, v.pretty_name as value_pretty_name from acs_object_type_attributes a left outer join acs_enum_values v using (attribute_id), (select t.object_type, tree_level(tree_sortkey) - (select tree_level(tree_sortkey) from acs_object_types where object_type = :start_with) as type_level from acs_object_types t where tree_sortkey like (select tree_sortkey from acs_object_types where object_type = :start_with) || '%') t where a.object_type = :object_type and t.object_type = a.ancestor_type $storage_clause order by type_level, a.sort_order select * from ($package_object_view) dummy where object_id = :object_id select acs_attribute__drop_attribute(:object_type, :attribute_name) select acs_attribute__create_attribute ( '$object_type', '$attribute_name', '$datatype', '$pretty_name', '$pretty_plural', NULL, NULL, '$default_value', '$min_n_values', '$max_n_values', NULL, 'type_specific', 'f' ); alter table $table_name drop column $attribute_name alter table $table_name add $attribute_name $sql_type select acs_attribute__drop_attribute(:object_type, :attribute_name) alter table $table_name rename column $column_name to __DELETED__$column_name