"Euler Taveira" <euler@eulerto.com> writes:
> On Wed, Dec 11, 2024, at 3:37 AM, Nohez Poonawala wrote:
>> To maintain consistency, I suggest modifying the comment format for
>> indexes to include the associated TABLENAME, similar to constraints.
>> For example:
>> - for Index:
>> -- Name: TABLENAME INDEXNAME; Type: INDEX; Schema: SCHEMA; Owner: OWNER
> ... An argument against this inclusion is that it will
> increase the output file size without adding a crucial information. You mention
> consistency but since it is a different class of objects I don't think this
> argument holds much water.
I think a bigger problem is compatibility. It seems likely that there
are tools out there that would be broken by such a change. These
comments aren't just comments: they directly reflect what is in the
"tag" fields of the per-object entries in the custom dump format.
So for example this would also affect the output of "pg_restore -l".
Even if you doubt that anything is scanning actual dump files looking
for these comments, it seems certain that people have built tools
and scripts that examine -l output. There might well be places in
pg_restore itself that depend on the tag being just the index name
and no more, too.
I'll concede that this proposal would have been a good idea if it'd
been done that way early on. But I don't think it's such a good idea
as to be worth breaking things for.
regards, tom lane