Re: Creating indexes in the background - Mailing list pgsql-hackers

From Michael Paquier
Subject Re: Creating indexes in the background
Date
Msg-id CAB7nPqRWuEoy6hFhN=JLR3R-OzeyRthUte7JnSitEZgz8_qUKA@mail.gmail.com
Whole thread Raw
In response to Creating indexes in the background  (David Lee <davidomundo@gmail.com>)
List pgsql-hackers


On Sun, Oct 28, 2012 at 8:20 AM, David Lee <davidomundo@gmail.com> wrote:
Hey folks,

It seems like right now when you want to create an index concurrently, the index creation will get canceled if you cancel the statement (i.e. you must keep your statement open).

Is there a way to "launch" an index creation in the background so that the statement doesn't need to be kept open?
If I understood your question, the answer is no, you need to maintain the server session alive when doing a transaction on a PG server, cutting the server connection automatically aborts the transaction it is running on server side.
You can still use a batch processing for doing such operations like:
psql -c "create index concurrently foo on tab(a)" -p $port -h $host $dbname &
But this needs to be done on the client application side that will maintain alive a session on server.
--
Michael Paquier
http://michael.otacoo.com

pgsql-hackers by date:

Previous
From: "Kevin Grittner"
Date:
Subject: Re: Index creation in postgresql
Next
From: Amit Kapila
Date:
Subject: Proposal for Allow postgresql.conf values to be changed via SQL