duckdb / duckdb/pg_duckdb

FATAL: (...) Not implemented Error: SAVEPOINT is not supported in DuckDB

Open
#820 4 comments 0 reactions 1 assignee Claimed by @Y-- View on GitHub
Dominant language
C++
Stars
3.2k
Forks
204
PR merge metrics
No merged PRs in 30d

Description

### What happens?

PostgreSQL configure options:
```
CPPFLAGS="-O2 -fsanitize=address -fsanitize=undefined -fno-sanitize-recover=all -fno-sanitize=nonnull-attribute -fstack-protector" LDFLAGS='-fsanitize=address -fsanitize=undefined -static-libasan' ./configure --enable-crash-info --enable-tap-tests --with-openssl --enable-debug --enable-cassert --with-icu --with-lz4 --with-libxml --quiet --prefix="$PGPREFIX"
export ASAN_OPTIONS=detect_stack_use_after_return=0:detect_leaks=0:abort_on_error=1:disable_coredump=0:strict_string_checks=1:check_initialization_order=1:strict_init_order=1:detect_odr_violation=0
```

### To Reproduce

I catch FATAL error when executing query from Postgres's src/test/regress/sql/object_address.sql test:
postgresql.conf:
```
shared_preload_libraries='pg_duckdb'
duckdb.force_execution = true
duckdb.postgres_role = 'duckdb_group'
log_temp_files = -1
```
test.sql:
```sql
CREATE EXTENSION pg_duckdb;

DO $$
DECLARE
objtype text;
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
EXCEPTION WHEN invalid_parameter_value THEN
RAISE WARNING 'error for %: %', objtype, sqlerrm;
END;
END LOOP;
END;
$$;
```
The result:
```
test=# CREATE EXTENSION pg_duckdb;
DO $$
DECLARE
objtype text;
BEGIN
FOR objtype IN VALUES ('toast table'), ('index column'), ('sequence column'),
('toast table column'), ('view column'), ('materialized view column')
LOOP
BEGIN
PERFORM pg_get_object_address(objtype, '{one}', '{}');
EXCEPTION WHEN invalid_parameter_value THEN
RAISE WARNING 'error for %: %', objtype, sqlerrm;
END;
END LOOP;
END;
$$;
CREATE EXTENSION
FATAL: (PGDuckDB/DuckdbSubXactCallback_Cpp) Not implemented Error: SAVEPOINT is not supported in DuckDB
CONTEXT: PL/pgSQL function inline_code_block line 8 during statement block entry
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: Succeeded.
```

### OS:

Debian-12

### pg_duckdb Version (if built from source use commit hash):

49cd67618e683a15404f9edd78e2b4e79b401547

### Postgres Version (if built from source use commit hash):

002938f15c63a52bfb191dce9496486a4bbfb757

### Hardware:

_No response_

### Full Name:

Egor Chindyaskin

### Affiliation:

Postgres Professional

### What is the latest build you tested with? If possible, we recommend testing with the latest nightly build.

I have tested with a source build

### Did you include all relevant data sets for reproducing the issue?

Yes

### Did you include all code required to reproduce the issue?

- [ ] Yes, I have

### Did you include all relevant configuration (e.g., CPU architecture, Linux distribution) to reproduce the issue?

- [ ] Yes, I have

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.