Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Postgres unique index is incorrect - can't enqueue the same payload in two different queues. #119

Closed
pconstantinou opened this issue Feb 26, 2024 · 2 comments

Comments

@pconstantinou
Copy link
Contributor

Re:
https://github.com/acaloiaro/neoq/blob/main/backends/postgres/migrations/20230902105301_make_fingerprint_index_unique.up.sql#L2

The index would prevent two separate queues from enqueuing the same payload.

It should be:

CREATE UNIQUE INDEX IF NOT EXISTS neoq_jobs_fingerprint_unique_idx ON neoq_jobs (queue, fingerprint, status) WHERE NOT (status = 'processed');
@acaloiaro
Copy link
Owner

Right you are! This looks pretty dumb staring me in the face :)

@acaloiaro
Copy link
Owner

Resolved by #122

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

No branches or pull requests

2 participants