Skip to content

Fix deparse typmod fallback to return recoverable error instead of assert (issue #330)#331

Open
LucaCappelletti94 wants to merge 1 commit intopganalyze:17-latestfrom
LucaCappelletti94:17-latest
Open

Fix deparse typmod fallback to return recoverable error instead of assert (issue #330)#331
LucaCappelletti94 wants to merge 1 commit intopganalyze:17-latestfrom
LucaCappelletti94:17-latest

Conversation

@LucaCappelletti94
Copy link

This PR fixes a deparser crash path reported in #330 by replacing a hard Assert(false) in deparseTypeName with a recoverable elog(ERROR, ...).

With this change, pg_query_deparse_protobuf* now returns a normal PgQueryError for unsupported typmod node kinds, instead of:

  • aborting the process in DEBUG=1 builds, or
  • emitting malformed SQL in non-debug builds.

Replace Assert(false) in deparseTypeName typmod fallback with elog(ERROR), and add deparse regression cases that require parse success and deparse error for enum typmod constructs (issue pganalyze#330).
@LucaCappelletti94 LucaCappelletti94 marked this pull request as ready for review February 25, 2026 21:07
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.

1 participant