Skip to content

fix: keep the whole role config value after the first equals sign - #1130

Open
Kjubikstronk wants to merge 1 commit into
supabase:masterfrom
Kjubikstronk:role-config-equals-sign
Open

fix: keep the whole role config value after the first equals sign#1130
Kjubikstronk wants to merge 1 commit into
supabase:masterfrom
Kjubikstronk:role-config-equals-sign

Conversation

@Kjubikstronk

Copy link
Copy Markdown

Closes #1117.

changeRoleConfig2Object destructures cur.split('=') into two variables, so everything after the second equals sign is discarded. A rolconfig entry like application_name=api=worker comes back as application_name: api.

Postgres only treats the first equals sign as the separator between the setting name and its value. The rest belongs to the GUC value and should round-trip unchanged.

Fixed by keeping the remainder of the split and rejoining it. An entry with no equals sign still gives undefined, exactly as before.

Five unit tests in test/role-config.test.ts. They import the function directly and need no database, so they run without the Docker setup. Two of them fail without the change and the other three pass either way, which pins the existing behaviour as well as the fix.

tsc -p tsconfig.json --noEmit and prettier --check are both clean.

@Kjubikstronk
Kjubikstronk requested review from a team, avallete and soedirgo as code owners August 31, 2026 07:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Role config values containing equals signs are truncated

1 participant