Skip to content

Commit 966ba2e

Browse files
authored
Mark duckdb.force_execution as GUC_REPORT for PgBouncer integration (#982)
PgBonucer in transaction pooling mode only syncs certain settings by default across connections. You can choose to sync more but that currently requires some cooperation from that specific setting: It needs to be marked as `GUC_REPORT`. Since `duckdb.force_excution` heavily changes how queries get executed it's pretty important that it's not set to unexpected values. So we set `GUC_REPORT` for this setting and explain how to configure PgBouncer correctly.
1 parent 75df0a6 commit 966ba2e

2 files changed

Lines changed: 3 additions & 2 deletions

File tree

docs/settings.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,7 @@
66

77
### `duckdb.force_execution`
88

9-
Forces queries to use DuckDB execution. This is only necessary when accessing only Postgres tables in a query. As soon as you use a DuckDB-only feature, DuckDB execution will be used automatically. DuckDB-only features include reading from DuckDB/MotherDuck tables, using DuckDB functions (like `read_parquet`), or `COPY` to remote storage (e.g., `s3://`).
9+
Forces queries to use DuckDB execution. This is only necessary when accessing only Postgres tables in a query. As soon as you use a DuckDB-only feature, DuckDB execution will be used automatically. DuckDB-only features include reading from DuckDB/MotherDuck tables, using DuckDB functions (like `read_parquet`), or `COPY` to remote storage (e.g., `s3://`). If you use PgBouncer you can add this setting to `track_extra_parameters` to make sure that PgBouncer correctly syncs this value across server connections based on what the client has set it to.
1010

1111
- **Default**: `false`
1212
- **Access**: General

src/pgduckdb_guc.cpp

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -145,7 +145,8 @@ char *duckdb_azure_transport_option_type = strdup("");
145145
void
146146
InitGUC() {
147147
/* pg_duckdb specific GUCs */
148-
DefineCustomVariable("duckdb.force_execution", "Force queries to use DuckDB execution", &duckdb_force_execution);
148+
DefineCustomVariable("duckdb.force_execution", "Force queries to use DuckDB execution", &duckdb_force_execution,
149+
PGC_USERSET, GUC_REPORT);
149150

150151
DefineCustomVariable("duckdb.unsafe_allow_execution_inside_functions", "Allow DuckDB execution inside functions",
151152
&duckdb_unsafe_allow_execution_inside_functions, PGC_SUSET);

0 commit comments

Comments
 (0)