Re: Looking for a linux tool to automate PG admin tasks

From: Ron Johnson <ronljohnsonjr(at)gmail(dot)com>
To: pgsql-admin <pgsql-admin(at)lists(dot)postgresql(dot)org>
Subject: Re: Looking for a linux tool to automate PG admin tasks
Date: 2025-10-16 14:11:37
Message-ID: CANzqJaAo8XiBTFrAKUSUwGseF1vHSR2hYW-Fod9ZqEhAuA7Frg@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-admin

On Thu, Oct 16, 2025 at 9:46 AM hubert depesz lubaczewski <depesz(at)depesz(dot)com>
wrote:

> On Thu, Oct 16, 2025 at 03:17:16PM +0200, Jean-Christophe Boggio wrote:
> > Hello,
> > I have several servers with many databases on them for different
> > applications.
> > I need to execute some tasks on some databases depending on some
> criteria.
> > For example, execute query xxx but only on databases where table
> > public.sometable exists or if number of rows in table yyy is > 1M.
> > Before reinventing the wheel with ugly bash scripts, do you know of some
> > tools that would suit my case ?
> > Some tasks will have to execute periodically (with crons probably) and
> > others will be one-off.
> > CLI tools if possible because I'm working remotely on those servers of
> > course.
>
> Well, I'd just use psql, with some simple script using \gexec
> functionality. Solves virtually any problem of this kind.
>

Ditto. bash scripts are only ugly if you write ugly bash.

--
Death to <Redacted>, and butter sauce.
Don't boil me, I'm still alive.
<Redacted> lobster!

In response to

Responses

Browse pgsql-admin by date

  From Date Subject
Next Message Willian Colognesi 2025-10-17 00:52:43 Re: postgres server crash with "Segmentation fault"
Previous Message hubert depesz lubaczewski 2025-10-16 13:46:13 Re: Looking for a linux tool to automate PG admin tasks