citusdata/cstore_fdw

cstore windows compilation

HariharanBV opened this issue · 9 comments

Did anyone have idea regarding cstore Compilation in windows platform? If you find any kindly share to me.
thanks in advance

I don't know of anybody using cstore_fdw under windows. The main challenge would be to get depended library protobuf-c to compile under windows. I have heard of people doing that under cygwin. I am not quite sure how it would work out with cstore_fdw and postgres.

bsrd commented

Hello all, I am able to compiled cstore_fdw for windows and added to the lib.
I can execute two first scripts:

-- load extension first time after install
CREATE EXTENSION cstore_fdw;

-- create server object
CREATE SERVER cstore_server FOREIGN DATA WRAPPER cstore_fdw;

Although I need to create cstore_fdw folder under data manually.

However, when I tried to create the foreign table as in the guidance I got following error:

2018-10-03 16:40:03.981 +03 [18220] LOG: database system was shut down at 2018-10-03 16:39:28 +03
2018-10-03 16:40:04.162 +03 [18924] LOG: database system is ready to accept connections
2018-10-03 16:40:33.555 +03 [18924] LOG: server process (PID 22312) was terminated by exception 0xC0000005
2018-10-03 16:40:33.555 +03 [18924] DETAIL: Failed process was running: -- create foreign table
CREATE FOREIGN TABLE customer_reviews
(
customer_id TEXT,
review_date DATE,
review_rating INTEGER,
review_votes INTEGER,
review_helpful_votes INTEGER,
product_id CHAR(10),
product_title TEXT,
product_sales_rank BIGINT,
product_group TEXT,
product_category TEXT,
product_subcategory TEXT,
similar_product_ids CHAR(10)[]
)
SERVER cstore_server
OPTIONS(compression 'pglz');
2018-10-03 16:40:33.555 +03 [18924] HINT: See C include file "ntstatus.h" for a description of the hexadecimal value.
2018-10-03 16:40:33.555 +03 [18924] LOG: terminating any other active server processes
2018-10-03 16:40:33.557 +03 [17324] WARNING: terminating connection because of crash of another server process
2018-10-03 16:40:33.557 +03 [17324] DETAIL: The postmaster has commanded this server process to roll back the current transaction and exit, because another server process exited abnormally and possibly corrupted shared memory.
2018-10-03 16:40:33.557 +03 [17324] HINT: In a moment you should be able to reconnect to the database and repeat your command.
2018-10-03 16:40:33.582 +03 [18924] LOG: all server processes terminated; reinitializing
2018-10-03 16:40:33.682 +03 [21708] LOG: database system was interrupted; last known up at 2018-10-03 16:40:03 +03
2018-10-03 16:40:35.357 +03 [10072] FATAL: the database system is in recovery mode
2018-10-03 16:40:35.448 +03 [21708] LOG: database system was not properly shut down; automatic recovery in progress
2018-10-03 16:40:35.458 +03 [21708] LOG: redo starts at F/4572850
2018-10-03 16:40:35.483 +03 [21708] LOG: invalid record length at F/4589180: wanted 24, got 0
2018-10-03 16:40:35.483 +03 [21708] LOG: redo done at F/4589118
2018-10-03 16:40:35.483 +03 [21708] LOG: last completed transaction was at log time 2018-10-03 16:40:28.809248+03

Can anyone assist me on this matter? Thanks.

You having to create cstore_fdw folder tells something is not right with file system access.

can you run this under debugger to see where it fails (crashes) ?

bsrd commented

Hello Murat, thanks for the reply.

I managed to debug further, it seems there is an error which was not trapped in following code where there is a possibility of errno equals to 0 which means the directory doesn't exist.

if (errno == ENOENT) { directoryExists = false; } else { ereport(ERROR, (errcode_for_file_access(), errmsg("could not stat directory \"%s\": %m", directoryName->data))); }

This fixed the folder creation. However I'm still nailing down further error, it appears there is issue in my reference to protobuf-c.

Hello, how do you compile cstore_fdw on Windows platform?

bsrd commented

Has anyone tried mingw64?

Hi all, any news about successful windows build and if resulting binaries may be shared ?