| From: | Matthias van de Meent <boekewurm+postgres(at)gmail(dot)com> |
|---|---|
| To: | Aidar Imamov <imamovaj22(at)gmail(dot)com> |
| Cc: | PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Re: [PATCH] Use the table AM relation_size callback in the SQL size functions |
| Date: | 2026-11-25 15:59:47 |
| Message-ID: | CAEze2Wh3-FoqZaUkjfXaoTHiUgaHMRWaMB6h8P6ZXQYqoeubwg@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
On Wed, 25 Nov 2026 at 16:25, Aidar Imamov <imamovaj22(at)gmail(dot)com> wrote:
>
> pg_relation_size() and pg_table_size() measure a relation by summing up its
> files. That works for heap, but an AM may keep its data elsewhere, and
> then the functions report 0 while pg_database_size() sees the files just
> fine.
Where does such a hypothetical AM store its data, if not in the files
it's designated to use through its relfilenode association? And why
would pg_database_size() be guaranteed to know where to look for the
relation's data, if pg_relation_size() itself isn't able to find this
data?
Lastly, why wouldn't CREATE DATABASE ... TEMPLATE break if relation
data in the template database isn't stored in the place that
PostgreSQL expects it to be stored? Shouldn't that be accomodated,
too, if we were to allow table AMs to store their data in nonstandard
places?
Kind regards,
Matthias van de Meent
Databricks (https://www.databricks.com)
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Aleksandr Korchak | 2026-11-25 16:05:40 | Re: sync_standbys_defined and pg_stat_replication |
| Previous Message | Aleksandr Korchak | 2026-11-25 15:53:13 | PANIC at shutdown when a reload changes full_page_writes |