Skip to content

Conversation

za-arthur
Copy link

@za-arthur za-arthur commented Oct 13, 2025

Postgres expect that the option is a boolean value. Otherwise it crashes on a development environment with enabled asserts:

https://github.com/postgres/postgres/blob/REL_17_6/src/backend/commands/user.c#L864

What kind of change does this PR introduce?

Bug fix to the superuser option of AlterRoleStmt.

What is the current behavior?

What is the new behavior?

Postgres crashes. Backtrace:

Additional context

0   libsystem_kernel.dylib        	       0x19d2565b0 __pthread_kill + 8
1   libsystem_pthread.dylib       	       0x19d290888 pthread_kill + 296
2   libsystem_c.dylib             	       0x19d196808 abort + 124
3   postgres                      	       0x102bac8d4 ExceptionalCondition + 140 (assert.c:66)
4   postgres                      	       0x1028954bc AlterRole + 2188
5   supautils.dylib               	       0x103287800 alter_role_super + 128 (utils.c:98) [inlined]
6   supautils.dylib               	       0x103287800 alter_owner + 380 (utils.c:132)
7   supautils.dylib               	       0x103286960 supautils_hook + 2708 (supautils.c:880)
8   postgres                      	       0x102a7d9ec PortalRunUtility + 184 (pquery.c:1156)
9   postgres                      	       0x102a7d05c PortalRunMulti + 236 (pquery.c:1313)
10  postgres                      	       0x102a7ca94 PortalRun + 456 (pquery.c:789)
11  postgres                      	       0x102a7bb90 exec_simple_query + 1236 (postgres.c:1278)
12  postgres                      	       0x102a78ff4 PostgresMain + 1256
13  postgres                      	       0x102a75050 BackendMain + 140 (backend_startup.c:105)
14  postgres                      	       0x1029d8f28 postmaster_child_launch + 272 (launch_backend.c:277)
15  postgres                      	       0x1029dd2c4 BackendStartup + 300 (postmaster.c:3594) [inlined]
16  postgres                      	       0x1029dd2c4 ServerLoop + 7012 (postmaster.c:1676)
17  postgres                      	       0x1029daf40 PostmasterMain + 4472 (postmaster.c:1374)
18  postgres                      	       0x1028ff894 main + 1052 (main.c:199)
19  dyld                          	       0x19ced1d54 start + 7184

@coveralls
Copy link

coveralls commented Oct 13, 2025

Pull Request Test Coverage Report for Build 18471712838

Details

  • 0 of 0 changed or added relevant lines in 0 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage remained the same at 87.377%

Totals Coverage Status
Change from base Build 16078301047: 0.0%
Covered Lines: 976
Relevant Lines: 1117

💛 - Coveralls

Postgres expect that the option is a boolean value.  Otherwise it
crashes on a development environment with enabled asserts.
@steve-chavez
Copy link
Member

@za-arthur Proving this fix on #161, I've added an option to test with pgs that have cassert.

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.

3 participants