Re: Pg_repack

From: Wells Oliver <wells(dot)oliver(at)gmail(dot)com>
To: khan Affan <bawag773(at)gmail(dot)com>
Cc: Sathish Reddy <sathishreddy(dot)postgresql(at)gmail(dot)com>, pgsql-admin(at)lists(dot)postgresql(dot)org, keith(dot)fiske(at)crunchydata(dot)com, Keith <keith(at)keithf4(dot)com>
Subject: Re: Pg_repack
Date: 2024-07-23 06:34:10
Message-ID: CAOC+FBVgNAqC3x=V7HJpjJskqhCS7Hz=6yUdHp1S4TOwxLsnjQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

Consider running pg_repack in a Docker container on ECS/Fargate etc if you
don't want to spin up an EC2 instance. I think a free t2.micro sort of EC2
instance would be plenty to repack against an RDS host, might want to
spring for a few cores to make the indexes faster...

On Mon, Jul 22, 2024 at 11:29 PM khan Affan <bawag773(at)gmail(dot)com> wrote:

> As stated before, security constraints prevent pg_repack from being
> executed directly in an RDS PostgreSQL environment.
> Because RDS maintains a secure environment, installing custom extensions
> like pg_repack is restricted.
> pg_cron in RDS is intended to be used for scheduling internal PostgreSQL
> functions or operations; it is not intended to be used with external
> utilities such as pg_repack.
> The alternative approach is to export your database schema and data
> (excluding large objects) to an external PostgreSQL instance, run pg_repack
> on the external instance to reclaim space, and then import the cleaned data
> back into your RDS instance.
>
> Thanks & regards
>
>
> *Muhammad Affan (*아판*)*
>
> *PostgreSQL Technical Support Engineer** / Pakistan R&D*
>
> Interlace Plaza 4th floor Twinhub office 32 I8 Markaz, Islamabad, Pakistan
>
>
> On Tue, Jul 23, 2024 at 10:53 AM Sathish Reddy <
> sathishreddy(dot)postgresql(at)gmail(dot)com> wrote:
>
>> We are planning to run pg repack from pg_cron in RDS environment not in
>> EC2 help me schedule job pg_repack
>>
>> On Tue, Jul 23, 2024, 11:13 AM khan Affan <bawag773(at)gmail(dot)com> wrote:
>>
>>> Hi
>>>
>>> First, use Vaccum Full or Vaccumlo if storing largeobject for clearing
>>> bloat, If you are running a script, dump it outside the RDS, such as you
>>> can dump it to EC2, and then apply PG_repack on the schema and then restore
>>> it to RDS.
>>>
>>> As you know such services are not available on RDS.
>>>
>>> https://www.postgresql.org/docs/current/vacuumlo.html
>>>
>>> https://www.postgresql.org/docs/current/sql-vacuum.html
>>>
>>> Thanks & regards
>>>
>>>
>>> *Muhammad Affan (*아판*)*
>>>
>>> *PostgreSQL Technical Support Engineer** / Pakistan R&D*
>>>
>>> Interlace Plaza 4th floor Twinhub office 32 I8 Markaz, Islamabad,
>>> Pakistan
>>>
>>> On Tue, Jul 23, 2024 at 10:22 AM Sathish Reddy <
>>> sathishreddy(dot)postgresql(at)gmail(dot)com> wrote:
>>>
>>>> Hi
>>>> I am trying to schedule pg_repack from pg_cron in RDS postgres
>>>> environment on avoid the bash on host EC2 to run run directly with in
>>>> postgres instance.it getting successful but not clearing bloat by
>>>> using repack fuction in pg_repack extension.please help on these to sort
>>>> out .
>>>>
>>>>
>>>> Thanks
>>>> Sathish Reddy
>>>>
>>>

--
Wells Oliver
wells(dot)oliver(at)gmail(dot)com <wellsoliver(at)gmail(dot)com>

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Mahendra Singh 2024-07-23 06:52:32 Re: WAL file corruption on standby PostgreSQL
Previous Message khan Affan 2024-07-23 06:28:55 Re: Pg_repack