-
Notifications
You must be signed in to change notification settings - Fork 55
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
Cannot execute create index concurrently in procrastinate task #1051
Comments
In #1059, I add a task that creates an index concurrently in a Django setup. @app.task
def create_index():
c = connection.cursor()
c.execute("CREATE INDEX CONCURRENTLY ON demo_book (indexed)") I'm deferring it with: $ procrastinate_demos/demo_django/manage.py procrastinate defer procrastinate_demos.demo_django.demo.tasks.create_index Then launching a worker with: $ procrastinate_demos/demo_django/manage.py procrastinate worker And it seems to work:
Index seems created:
From my point of view, it works :) |
Ok! This is helpful - will need to explore - that is enough confirmation to know it is something on our end |
https://www.pgcasts.com/episodes/the-skip-locked-feature-in-postgres-9-5 No luck on my end…. Hmmmm… SKIP…LOCKED cannot be executed outside of a transaction (at least according to that article) but INDEX CONCURRENTLY can only be executed outside of a transaction block - they seem mutually exclusive but I may be missing something. I’m trying to create multiple indexes at the same time, maybe that is why? You are only trying to create one index - can you try two in that same statement? It feels like it could be an auto-commit thing - I tried to turn it off when Django but maybe Procrastinate is doing its own thing - the problem looks similar to the link below - I’ll give it an try tomorrow |
Ok, that ended up being it - executing each one rather than all at once solved this issue - closing it :) |
Would you mind seeing if you can? I think if you can on the simplest possible set up then it’s clearly a problem on our end!
The text was updated successfully, but these errors were encountered: