Re: Docs: Distinguish table and index storage parameters in CREATE TABLE

From: "David G(dot) Johnston" <david(dot)g(dot)johnston(at)gmail(dot)com>
To: Robert Treat <rob(at)xzilla(dot)net>
Cc: Andreas Karlsson <andreas(at)proxel(dot)se>, PostgreSQL Hackers <pgsql-hackers(at)lists(dot)postgresql(dot)org>
Subject: Re: Docs: Distinguish table and index storage parameters in CREATE TABLE
Date: 2026-04-04 03:03:35
Message-ID: CAKFQuwaK50p9TbNp2=AvwstzhvjXS+9kvq96v-A5OviUZCLRqw@mail.gmail.com
Views: Whole Thread | Raw Message | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Friday, April 3, 2026, Robert Treat <rob(at)xzilla(dot)net> wrote:

> On Fri, Apr 3, 2026 at 3:35 PM Andreas Karlsson <andreas(at)proxel(dot)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.

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2026-04-04 03:14:46 Re: pg_plan_advice
Previous Message Nathan Bossart 2026-04-04 02:55:25 remove autoanalyze corner case