Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ulTHZ-0018UH-Ax for pgsql-admin@arkaria.postgresql.org; Mon, 11 Aug 2025 14:13:49 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.94.2) (envelope-from ) id 1ulTHX-001DeU-Is for pgsql-admin@arkaria.postgresql.org; Mon, 11 Aug 2025 14:13:47 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1ulTHX-001Dcx-47 for pgsql-admin@lists.postgresql.org; Mon, 11 Aug 2025 14:13:47 +0000 Received: from mx.ssan.egs-seg.gc.ca ([205.193.229.132]) by makus.postgresql.org with esmtps (TLS1.2) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1ulTHT-0001vn-2w for pgsql-admin@postgresql.org; Mon, 11 Aug 2025 14:13:46 +0000 Received: from DC01ZWH0031.paz.nrc.gc.ca ([167.37.58.20]) by mx.ssan.egs-seg.gc.ca with ESMTP id 57BEDb7x009371-57BEDb81009371 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=CAFAIL); Mon, 11 Aug 2025 10:13:37 -0400 Received: from DC01ZWH0028.Corp.nrc.gc.ca (167.37.54.14) by DC01ZWH0031.paz.nrc.gc.ca (167.37.58.20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Mon, 11 Aug 2025 10:13:33 -0400 Received: from DC01ZWH0029.Corp.nrc.gc.ca (167.37.54.15) by DC01ZWH0028.Corp.nrc.gc.ca (167.37.54.14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.2.1748.10; Mon, 11 Aug 2025 10:13:36 -0400 Received: from DC01ZWH0029.Corp.nrc.gc.ca ([fe80::f81b:b838:eba2:82ef]) by DC01ZWH0029.Corp.nrc.gc.ca ([fe80::f81b:b838:eba2:82ef%7]) with mapi id 15.02.1748.010; Mon, 11 Aug 2025 10:13:36 -0400 From: "Ghiurea, Isabella" To: Laurenz Albe , "pgsql-admin@postgresql.org" Subject: Re: Re: DB size value different than "/data" dir size Thread-Topic: Re: DB size value different than "/data" dir size Thread-Index: AQHcCLqKBXBvdCp5JEiZd/7jSflgvrRcizqAgAD15TU= Date: Mon, 11 Aug 2025 14:13:36 +0000 Message-ID: References: ,<9e1ebefd12e1fc955eee580caca5e9c37fd005ca.camel@cybertec.at> In-Reply-To: <9e1ebefd12e1fc955eee580caca5e9c37fd005ca.camel@cybertec.at> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [167.37.48.8] Content-Type: multipart/alternative; boundary="_000_ea8a8186d36e4321ada5886c7bf66f3anrccnrcgcca_" MIME-Version: 1.0 X-FEAS-Client-IP: 167.37.58.20 X-FE-Last-Public-Client-IP: 167.37.58.20 X-FE-Policy-ID: 25:37:97:SYSTEM DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; d=nrc-cnrc.gc.ca; s=slms3; c=relaxed/relaxed; h=from:to:subject:date:message-id:references:content-type:mime-version; bh=u6dA9DUjsSDKeysx9jHE5cxqq+jFJmpyGAi5jGUFWEU=; b=YRKyoXGKFbWhKwcfcSgbZ5zw3sVspN5gQ2G4wbmXYawMnvNkHRRPtq84u/s9H9+dyGtFnBc8hmUE 77vcmlt1q7GegYQIfJG8Tp8F62HpjFMn3DlaRaYywmItP0zK83BPErIPlo6v8rXl7RaRADRnTUPM tPYdIFVgnc3Br6suhvD8gcA5VGF31taXI6h0xArcsnGLN7abA/EYExq9hPWAuDKoaQE6+C7LlIiH fUllxkqVl4B58bo1Ui5VVxCz3EZqAd0WwGx6wgYB8wm00+m2t3uxb6zqklC6dxyVqIPhAkVX0ZWC XPwubqURstGShyy7/N/aYg0ljOOI8Pxm/e1ewQ== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --_000_ea8a8186d36e4321ada5886c7bf66f3anrccnrcgcca_ Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable I believe this is related to VACUUM FULL behavior in a streaming replicatio= n cfg , for the standby server the space is not been reclaimed , But the = sieze of db reported with pg_pretty_db_size is identical on both db size bu= t is not the actual sum of /var/lib/pgsql/data1 files +dir size on the act= ive PG were vacuum full reclaim the space. = = Is this a normal behavi= or in PG with reporting incorrect db size if vacuum full has not reclaim t= he OS disk space on both server? ________________________________ From: Laurenz Albe Sent: Sunday, August 10, 2025 12:27:31 PM To: Ghiurea, Isabella; pgsql-admin@postgresql.org Subject: EXT: Re: DB size value different than "/data" dir size ***Attention*** This email originated from outside of the NRC. ***Attention= *** Ce courriel provient de l'ext=E9rieur du CNRC. On Fri, 2025-08-08 at 23:17 +0000, Ghiurea, Isabella wrote: > I am running PGSQL version 12.3 cfg master-slave with streaming r= eplication > and I am facing a issue in the present active Pg db. > The database size reported from the following : pg_size_pretty() or pg_d= atabase_size() > or sum all of db objects is grater than the sum size of all directori= es/files > reported under /var/lib/pgsql/data1/tbl_space_name/PG_12,,,xxx/ . ( db = data tablespace) Perhaps some part of the data is in a different tablespace, maybe pg_defaul= t. Yours, Laurenz Albe --_000_ea8a8186d36e4321ada5886c7bf66f3anrccnrcgcca_ Content-Type: text/html; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable

I believe this is related to VACUUM FULL behavior in a streaming replica= tion cfg ,   for the standby server the space is not been reclaim= ed , But the sieze of db reported with pg_pretty_db_size is identical on bo= th db size but is  not the actual sum of /var/lib/pgsql/data1 files +dir size on the active PG were vacuum full reclaim the spa= ce.                    &n= bsp;                     =                      = ;                     &nb= sp;                     &= nbsp;                    =                     &nbs= p;           Is this a normal behavior  in PG with reporting incorrect db size if vacuum full has not reclaim th= e OS disk space on both server?


From: Laurenz Albe <la= urenz.albe@cybertec.at>
Sent: Sunday, August 10, 2025 12:27:31 PM
To: Ghiurea, Isabella; pgsql-admin@postgresql.org
Subject: EXT: Re: DB size value different than "/data" dir= size
 
***Attention*** This email originated from outside= of the NRC. ***Attention*** Ce courriel provient de l'ext=E9rieur du CNRC.
On Fri, 2025-08-08 at 23:17 +0000, Ghiurea, Isabella wrote:
> I am running   PGSQL version 12.3   cfg  = ; master-slave  with  streaming replication
> and I am facing a issue in the present active Pg db. 
> The database size reported from  the following : pg_size_pre= tty() or pg_database_size()
> or sum all of db  objects is  grater than the  sum size= of  all directories/files
> reported  under /var/lib/pgsql/data1/tbl_space_name/PG_12,,,xxx/ = .  ( db data tablespace)

Perhaps some part of the data is in a different tablespace, maybe pg_defaul= t.

Yours,
Laurenz Albe

--_000_ea8a8186d36e4321ada5886c7bf66f3anrccnrcgcca_--