Standardize relation name formatting in ANALYZE messages - Mailing list pgsql-hackers

From Chao Li
Subject Standardize relation name formatting in ANALYZE messages
Date
Msg-id CAEoWx2mAwXnxVWTP=dgwA98dJ7JxzxM8qToaxAGuByHN1-=oNQ@mail.gmail.com
Whole thread Raw
List 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 ...
```


Best regards,
--
Chao Li (Evan)
HighGo Software Co., Ltd.
https://www.highgo.com/




Attachment

pgsql-hackers by date:

Previous
From: Neil Chen
Date:
Subject: Re: Optimize SnapBuildPurgeOlderTxn to purge committed xids in-place
Next
From: Soumya S Murali
Date:
Subject: Re: [PATCH] Expose checkpoint reason to completion log messages.