Skip to content

Handle duplicate_table errors in system_monitor_pg #29

Open
@dszoboszlay

Description

@dszoboszlay

The query creating new table partitions in system_monitor_pg may crash with duplicate_table error in case multiple nodes are using the same DB:

[{ok, [], []}, {ok, [], []}] = epgsql:squery(Conn, Query)

This was surprising to me, because I was expecting IF NOT EXISTS to avoid this error, but as I've learned on Stackoverflow:

The IF NOT EXISTS is meant to deal idempotency, not concurrency.

🤷

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