public inbox for [email protected]
help / color / mirror / Atom feedFrom: veem v <[email protected]>
To: Tom Lane <[email protected]>
Cc: Ron Johnson <[email protected]>
Cc: pgsql-general <[email protected]>
Subject: Re: Issue while creating index dynamically
Date: Thu, 25 Jul 2024 11:12:15 +0530
Message-ID: <CAB+=1TWipB8gTq2Pop5MWA5e=8oWTAKa3no4UB4n3bbP5E81xg@mail.gmail.com> (raw)
In-Reply-To: <[email protected]>
References: <CAB+=1TVUKY2hxPQMiu78KVXHrZ+VL+MG_z3Cr8LKqkjs6oCsGg@mail.gmail.com>
<CANzqJaDZ=1sMh6SH0JWz5_5S=-F+8bMi_1=Cia_gkM9yJTh56w@mail.gmail.com>
<[email protected]>
On Wed, 24 Jul 2024 at 02:02, Tom Lane <[email protected]> wrote:
> 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
>
>
>
Thank you .
I was thinking the individual statement will work fine if I pull out those
from the begin..end block, as those will then be not bounded by any outer
transaction.
However, When I was trying it from dbeaver by extracting individual index
creation statements rather from within the "begin ..end;" block, it still
failed with a different error as below. Why is it so?
"SQL Error [25001]: Error: create index concurrently cannot be executed
within a pipeline "
view thread (2+ messages) latest in thread
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], [email protected]
Subject: Re: Issue while creating index dynamically
In-Reply-To: <CAB+=1TWipB8gTq2Pop5MWA5e=8oWTAKa3no4UB4n3bbP5E81xg@mail.gmail.com>
* 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