Re: Creating indexes in the background

From: Michael Paquier <michael(dot)paquier(at)gmail(dot)com>
To: David Lee <davidomundo(at)gmail(dot)com>
Cc: "pgsql-hackers(at)postgresql(dot)org" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Creating indexes in the background
Date: 2012-10-28 23:48:56
Message-ID: CAB7nPqRWuEoy6hFhN=JLR3R-OzeyRthUte7JnSitEZgz8_qUKA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Sun, Oct 28, 2012 at 8:20 AM, David Lee <davidomundo(at)gmail(dot)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

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Geoghegan 2012-10-29 02:50:27 Re: Logical to physical page mapping
Previous Message Josh Kupershmidt 2012-10-28 23:30:45 Multiple --table options for other commands