Re: CREATE INDEX...USING

From: Jeff Janes <jeff(dot)janes(at)gmail(dot)com>
To: Bruce Momjian <bruce(at)momjian(dot)us>
Cc: pgsql-docs <pgsql-docs(at)postgresql(dot)org>
Subject: Re: CREATE INDEX...USING
Date: 2022-08-17 21:11:23
Message-ID: CAMkU=1zsGME0tzkTRRH8offAeKwckhX_MTGb_P+qnmj2aiqWCw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

On Wed, Aug 17, 2022 at 2:58 PM Bruce Momjian <bruce(at)momjian(dot)us> wrote:

> On Wed, Aug 17, 2022 at 12:41:03PM -0400, Jeff Janes wrote:
> > This was recently added to CREATE INDEX reference page:
> >
> > + The optional <literal>USING</literal> clause specifies an index
> > + type as described in <xref linkend="indexes-types"/>. If not
> > + specified, a default index type will be used based on the
> > + data types of the columns.
> >
> > But I think this is wrong, the default type is BTREE, it does not depend
> on the
> > data type. Or at least, I've never witnessed the claimed behavior. The
> claim
> > also conflicts with what is said at https://www.postgresql.org/docs/10/
> > indexes-types.html
>
> You are correct --- parser/gram.y has:
>
> access_method_clause:
> USING name { $$ = $2; }
> | /*EMPTY*/ { $$ =
> DEFAULT_INDEX_TYPE; }
>
> and from include/catalog/index.h:
>
> #define DEFAULT_INDEX_TYPE "btree"
>
> Patch attached.
>
>
>
That looks good to me. But now looking over the linked pages more, it
seems like https://www.postgresql.org/docs/current/indexes-types.html was
never changed to admit the possibility of custom index access methods (like
bloom) and neither was the 'replaceable class="parameter">method' section
of https://www.postgresql.org/docs/current/sql-createindex.html.

Also, is it odd that we say essentially the same thing for literal USING as
we say for the replaceable /method/?

Cheers,

Jeff

In response to

Responses

Browse pgsql-docs by date

  From Date Subject
Next Message Bruce Momjian 2022-08-17 21:24:24 Re: Update documentation page for translators
Previous Message Daniel Gustafsson 2022-08-17 20:58:55 Re: Update documentation page for translators