Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpI9e-0001Mj-6N for pgsql-docs@arkaria.postgresql.org; Sat, 27 Jun 2020 21:14:30 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jpI9d-0004aj-32 for pgsql-docs@arkaria.postgresql.org; Sat, 27 Jun 2020 21:14:29 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpI9c-0004aa-Rs for pgsql-docs@lists.postgresql.org; Sat, 27 Jun 2020 21:14:28 +0000 Received: from momjian.us ([72.94.173.45]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1jpI9a-0007fD-21 for pgsql-docs@lists.postgresql.org; Sat, 27 Jun 2020 21:14:28 +0000 Received: from bruce by momjian.us with local (Exim 4.92) (envelope-from ) id 1jpI9X-0007LB-AH; Sat, 27 Jun 2020 17:14:23 -0400 Date: Sat, 27 Jun 2020 17:14:23 -0400 From: Bruce Momjian To: galiev_mr@taximaxim.ru, pgsql-docs@lists.postgresql.org Subject: Re: INDEX with optional storage parameter value Message-ID: <20200627211423.GG16644@momjian.us> References: <159283163235.684.4482737698910467437@wrigleys.postgresql.org> MIME-Version: 1.0 Content-Type: multipart/mixed; boundary="T4sUOijqQbZv57TR" Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <159283163235.684.4482737698910467437@wrigleys.postgresql.org> User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --T4sUOijqQbZv57TR Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit On Mon, Jun 22, 2020 at 01:13:52PM +0000, PG Doc comments form wrote: > The following documentation comment has been logged on the website: > > Page: https://www.postgresql.org/docs/12/sql-createindex.html > Description: > > Hello! > I noticed an slight inaccuracy in the documentation for CREATE INDEX and > ALTER INDEX: > > CREATE INDEX ... [ WITH ( storage_parameter = value [, ... ] ) ] > ALTER INDEX [ IF EXISTS ] name SET ( storage_parameter = value [, ... ] ) > > In indices, as in tables, you can omit the вoolean value for a parameter. > For example: > > CREATE INDEX ON public.testtable USING GIN (c1) WITH (fastupdate); > ALTER INDEX testtable_c1_idx SET (fastupdate); > > It might be more correct to use the construct from CREATE TABLE: > > storage_parameter [= value] [, ... ] Yes, I see that: CREATE TABLE testtable (c1 JSONB); CREATE INDEX ON public.testtable USING GIN (c1) WITH (fastupdate = true); CREATE INDEX ON public.testtable USING GIN (c1) WITH (fastupdate = false); CREATE INDEX ON public.testtable USING GIN (c1) WITH (fastupdate); \d testtable Table "public.testtable" Column | Type | Collation | Nullable | Default --------+-------+-----------+----------+--------- c1 | jsonb | | | Indexes: "testtable_c1_idx" gin (c1) WITH (fastupdate='true') "testtable_c1_idx1" gin (c1) WITH (fastupdate='false') "testtable_c1_idx2" gin (c1) WITH (fastupdate='true') I found a few more places that also didn't properly document this; patch attached. -- Bruce Momjian https://momjian.us EnterpriseDB https://enterprisedb.com The usefulness of a cup is in its emptiness, Bruce Lee --T4sUOijqQbZv57TR Content-Type: text/x-diff; charset=us-ascii Content-Disposition: attachment; filename="storage.diff" diff --git a/doc/src/sgml/ref/alter_index.sgml b/doc/src/sgml/ref/alter_index.sgml index de6f89d458..a5e3b06ee4 100644 --- a/doc/src/sgml/ref/alter_index.sgml +++ b/doc/src/sgml/ref/alter_index.sgml @@ -25,7 +25,7 @@ ALTER INDEX [ IF EXISTS ] name RENA ALTER INDEX [ IF EXISTS ] name SET TABLESPACE tablespace_name ALTER INDEX name ATTACH PARTITION index_name ALTER INDEX name DEPENDS ON EXTENSION extension_name -ALTER INDEX [ IF EXISTS ] name SET ( storage_parameter = value [, ... ] ) +ALTER INDEX [ IF EXISTS ] name SET ( storage_parameter [= value] [, ... ] ) ALTER INDEX [ IF EXISTS ] name RESET ( storage_parameter [, ... ] ) ALTER INDEX [ IF EXISTS ] name ALTER [ COLUMN ] column_number SET STATISTICS integer @@ -113,7 +113,7 @@ ALTER INDEX ALL IN TABLESPACE name - SET ( storage_parameter = value [, ... ] ) + SET ( storage_parameter [= value] [, ... ] ) This form changes one or more index-method-specific storage parameters diff --git a/doc/src/sgml/ref/alter_materialized_view.sgml b/doc/src/sgml/ref/alter_materialized_view.sgml index 9df8a79977..7321183dd0 100644 --- a/doc/src/sgml/ref/alter_materialized_view.sgml +++ b/doc/src/sgml/ref/alter_materialized_view.sgml @@ -42,7 +42,7 @@ ALTER MATERIALIZED VIEW ALL IN TABLESPACE namecolumn_name SET STORAGE { PLAIN | EXTERNAL | EXTENDED | MAIN } CLUSTER ON index_name SET WITHOUT CLUSTER - SET ( storage_parameter = value [, ... ] ) + SET ( storage_parameter [= value] [, ... ] ) RESET ( storage_parameter [, ... ] ) OWNER TO { new_owner | CURRENT_USER | SESSION_USER } diff --git a/doc/src/sgml/ref/alter_table.sgml b/doc/src/sgml/ref/alter_table.sgml index cbfb4828e5..b2eb7097a9 100644 --- a/doc/src/sgml/ref/alter_table.sgml +++ b/doc/src/sgml/ref/alter_table.sgml @@ -76,7 +76,7 @@ ALTER TABLE [ IF EXISTS ] name SET WITHOUT OIDS SET TABLESPACE new_tablespace SET { LOGGED | UNLOGGED } - SET ( storage_parameter = value [, ... ] ) + SET ( storage_parameter [= value] [, ... ] ) RESET ( storage_parameter [, ... ] ) INHERIT parent_table NO INHERIT parent_table @@ -702,7 +702,7 @@ WITH ( MODULUS numeric_literal, REM - SET ( storage_parameter = value [, ... ] ) + SET ( storage_parameter [= value] [, ... ] ) This form changes one or more storage parameters for the table. See diff --git a/doc/src/sgml/ref/create_index.sgml b/doc/src/sgml/ref/create_index.sgml index ff87b2d28f..33aa64e81d 100644 --- a/doc/src/sgml/ref/create_index.sgml +++ b/doc/src/sgml/ref/create_index.sgml @@ -24,7 +24,7 @@ PostgreSQL documentation CREATE [ UNIQUE ] INDEX [ CONCURRENTLY ] [ [ IF NOT EXISTS ] name ] ON [ ONLY ] table_name [ USING method ] ( { column_name | ( expression ) } [ COLLATE collation ] [ opclass [ ( opclass_parameter = value [, ... ] ) ] ] [ ASC | DESC ] [ NULLS { FIRST | LAST } ] [, ...] ) [ INCLUDE ( column_name [, ...] ) ] - [ WITH ( storage_parameter = value [, ... ] ) ] + [ WITH ( storage_parameter [= value] [, ... ] ) ] [ TABLESPACE tablespace_name ] [ WHERE predicate ] --T4sUOijqQbZv57TR--