Open niteria opened 4 years ago
I copied over the module Database.PostgreSQL.Simple.Queue.Migrate
to my project and applied the fix and it worked.
I'd send a pull request, but master
seems to be substantially different from Hackage.
Thanks for the bug report. I am working a new postgres based queue using hasql
instead of postgresql-simple
but I will try to get a maintenance release out on this at some point.
Hello,
Thank you for the library, I needed to create something similar myself, so it saved me some time.
Here's the reproduction steps, running on a fresh database:
I'm running a version from Hackage,
postgresql-simple-queue-1.0.1
to be precise.I'm not an expert on PostgreSQL, so I googled a bit and found this: https://stackoverflow.com/a/56647928
It seems to suggest that the types are scoped to the schema and this part of the migration statement
SELECT 1 FROM pg_type WHERE typname = 'state_t'
ignores the scope. The correct query seems to beSELECT 1 FROM pg_type typ INNER JOIN pg_namespace nsp ON nsp.oid = typ.typnamespace WHERE nsp.nspname = current_schema() AND typ.typname = 'state_t'
as per the StackOverflow answer.