| From: | Chao Li <li(dot)evan(dot)chao(at)gmail(dot)com> |
|---|---|
| To: | Postgres hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org> |
| Subject: | Standardize relation name formatting in ANALYZE messages |
| Date: | 2026-01-08 06:20:25 |
| Message-ID: | CAEoWx2mAwXnxVWTP=dgwA98dJ7JxzxM8qToaxAGuByHN1-=oNQ@mail.gmail.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-hackers |
Hi Hacker,
While testing patch [1], I noticed that ANALYZE VERBOSE currently reports
the same relation name in inconsistent forms within a single command
output. For example:
```
evantest=# ANALYZE VERBOSE t_heap;
INFO: analyzing "public.t_heap"
INFO: "t_heap": scanned 173 of 173 pages, containing 10000 live rows and 0
dead rows; 10000 rows in sample, 10000 estimated total rows
INFO: finished analyzing table "evantest.public.t_heap"
avg read rate: 98.805 MB/s, avg write rate: 2.298 MB/s
buffer usage: 164 hits, 215 reads, 5 dirtied
WAL usage: 11 records, 5 full page images, 27804 bytes, 26912 full page
image bytes, 0 buffers full
system usage: CPU: user: 0.00 s, system: 0.00 s, elapsed: 0.01 s
```
Here, the three INFO lines refer to the same table using three different
formats: schema.table, unqualified table name, and database.schema.table.
For readability and consistency, it seems preferable to use a single,
stable formatting for relation names in ANALYZE output. This patch updates
ANALYZE-related messages to consistently format relation names using
quote_qualified_identifier(schema, relation), which is already the common
convention used across the backend.
This is a cosmetic change only; it does not affect ANALYZE behavior. With
the patch, the output now looks like:
```
evantest=# ANALYZE VERBOSE t_heap;
INFO: analyzing "public.t_heap"
INFO: "public.t_heap": scanned 173 of 173 pages, containing 10000 live
rows and 0 dead rows; 10000 rows in sample, 10000 estimated total rows
INFO: finished analyzing table “public.t_heap”
.. omit rest ...
```
[1]
https://postgr.es/m/CAHza6qcTZd-eUBchXafeU2RwkhmBP1MVnoJthHbgi_Jy_UiyQA@mail.gmail.com
Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/
| Attachment | Content-Type | Size |
|---|---|---|
| v1-0001-Standardize-relation-name-formatting-in-ANALYZE-m.patch | application/octet-stream | 5.6 KB |
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Soumya S Murali | 2026-01-08 06:28:43 | Re: [PATCH] Expose checkpoint reason to completion log messages. |
| Previous Message | Neil Chen | 2026-01-08 06:18:44 | Re: Optimize SnapBuildPurgeOlderTxn to purge committed xids in-place |