mirror of
https://github.com/neondatabase/neon.git
synced 2026-01-05 12:32:54 +00:00
## Problem Currently `neon_superuser` is hardcoded in many places. It makes it harder to reuse the same code in different envs. ## Summary of changes Parametrize `neon_superuser` in `compute_ctl` via `--privileged-role-name` and in `neon` extensions via `neon.privileged_role_name`, so it's now possible to use different 'superuser' role names if needed. Everything still defaults to `neon_superuser`, so no control plane code changes are needed and I intentionally do not touch regression and migrations tests. Postgres PRs: - https://github.com/neondatabase/postgres/pull/674 - https://github.com/neondatabase/postgres/pull/675 - https://github.com/neondatabase/postgres/pull/676 - https://github.com/neondatabase/postgres/pull/677 Cloud PR: - https://github.com/neondatabase/cloud/pull/31138
42 lines
1.7 KiB
Diff
42 lines
1.7 KiB
Diff
diff --git a/Makefile b/Makefile
|
|
index 3235cc8..6b892bc 100644
|
|
--- a/Makefile
|
|
+++ b/Makefile
|
|
@@ -32,7 +32,7 @@ else
|
|
DUCKDB_BUILD_TYPE = release
|
|
endif
|
|
|
|
-DUCKDB_LIB = libduckdb$(DLSUFFIX)
|
|
+DUCKDB_LIB = libduckdb_pg_duckdb$(DLSUFFIX)
|
|
FULL_DUCKDB_LIB = third_party/duckdb/build/$(DUCKDB_BUILD_TYPE)/src/$(DUCKDB_LIB)
|
|
|
|
ERROR_ON_WARNING ?=
|
|
@@ -54,7 +54,7 @@ override PG_CXXFLAGS += -std=c++17 ${DUCKDB_BUILD_CXX_FLAGS} ${COMPILER_FLAGS} -
|
|
# changes to the vendored code in one place.
|
|
override PG_CFLAGS += -Wno-declaration-after-statement
|
|
|
|
-SHLIB_LINK += -Wl,-rpath,$(PG_LIB)/ -lpq -Lthird_party/duckdb/build/$(DUCKDB_BUILD_TYPE)/src -L$(PG_LIB) -lduckdb -lstdc++ -llz4
|
|
+SHLIB_LINK += -Wl,-rpath,$(PG_LIB)/ -lpq -Lthird_party/duckdb/build/$(DUCKDB_BUILD_TYPE)/src -L$(PG_LIB) -lduckdb_pg_duckdb -lstdc++ -llz4
|
|
|
|
include Makefile.global
|
|
|
|
diff --git a/sql/pg_duckdb--0.2.0--0.3.0.sql b/sql/pg_duckdb--0.2.0--0.3.0.sql
|
|
index d777d76..3b54396 100644
|
|
--- a/sql/pg_duckdb--0.2.0--0.3.0.sql
|
|
+++ b/sql/pg_duckdb--0.2.0--0.3.0.sql
|
|
@@ -1056,3 +1056,14 @@ GRANT ALL ON FUNCTION duckdb.cache(TEXT, TEXT) TO PUBLIC;
|
|
GRANT ALL ON FUNCTION duckdb.cache_info() TO PUBLIC;
|
|
GRANT ALL ON FUNCTION duckdb.cache_delete(TEXT) TO PUBLIC;
|
|
GRANT ALL ON PROCEDURE duckdb.recycle_ddb() TO PUBLIC;
|
|
+
|
|
+DO $$
|
|
+DECLARE
|
|
+ privileged_role_name text;
|
|
+BEGIN
|
|
+ privileged_role_name := current_setting('neon.privileged_role_name');
|
|
+
|
|
+ EXECUTE format('GRANT ALL ON FUNCTION duckdb.install_extension(TEXT) TO %I', privileged_role_name);
|
|
+ EXECUTE format('GRANT ALL ON TABLE duckdb.extensions TO %I', privileged_role_name);
|
|
+ EXECUTE format('GRANT ALL ON SEQUENCE duckdb.extensions_table_seq TO %I', privileged_role_name);
|
|
+END $$;
|