Re: Inconsistency in owner assignment between INDEX and STATISTICS

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Shin Berg <sjh910805(at)gmail(dot)com>
Cc: Amit Khandekar <amitdkhan(dot)pg(at)gmail(dot)com>, pgsql-hackers(at)lists(dot)postgresql(dot)org
Subject: Re: Inconsistency in owner assignment between INDEX and STATISTICS
Date: 2026-03-15 20:09:39
Message-ID: 2119849.1773605379@sss.pgh.pa.us
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Shin Berg <sjh910805(at)gmail(dot)com> writes:
> Thank you for the detailed feedback, Amit.
> You're right on both points. I had been comparing STATISTICS against INDEX
> and treating the difference as an inconsistency, but as you point out,
> INDEX ownership is special — it's tied to the table and intentionally not
> user-adjustable. STATISTICS follows the same ownership model as VIEW (the
> creator becomes the owner), which is consistent and by design.

One point that was not mentioned is that while indexes are necessarily
tied to a single table, statistics objects might not always be. The
long-term hope is to allow statistics on cross-table combinations of
columns, which is why the syntax was intentionally set up to look like
SELECT. So, just like views, it's reasonable to give them independent
ownership.

regards, tom lane

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Jelte Fennema-Nio 2026-03-15 20:19:52 Re: Extension security improvement: Add support for extensions with an owned schema
Previous Message Tomas Vondra 2026-03-15 19:49:17 EXPLAIN: showing ReadStream / prefetch stats