Skip to content

Commit

Permalink
Merge 0ffa0b3 into da737b2
Browse files Browse the repository at this point in the history
  • Loading branch information
mtuncer committed Feb 17, 2020
2 parents da737b2 + 0ffa0b3 commit 39f20ee
Show file tree
Hide file tree
Showing 3 changed files with 20 additions and 1 deletion.
7 changes: 6 additions & 1 deletion cstore_fdw.c
Expand Up @@ -1878,6 +1878,12 @@ ColumnList(RelOptInfo *baserel, Oid foreignTableId)
{
ListCell *neededColumnCell = NULL;
Var *column = NULL;
Form_pg_attribute attributeForm = TupleDescAttr(tupleDescriptor, columnIndex - 1);

if (attributeForm->attisdropped)
{
continue;
}

/* look for this column in the needed column list */
foreach(neededColumnCell, neededColumnList)
Expand All @@ -1890,7 +1896,6 @@ ColumnList(RelOptInfo *baserel, Oid foreignTableId)
}
else if (neededColumn->varattno == wholeRow)
{
Form_pg_attribute attributeForm = TupleDescAttr(tupleDescriptor, columnIndex - 1);
Index tableId = neededColumn->varno;

column = makeVar(tableId, columnIndex, attributeForm->atttypid,
Expand Down
12 changes: 12 additions & 0 deletions expected/alter.out
Expand Up @@ -127,6 +127,18 @@ SELECT * from test_alter_table;
1 | 4 | ABCDEF
(7 rows)

SELECT count(*) from test_alter_table;
count
-------
7
(1 row)

SELECT count(t.*) from test_alter_table t;
count
-------
7
(1 row)

-- unsupported default values
ALTER FOREIGN TABLE test_alter_table ADD COLUMN g boolean DEFAULT isfinite(current_date);
ALTER FOREIGN TABLE test_alter_table ADD COLUMN h DATE DEFAULT current_date;
Expand Down
2 changes: 2 additions & 0 deletions sql/alter.sql
Expand Up @@ -53,6 +53,8 @@ ALTER FOREIGN TABLE test_alter_table DROP COLUMN c;
ALTER FOREIGN TABLE test_alter_table DROP COLUMN e;
ANALYZE test_alter_table;
SELECT * from test_alter_table;
SELECT count(*) from test_alter_table;
SELECT count(t.*) from test_alter_table t;


-- unsupported default values
Expand Down

0 comments on commit 39f20ee

Please sign in to comment.