Skip to content

Latest versions of pg_dump are incompatible with sqlc and our migration script #965

@ethanndickson

Description

@ethanndickson

The latest versions of pg_dump (a minor patch was put out for all postgres versions 13+) include a security fix that inserts '\restrict' and '\unrestrict' lines in pg dumps. https://git.postgresql.org/gitweb/?p=postgresql.git;a=commitdiff;h=575f54d4c

This is incompatible with sqlc: sqlc-dev/sqlc#4065
And is also incompatible with our check migration script:
https://github.com/coder/coder/actions/runs/17450826268/job/49555058480#step:22:128

Once sqlc is patched to handle these lines , we need to also update our 'check migrations' script to normalize the dumps by removing these restrict and unrestrict lines.

We've worked around the issue by pinning the postgresql version to 13.21 in coder/coder#19696
Coder doesn't restore from postgres dumps, so we're not vulnerable to attacks that would be patched by the latest postgres version. Regardless, we'll unpin ASAP.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions