pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Ron <ronljohnsonjr@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: Database size different on Primary and Standby?
Date: Wed, 18 Jan 2023 20:13:00 -0600
Message-ID: <bdb4e58e-892f-c72a-5fd5-89f0891de9f2@gmail.com> (raw)
In-Reply-To: <MN2PR02MB6829B5EC7F70762F6136DC6789C79@MN2PR02MB6829.namprd02.prod.outlook.com>
References: <MN2PR02MB6829B5EC7F70762F6136DC6789C79@MN2PR02MB6829.namprd02.prod.outlook.com>

On 1/18/23 17:09, Hilbert, Karin wrote:
> I manage some PostgreSQL clusters on Linux.  We have a Primary & two 
> Standby servers & for Production, there is also a DR server.  We use 
> repmgr for our HA solution & the Standbys are cloned from the Primary 
> using the *repmgr standby clone* command.
>
> My manager asked for a report of all the user databases & their sizes for 
> each server in the cluster.
> I used the psql *"\l+"* command & then extracted the database name & the 
> size from the output.
> I expected the databases to be the same size on the Standbys as on the 
> Primary, but I found that some of the databases were smaller on the 
> Standby servers than on the Primary.
>
> For example, the output on the Primary for one of the user databases 
> showed as: *8997 kB*,but on the Standbys, it was *8849 kB*.
>
> I even dropped the database on the Primary & then restored it from a 
> backup.  Then checked the sizes again & they still showed the difference.
>
> I also found that the template1 database on the Primary was *7821 kB*, but 
> on the Standbys, it was *7673 kB*.
> */Is this normal?  Why would the sizes be different?/*

Maybe it is.  8997 - 8849 = 7821 - 7673 = 148.  That's right: both primaries 
are exatly 148KB larger.

This will tell you where the differences are: $ du -kc $PGDATA

-- 
Born in Arizona, moved to Babylonia.

view thread (6+ messages)

Message-ID: <bdb4e58e-892f-c72a-5fd5-89f0891de9f2@gmail.com>
Permalink:  ../bdb4e58e-892f-c72a-5fd5-89f0891de9f2@gmail.com/
Also on:    postgresql.org/message-id/bdb4e58e-892f-c72a-5fd5-89f0891de9f2@gmail.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 from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: ronljohnsonjr@gmail.com
  Subject: Re: Database size different on Primary and Standby?
  In-Reply-To: <bdb4e58e-892f-c72a-5fd5-89f0891de9f2@gmail.com>
  References: <MN2PR02MB6829B5EC7F70762F6136DC6789C79@MN2PR02MB6829.namprd02.prod.outlook.com> <bdb4e58e-892f-c72a-5fd5-89f0891de9f2@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 DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox