1

I want to run index creation without any need for the client to remain connected to the server.
I found this thread, which mentions that the only way to create index in background is
psql -c "CREATE INDEX index_name ON table(column)" &

But this still requires the client to stay connected with the server. Since this is a old thread, would like to know if any new feature has been introduced in postgres which allows such a scenario.

1 Answer 1

4

No, this is still not possible.

I would run the command on the server itself, so there can be no network problem:

nohup psql -c "CREATE INDEX CONCURRENTLY ..." </dev/zero >/dev/null 2>&1 &

Then you can disconnect the session, and the command will keep running.

Sign up to request clarification or add additional context in comments.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.