Re: Docs: Distinguish table and index storage parameters in CREATE TABLE - Mailing list pgsql-hackers

From David G. Johnston
Subject Re: Docs: Distinguish table and index storage parameters in CREATE TABLE
Date
Msg-id CAKFQuwaK50p9TbNp2=AvwstzhvjXS+9kvq96v-A5OviUZCLRqw@mail.gmail.com
Whole thread
In response to Re: Docs: Distinguish table and index storage parameters in CREATE TABLE  (Robert Treat <rob@xzilla.net>)
List pgsql-hackers
On Friday, April 3, 2026, Robert Treat <rob@xzilla.net> wrote:
On Fri, Apr 3, 2026 at 3:35 PM Andreas Karlsson <andreas@proxel.se> wrote:
> On 4/3/26 9:27 PM, Andreas Karlsson wrote:
> > On 4/3/26 8:18 PM, David G. Johnston wrote:
> >> Per the discussion on -general [1] I propose that we stop using the
> >> generic label storage_parameter on the create table reference page and
> >> instead set up proper labels for table and index variants.
> >

It's sort of interesting that no one in the above discussion gave an
example like:
create table t (c int, constraint pk primary key (c) with (fillfactor
= 90)) with (fillfactor = 100);
and pointing out that where you put the parameter changes what it
effects, so I'm a little skeptical that this patch would help the
original discussion, but it certainly wouldn't hurt, so +1 from me.

Stretches my skills a bit but if the error message had been: (unrecognized index storage parameter “autovacuum_enabled”) the syntax placement issue may have been recognized working under the assumption the author knows their intent is to modify the table (and vice-versa).

As a quick footgun prevention attempt (not a huge fan though):

Note, specifying a primary key or unique constraint as the final component of create table makes assigning storage parameters to the wrong object more likely.
(Added to the with clause section)

David J.

pgsql-hackers by date:

Previous
From: Nathan Bossart
Date:
Subject: remove autoanalyze corner case
Next
From: Tom Lane
Date:
Subject: Re: pg_plan_advice