alitrack / duckdb_fdw

DuckDB Foreign Data Wrapper for PostgreSQL
MIT License
346 stars 21 forks source link

Runtime crash with libduckdb 1.0.0 #47

Open Vonng opened 5 months ago

Vonng commented 5 months ago
postgres=# create extension duckdb_fdw;
CREATE EXTENSION
postgres=#  CREATE SERVER duckdb_server
postgres-#  FOREIGN DATA WRAPPER duckdb_fdw
postgres-#  OPTIONS (
postgres(#           database '/tmp/duck.db'
postgres(#  );
CREATE SERVER
postgres=# CREATE FOREIGN TABLE t1 (
postgres(#   a integer,
postgres(#   b text
postgres(# )
postgres-# SERVER duckdb_server
postgres-# OPTIONS (
postgres(#   table 't1_duckdb'
postgres(# );
CREATE FOREIGN TABLE
postgres=# select * from t1;
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
The connection to the server was lost. Attempting reset: Failed.

postgres=# \errverbose
There is no previous error.
postgres=# insert into t1 values (1,'a');
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
The connection to the server was lost. Attempting reset: Failed.
!?> ^C
!?> \q
[postgres@build-el8 tmp]$ psql -E
psql (16.3)
Type "help" for help.

postgres=# \errverbose
There is no previous error.
postgres=# select * from t1;
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
The connection to the server was lost. Attempting reset: Failed.
The connection to the server was lost. Attempting reset: Failed.
!?> \errverbose
server closed the connection unexpectedly
    This probably means the server terminated abnormally
    before or while processing the request.
eydunn commented 5 months ago

Is the /tmp/duck.db created with version 1.0.0?

The commands above work for me, if I also create the t1_duckdb table with:

SELECT duckdb_execute('duckdb_server','CREATE TABLE t1_duckdb (a integer, b text);');

The versions that I am using:

+--------------+------------------+---------------------------------------------------------------------------------------------------------------------------------+
|duckdb_version|duckdb_fdw_version|postgrsql_version                                                                                                                |
+--------------+------------------+---------------------------------------------------------------------------------------------------------------------------------+
|v1.0.0        |20101             |PostgreSQL 16.3 (Debian 16.3-1.pgdg120+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 12.2.0-14) 12.2.0, 64-bit|
+--------------+------------------+---------------------------------------------------------------------------------------------------------------------------------+