pg_duckdb icon indicating copy to clipboard operation
pg_duckdb copied to clipboard

Failed to spill to temp directory when running large SQL using normal user

Open YuweiXiao opened this issue 7 months ago • 1 comments

What happens?

The error:

ERROR:  (PGDuckDB/Duckdb_ExecCustomScan_Cpp) Permission Error: File system LocalFileSystem has been disabled by configuration

I gdb the backend and find it is accessing /pg_data/data/pg_duckdb/temp

Though the blocking is by design (https://github.com/duckdb/pg_duckdb/pull/807), it seems unreasonable to disallow spilling for normal pg roles.

To Reproduce

Configure duckdb.max_memory to a small value e.g., 128MB.

Use a normal user to run a large SQL, e.g., join on large tables

OS:

centos

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

213a3d7d378ead04c321f52015ecc765091ee2c8

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

pg17

Hardware:

No response

Full Name:

Yuwei XIAO

Affiliation:

zbyte inc

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

I have not tested with any build

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

No - Other reason (please specify in the issue body)

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

YuweiXiao avatar Jul 17 '25 08:07 YuweiXiao

Agreed that this is not intended behavior. It sounds more like that's a duckdb issue though, i.e. plain duckdb (without pg_duckdb) should allow temp file creation even when local filesystem is disabled.

JelteF avatar Sep 25 '25 08:09 JelteF