cstore_fdw icon indicating copy to clipboard operation
cstore_fdw copied to clipboard

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

Open komamitsu opened this issue 8 years ago • 1 comments

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

komamitsu avatar Jun 21 '16 09:06 komamitsu

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 ?

mtuncer avatar Jun 27 '16 05:06 mtuncer