pg.ddx.io pgsql-docs@postgresql.org mailing list archivehelp / color / mirror / Atom feed
Is CREATE INDEX dependent on the session? 3+ messages / 3 participants [nested] [flat]
* Is CREATE INDEX dependent on the session? @ 2023-09-27 15:23 Ilya Priven <ilya.konstantinov@gmail.com> 2023-09-28 06:23 ` Re: Is CREATE INDEX dependent on the session? Laurenz Albe <laurenz.albe@cybertec.at> 0 siblings, 1 reply; 3+ messages in thread From: Ilya Priven @ 2023-09-27 15:23 UTC (permalink / raw) To: pgsql-docs@lists.postgresql.org Hi, Would it warrant a clarification in the documentation: - Whether CREATE INDEX is aborted if the session is disconnected, assuming it's not in a transaction? - Ditto for CREATE INDEX CONCURRENTLY? - Whether CREATE INDEX CONCURRENTLY "returns" immediately or blocks the session until it's created? Given how these operations may take substantial time, and have no output beyond success, this might be a relevant topic. ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Is CREATE INDEX dependent on the session? 2023-09-27 15:23 Is CREATE INDEX dependent on the session? Ilya Priven <ilya.konstantinov@gmail.com> @ 2023-09-28 06:23 ` Laurenz Albe <laurenz.albe@cybertec.at> 2023-09-28 14:06 ` Re: Is CREATE INDEX dependent on the session? Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 1 reply; 3+ messages in thread From: Laurenz Albe @ 2023-09-28 06:23 UTC (permalink / raw) To: Ilya Priven <ilya.konstantinov@gmail.com>; pgsql-docs@lists.postgresql.org On Wed, 2023-09-27 at 11:23 -0400, Ilya Priven wrote: > Would it warrant a clarification in the documentation: > - Whether CREATE INDEX is aborted if the session is disconnected, assuming it's not in a transaction? It is aborted as soon as the server realizes that the client is gone, which may take a while (see the keepalive parameters and "client_connection_check_interval"). > - Ditto for CREATE INDEX CONCURRENTLY? The answer is the same. Note that if CREATE INDEX CONCURRENTLY is interrupted, you are left with an INVALID index that you have to delete later. > - Whether CREATE INDEX CONCURRENTLY "returns" immediately or blocks the session until it's created? It blocks until the index has been created. Do you want to propose a patch? Yours, Laurenz Albe ^ permalink raw reply [nested|flat] 3+ messages in thread
* Re: Is CREATE INDEX dependent on the session? 2023-09-27 15:23 Is CREATE INDEX dependent on the session? Ilya Priven <ilya.konstantinov@gmail.com> 2023-09-28 06:23 ` Re: Is CREATE INDEX dependent on the session? Laurenz Albe <laurenz.albe@cybertec.at> @ 2023-09-28 14:06 ` Tom Lane <tgl@sss.pgh.pa.us> 0 siblings, 0 replies; 3+ messages in thread From: Tom Lane @ 2023-09-28 14:06 UTC (permalink / raw) To: Laurenz Albe <laurenz.albe@cybertec.at>; +Cc: Ilya Priven <ilya.konstantinov@gmail.com>; pgsql-docs@lists.postgresql.org Laurenz Albe <laurenz.albe@cybertec.at> writes: > On Wed, 2023-09-27 at 11:23 -0400, Ilya Priven wrote: >> Would it warrant a clarification in the documentation: >> - Whether CREATE INDEX is aborted if the session is disconnected, assuming it's not in a transaction? > It is aborted as soon as the server realizes that the client is gone, which may > take a while (see the keepalive parameters and "client_connection_check_interval"). Note that unless you change client_connection_check_interval to a nondefault value, the server will not notice that the client is gone until it tries to send or receive data. So a command like CREATE INDEX will typically run to completion even if the client drops the connection. I don't think keepalive settings affect this --- they might cause the kernel to realize that the connection is lost earlier than it otherwise would, but that doesn't result in an automatic kill of the server process. > Do you want to propose a patch? There are enough environmental dependencies involved here that any simple description is likely to contain lies. So I'm hesitant to try to put anything about it into the docs. regards, tom lane ^ permalink raw reply [nested|flat] 3+ messages in thread
end of thread, other threads:[~2023-09-28 14:06 UTC | newest] Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed) -- links below jump to the message on this page -- 2023-09-27 15:23 Is CREATE INDEX dependent on the session? Ilya Priven <ilya.konstantinov@gmail.com> 2023-09-28 06:23 ` Laurenz Albe <laurenz.albe@cybertec.at> 2023-09-28 14:06 ` Tom Lane <tgl@sss.pgh.pa.us>
This inbox is served by DDX for PostgreSQL; see mirroring instructions for how to clone and mirror all data and code used for this inbox