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

pq: CREATE INDEX CONCURRENTLY cannot be executed from a function or multi-command string #820

Open
kamal-github opened this issue Dec 17, 2018 · 2 comments

Comments

@kamal-github
Copy link

I am trying to run the migration, which has tables and indexes(also some are unique and concurrent) creation SQL statement in a single SQL file, but getting the below error.

(details: pq: CREATE INDEX CONCURRENTLY cannot be executed from a function or multi-command string)

@rowland
Copy link

rowland commented Jun 14, 2019

I have my own schema migration utility and I too noticed that Postgres wouldn't allow me to Exec multiple CREATE INDEX CONCURRENTLY. I'm hesitant to suggest that Exec support multiple transactions in a single call, unless there's a clear standard and precedence, less the law of unintended consequences strike. Probably best to split the logic into multiple transactions at the application level.

@RoiGlinik
Copy link

Is there any solution for that?

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

3 participants