Re: Reindex concurrently

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: SOzcn <selahattinozcnma(at)gmail(dot)com>
Cc: Holger Jakobs <holger(at)jakobs(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org
Subject: Re: Reindex concurrently
Date: 2023-12-13 17:53:22
Message-ID: CANzqJaCdfBXth+3R8nWRt1PHRzYKjkv=Mz9VJ7Jp6owur5fGJg@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Wed, Dec 13, 2023 at 12:28 PM SOzcn <selahattinozcnma(at)gmail(dot)com> wrote:

> Hello,
>
> The result is when I run the function; *"Reindex concurrently cannot run
> inside a transaction block. "*
>
> Of course, it works as follows, but in my building, I taken the scripts
> same like as follows but when I run this in function, I got the error
> message.
>
> REINDEX INDEX CONCURRENTLY "players_id_idx";
>
> commit;
>
> REINDEX INDEX CONCURRENTLY "players_about_idx";
>
> commit;
>
> According to my research, the only way to do this is to write a bash
> script in Linux and insert it with the loop. But since I want to manage
> this in the database system, I wanted to ask here.
>

What's wrong with a bash script run from cron? (You should see my crontab;
it's ginormous, running scripts against databases on 8 different servers.)

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message SOzcn 2023-12-13 17:59:33 Re: Reindex concurrently
Previous Message SOzcn 2023-12-13 17:27:55 Re: Reindex concurrently