Skip to content

fix: psql initdb: handle existing severity_enum, support stdout#2701

Open
sebix wants to merge 2 commits into
developfrom
fix/initdbexists
Open

fix: psql initdb: handle existing severity_enum, support stdout#2701
sebix wants to merge 2 commits into
developfrom
fix/initdbexists

Conversation

@sebix
Copy link
Copy Markdown
Member

@sebix sebix commented Apr 28, 2026

postgres does not have a
CREATE TYPE IF NOT EXISTS
as a workaround, we need to encapuslate the CREATE TYPE in a kind of try-catch block

@sebix sebix added this to the 3.5.1 Patch release milestone Apr 28, 2026
@sebix sebix added the bug Indicates an unexpected problem or unintended behavior label Apr 28, 2026
@sebix sebix force-pushed the fix/initdbexists branch from 4bbce5b to f42c793 Compare April 28, 2026 19:29
sebix added 2 commits April 28, 2026 21:49
postgres does not have a
CREATE TYPE IF NOT EXISTS
do as a workaround, we need to encapuslate the CREATE TYPE in a kind of
try-catch block
this way, the tool supports writing to stdout

and also allows overwriting the output file, which is necessary to get
your own predictable file name, e.g. in orchestration
1. create a temp file
2. set permisions
3. add the content with intelmq_psql_initdb, writing to the empty file
4. delete it
@sebix sebix force-pushed the fix/initdbexists branch from f42c793 to ecfe816 Compare April 28, 2026 19:55
@sebix sebix changed the title fix: psql initdb: handle existing severity_enum fix: psql initdb: handle existing severity_enum, support stdout May 2, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Indicates an unexpected problem or unintended behavior

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant