Skip to content

Preserve nested PostgreSQL function defaults - #1119

Open
yzxcj797 wants to merge 1 commit into
drawdb-io:mainfrom
yzxcj797:fix-postgres-function-defaults
Open

Preserve nested PostgreSQL function defaults#1119
yzxcj797 wants to merge 1 commit into
drawdb-io:mainfrom
yzxcj797:fix-postgres-function-defaults

Conversation

@yzxcj797

Copy link
Copy Markdown

Summary

Importing a PostgreSQL table with a default expression containing nested function calls discarded the arguments. For example, the issue's pg_dump default became:

substring(, 1, 6)

The shared SQL AST serializer now recursively renders function arguments and PostgreSQL ::type casts. PostgreSQL function defaults use that serializer instead of a one-level local conversion, preserving expressions such as:

substring(md5(random()::TEXT), 1, 6)

Fixes #431.

Testing

  • npm test — 1/1 regression test passes
  • npm run lint — passes with zero warnings
  • npm run build — passes (existing lottie-web eval and large-chunk warnings remain)
  • npx prettier --check on changed files — passes
  • git diff --check — passes

Recursively serialize function arguments and casts when converting PostgreSQL default expressions. This keeps nested functions such as the pg_dump default from issue drawdb-io#431 intact instead of dropping their arguments.
@vercel

vercel Bot commented Aug 18, 2026

Copy link
Copy Markdown

@yzxcj797 is attempting to deploy a commit to the dottle's projects Team on Vercel.

A member of the Team first needs to authorize it.

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.

PostgreSQL schema import that contains a DEFAULT field value made up of functions

1 participant