pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Holger Jakobs <holger@jakobs.com>
To: pgsql-admin@lists.postgresql.org
Subject: Re: Reindex concurrently
Date: Wed, 13 Dec 2023 14:48:53 +0100
Message-ID: <5c6950cb-5ce2-2740-a447-5d9ff8418edd@jakobs.com> (raw)
In-Reply-To: <CAJyV5AanzhzubzCs0-Ergr3S_02FjHPWScNxnKB93L7mbRDTnw@mail.gmail.com>
References: <CAJyV5AanzhzubzCs0-Ergr3S_02FjHPWScNxnKB93L7mbRDTnw@mail.gmail.com>

Am 13.12.23 um 12:27 schrieb SOzcn:
> Hello team,
>
> We've been building a index maintenance scripts but in the function it 
> doesn't work with concurrently, is there a way for manipulate that ? 
> Just for example ; The reindexes are working without function. Have a 
> nice day!
>
> select index_stat.test ();
>
> CREATE OR REPLACE FUNCTION index_stat.test()
>
> RETURNS void
>
> LANGUAGE plpgsql
>
> AS $function$
>
> begin
>
> REINDEX INDEX CONCURRENTLY "players_id_idx";
>
> commit;
>
> REINDEX INDEX CONCURRENTLY "players_about_idx";
>
> commit;
>
> end;
>
> $function$
>
> ;
>
Hello,

"doesn't work with" isn't a good description. Please always include the 
error message given.

What I would suggest instead is try using a procedure instead of a function.

Cheers

Holger



-- 
Holger Jakobs, Bergisch Gladbach, Tel. +49-178-9759012



Attachments:

  [application/pgp-signature] OpenPGP_signature (202B, ../5c6950cb-5ce2-2740-a447-5d9ff8418edd@jakobs.com/3-OpenPGP_signature)
  download

view thread (8+ messages)  latest in thread

Message-ID: <5c6950cb-5ce2-2740-a447-5d9ff8418edd@jakobs.com>
Permalink:  ../5c6950cb-5ce2-2740-a447-5d9ff8418edd@jakobs.com/
Also on:    postgresql.org/message-id/5c6950cb-5ce2-2740-a447-5d9ff8418edd@jakobs.com

 · 

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: pgsql-admin@postgresql.org
  Cc: holger@jakobs.com, pgsql-admin@lists.postgresql.org
  Subject: Re: Reindex concurrently
  In-Reply-To: <5c6950cb-5ce2-2740-a447-5d9ff8418edd@jakobs.com>

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

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