[ https://issues.apache.org/jira/browse/HAWQ-231?page=com.atlassian.jira.plugin.system.issuetabpanels:all-tabpanel ]
Paul Guo closed HAWQ-231. ------------------------- Resolution: Not A Problem Assignee: Paul Guo (was: Lei Chang) Latest pg behaves like this also. It looks like that is due to hidden columns in pg table, see. https://www.postgresql.org/docs/9.4/static/ddl-system-columns.html Though from user's perspective, it is better to say 0 rows in the test case. Let's follow pg by now since this is not a big issue. > Alter table by drop all columns of it, then it has some interesting problems > ---------------------------------------------------------------------------- > > Key: HAWQ-231 > URL: https://issues.apache.org/jira/browse/HAWQ-231 > Project: Apache HAWQ > Issue Type: Bug > Components: Storage > Reporter: Dong Li > Assignee: Paul Guo > Fix For: backlog > > > It is a design behavior problem. > When we drop all the columns, should it truncate the table? > Otherwise if the count of invisible rows has meaning. > You can not see anything, but it shows that there are 1000 rows here. > I know that in storage view and design view it is ok. > But in user view, it may be puzzled. > {code} > intern=# create table alterall (i int, j int); > CREATE TABLE > intern=# insert into alterall VALUES > (generate_series(1,1000),generate_series(1,2)); > INSERT 0 1000 > intern=# alter table alterall drop COLUMN i; > ALTER TABLE > intern=# alter TABLE alterall drop COLUMN j; > ALTER TABLE > intern=# select * from alterall ; > -- > (1000 rows) > intern=# alter TABLE alterall add column k int default 3; > ALTER TABLE > intern=# select * from alterall; > k > --- > 3 > 3 > 3 > 3 > 3 > 3 > 3 > ... > (1000 rows) > {code} -- This message was sent by Atlassian JIRA (v6.3.4#6332)