Configure MotherDuck for non-superuser access
mainTo use MotherDuck as a non-superuser, you must perform two steps:
- Set the Postgres role: Update the
duckdb.postgres_rolesetting in your configuration. This requires a Postgres restart. - Grant permissions: Ensure the configured role has
CREATEpermissions on thepublicschema in Postgres, as this is where tables from the MotherDuckmainschema are created.
If you grant permissions after Postgres has already started, you may need to force a full resync of the tables by terminating the sync worker process.
# Changing this requires a Postgres restart
duckdb.postgres_role = 'your_role_name' # e.g., duckdb or duckdb_groupGRANT CREATE ON SCHEMA public TO {your_role_name};
-- So if you've configured the duckdb role above
GRANT CREATE ON SCHEMA public TO duckdb;-- Force a full resync if initial sync failed due to permission timing
SELECT * FROM pg_terminate_backend((
SELECT pid FROM pg_stat_activity WHERE backend_type = 'pg_duckdb sync worker'
));