1

Is there a way to submit a command in datagrip to a database without keeping the connection open / asynchronously? I'm attempting to create indexes concurrently, but I'd also like to close my laptop.

My datagrip workflow: Select column in a database, click 'modify column', and eventually run code such as:

create index concurrently batchdisbursements_updated_index
    on de_testing.batchdisbursements (updated);

However, these run as background tasks and cancel if I exit datagrip.

2
  • Perhaps a viable solution is to change your what your laptop does when you close it. Change the setting to simply ignore the fact it's now closed.As you didn't specify your operating system see for Windows and for Linux (Ubuntu 18.04LTS) (other Linux distros should have similar functionality) Commented Jun 28, 2020 at 19:19
  • Turns out if you create concurrently or create synchronously, you can cancel the command after a few seconds and the command will have already been submitted to the server. Commented Aug 21, 2020 at 17:41

1 Answer 1

4

However, these run as background tasks and cancel if I exit datagrip.

What if you close your laptop without exiting datagrip? Datagrip is probably actively sending a cancellation message to PostgreSQL when you exit it. If you just close the laptop, I doubt it will do that. In that case, PostgreSQL won't notice the client has gone away until it tries to send a message, at which point the index creation should already be done and committed.

But this is a fragile plan. I would ssh to the server, run screen (or one of the fancier variants), run psql in that, and create the indexes from there.

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.