citusdata / cstore_fdw

Columnar storage extension for Postgres built as a foreign data wrapper. Check out https://github.com/citusdata/citus for a modernized columnar storage implementation built as a table access method.
Apache License 2.0
1.75k stars 171 forks source link

Creating other FDW table generates files in $PGDATA/cstore_fdw/(database's oid) #104

Open komamitsu opened 8 years ago

komamitsu commented 8 years ago

When I created a mysql_fdw table after setting up cstore_fdw, I found data file and footer file were generated in $PGDATA/cstore_fdw/(database's oid).

datatank=> CREATE SERVER mysql_server
datatank->      FOREIGN DATA WRAPPER mysql_fdw
datatank->      OPTIONS (host '127.0.0.1', port '3306');
CREATE SERVER
datatank=> CREATE USER MAPPING FOR postgres
datatank-> SERVER mysql_server
datatank-> OPTIONS (username 'foo', password 'bar');
CREATE USER MAPPING
datatank=> CREATE FOREIGN TABLE warehouse(
datatank(>    warehouse_id int,
datatank(>    warehouse_name text)
datatank-> SERVER mysql_server
datatank->      OPTIONS (dbname 'db', table_name 'warehouse');
CREATE FOREIGN TABLE
datatank=> select relfilenode from pg_class where relname = 'warehouse' and relkind = 'f';
 relfilenode
-------------
       16454
(1 row)

/mnt/postgresql/9.5/main/cstore_fdw/16386# ls -ltr
total 404
-rw------- 1 postgres postgres     54 Jun 20 02:40 16422.footer
-rw------- 1 postgres postgres 397099 Jun 20 02:40 16422
-rw------- 1 postgres postgres     26 Jun 21 09:00 16454.footer
-rw------- 1 postgres postgres      0 Jun 21 09:00 16454
mtuncer commented 8 years ago

hey @komamitsu thanks for the bug report. I am trying to reproduce the issue.

Have you created cstore_fdw extension and server prior to create foreign table call ?