REPACK and naming

David G. Johnston <david.g.johnston@gmail.com>

From: "David G. Johnston" <david.g.johnston@gmail.com>
To: David Rowley <dgrowleyml@gmail.com>
Cc: Robert Haas <robertmhaas@gmail.com>, Marcos Pegoraro <marcos@f10.com.br>, Álvaro Herrera <alvherre@alvh.no-ip.org>, Bruce Momjian <bruce@momjian.us>, PostgreSQL-development <pgsql-hackers@lists.postgresql.org>
Date: 2025-09-17T21:03:01Z
Lists: pgsql-hackers
On Wednesday, September 17, 2025, David Rowley <dgrowleyml@gmail.com> wrote:

> On Thu, 18 Sept 2025 at 01:09, Robert Haas <robertmhaas@gmail.com> wrote:
> > RETABLE just isn't a word. The code sometimes calls this a REWRITE of
> > a table, which would be reasonable.
>
> +1. I was reading this yesterday wondering why "REWRITE" didn't get a
> mention.


Agreed.


>
> The problem I have with REPACK is that "re" indicates that
> something is being re-done that's been done before. If you're calling
> REPACK for the first time on a table, that's not true.


As soon as you’ve written the first tuple you’ve begun “packing” the table
- repack then is simply unpacking it and putting back the stuff you want to
keep in possibly a structured way.

David J's "REBUILD" also seems ok.  In a green field, you could then
> have "REBUILD TABLE ..." and "REBUILD INDEX ..."
>

Rebuild has some prior art apparently, which makes it appealing.  But I’m
not a fan of the “shrink” usage the other products seem drawn to.

David J.