public inbox for [email protected]  
help / color / mirror / Atom feed
From: Tom Lane <[email protected]>
To: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Issue while creating index dynamically
Date: Tue, 23 Jul 2024 16:32:27 -0400
Message-ID: <[email protected]> (raw)
In-Reply-To: <CANzqJaDZ=1sMh6SH0JWz5_5S=-F+8bMi_1=Cia_gkM9yJTh56w@mail.gmail.com>
References: <CAB+=1TVUKY2hxPQMiu78KVXHrZ+VL+MG_z3Cr8LKqkjs6oCsGg@mail.gmail.com>
	<CANzqJaDZ=1sMh6SH0JWz5_5S=-F+8bMi_1=Cia_gkM9yJTh56w@mail.gmail.com>

Ron Johnson <[email protected]> writes:
> On Tue, Jul 23, 2024 at 4:10 PM veem v <[email protected]> wrote:
>> But we are getting an error while executing saying it cant be executed in
>> transaction block with "CONCURRENTLY". So I want to understand , is there
>> any alternate way to get away with this?

> I'd write that in bash, not in a DO block.

Yeah.  I thought for a bit about using contrib/dblink to carry out
the commands in a different session, but I don't think that'll work:
CREATE INDEX CONCURRENTLY would think it has to wait out the
transaction running the DO block at some steps.  Shove the logic
over to the client side and you're good to go.

			regards, tom lane






view thread (2+ messages)

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: [email protected]
  Cc: [email protected], [email protected], [email protected]
  Subject: Re: Issue while creating index dynamically
  In-Reply-To: <[email protected]>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox