Skip to content

Commit f6d65f0

Browse files
committed
docs: consistently uppercase index method and add spacing
Consistently uppercase index method names, e.g. GIN, and add space after the index method name and the parentheses enclosing the column names.
1 parent 9feaba2 commit f6d65f0

10 files changed

+23
-23
lines changed

doc/src/sgml/btree-gin.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -36,7 +36,7 @@
3636
<programlisting>
3737
CREATE TABLE test (a int4);
3838
-- create index
39-
CREATE INDEX testidx ON test USING gin (a);
39+
CREATE INDEX testidx ON test USING GIN (a);
4040
-- query
4141
SELECT * FROM test WHERE a &lt; 10;
4242
</programlisting>

doc/src/sgml/btree-gist.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -61,7 +61,7 @@
6161
<programlisting>
6262
CREATE TABLE test (a int4);
6363
-- create index
64-
CREATE INDEX testidx ON test USING gist (a);
64+
CREATE INDEX testidx ON test USING GIST (a);
6565
-- query
6666
SELECT * FROM test WHERE a &lt; 10;
6767
-- nearest-neighbor search: find the ten entries closest to "42"
@@ -78,7 +78,7 @@ SELECT *, a &lt;-&gt; 42 AS dist FROM test ORDER BY a &lt;-&gt; 42 LIMIT 10;
7878
=&gt; CREATE TABLE zoo (
7979
cage INTEGER,
8080
animal TEXT,
81-
EXCLUDE USING gist (cage WITH =, animal WITH &lt;&gt;)
81+
EXCLUDE USING GIST (cage WITH =, animal WITH &lt;&gt;)
8282
);
8383

8484
=&gt; INSERT INTO zoo VALUES(123, 'zebra');

doc/src/sgml/gist.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -220,7 +220,7 @@
220220
To use it, mention the class name in <command>CREATE INDEX</>,
221221
for example
222222
<programlisting>
223-
CREATE INDEX ON my_table USING gist (my_inet_column inet_ops);
223+
CREATE INDEX ON my_table USING GIST (my_inet_column inet_ops);
224224
</programlisting>
225225
</para>
226226

doc/src/sgml/indices.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -189,7 +189,7 @@ CREATE INDEX test1_id_index ON test1 (id);
189189
<literal>=</literal> operator.
190190
The following command is used to create a hash index:
191191
<synopsis>
192-
CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> USING hash (<replaceable>column</replaceable>);
192+
CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> USING HASH (<replaceable>column</replaceable>);
193193
</synopsis>
194194
</para>
195195

doc/src/sgml/json.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -375,13 +375,13 @@ SELECT '"foo"'::jsonb ? 'foo';
375375
implement, see <xref linkend="functions-jsonb-op-table">.)
376376
An example of creating an index with this operator class is:
377377
<programlisting>
378-
CREATE INDEX idxgin ON api USING gin (jdoc);
378+
CREATE INDEX idxgin ON api USING GIN (jdoc);
379379
</programlisting>
380380
The non-default GIN operator class <literal>jsonb_path_ops</>
381381
supports indexing the <literal>@&gt;</> operator only.
382382
An example of creating an index with this operator class is:
383383
<programlisting>
384-
CREATE INDEX idxginp ON api USING gin (jdoc jsonb_path_ops);
384+
CREATE INDEX idxginp ON api USING GIN (jdoc jsonb_path_ops);
385385
</programlisting>
386386
</para>
387387

@@ -426,7 +426,7 @@ SELECT jdoc-&gt;'guid', jdoc-&gt;'name' FROM api WHERE jdoc -&gt; 'tags' ? 'qui'
426426
the <literal>"tags"</> key is common, defining an index like this
427427
may be worthwhile:
428428
<programlisting>
429-
CREATE INDEX idxgintags ON api USING gin ((jdoc -&gt; 'tags'));
429+
CREATE INDEX idxgintags ON api USING GIN ((jdoc -&gt; 'tags'));
430430
</programlisting>
431431
Now, the <literal>WHERE</> clause <literal>jdoc -&gt; 'tags' ? 'qui'</>
432432
will be recognized as an application of the indexable

doc/src/sgml/ltree.sgml

+2-2
Original file line numberDiff line numberDiff line change
@@ -550,8 +550,8 @@ INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy');
550550
INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy.Stars');
551551
INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy.Galaxies');
552552
INSERT INTO test VALUES ('Top.Collections.Pictures.Astronomy.Astronauts');
553-
CREATE INDEX path_gist_idx ON test USING gist(path);
554-
CREATE INDEX path_idx ON test USING btree(path);
553+
CREATE INDEX path_gist_idx ON test USING GIST (path);
554+
CREATE INDEX path_idx ON test USING BTREE (path);
555555
</programlisting>
556556

557557
<para>

doc/src/sgml/pgtrgm.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -168,11 +168,11 @@
168168

169169
<programlisting>
170170
CREATE TABLE test_trgm (t text);
171-
CREATE INDEX trgm_idx ON test_trgm USING gist (t gist_trgm_ops);
171+
CREATE INDEX trgm_idx ON test_trgm USING GIST (t gist_trgm_ops);
172172
</programlisting>
173173
or
174174
<programlisting>
175-
CREATE INDEX trgm_idx ON test_trgm USING gin (t gin_trgm_ops);
175+
CREATE INDEX trgm_idx ON test_trgm USING GIN (t gin_trgm_ops);
176176
</programlisting>
177177
</para>
178178

@@ -274,7 +274,7 @@ CREATE TABLE words AS SELECT word FROM
274274
Next, create a trigram index on the word column:
275275

276276
<programlisting>
277-
CREATE INDEX words_idx ON words USING gin(word gin_trgm_ops);
277+
CREATE INDEX words_idx ON words USING GIN (word gin_trgm_ops);
278278
</programlisting>
279279

280280
Now, a <command>SELECT</command> query similar to the previous example can

doc/src/sgml/rangetypes.sgml

+3-3
Original file line numberDiff line numberDiff line change
@@ -406,7 +406,7 @@ SELECT '[1.234, 5.678]'::floatrange;
406406
GiST and SP-GiST indexes can be created for table columns of range types.
407407
For instance, to create a GiST index:
408408
<programlisting>
409-
CREATE INDEX reservation_idx ON reservation USING gist (during);
409+
CREATE INDEX reservation_idx ON reservation USING GIST (during);
410410
</programlisting>
411411
A GiST or SP-GiST index can accelerate queries involving these range operators:
412412
<literal>=</>,
@@ -453,7 +453,7 @@ CREATE INDEX reservation_idx ON reservation USING gist (during);
453453
<programlisting>
454454
CREATE TABLE reservation (
455455
during tsrange,
456-
EXCLUDE USING gist (during WITH &amp;&amp;)
456+
EXCLUDE USING GIST (during WITH &amp;&amp;)
457457
);
458458
</programlisting>
459459

@@ -486,7 +486,7 @@ CREATE EXTENSION btree_gist;
486486
CREATE TABLE room_reservation (
487487
room text,
488488
during tsrange,
489-
EXCLUDE USING gist (room WITH =, during WITH &amp;&amp;)
489+
EXCLUDE USING GIST (room WITH =, during WITH &amp;&amp;)
490490
);
491491

492492
INSERT INTO room_reservation VALUES

doc/src/sgml/ref/create_index.sgml

+1-1
Original file line numberDiff line numberDiff line change
@@ -637,7 +637,7 @@ CREATE UNIQUE INDEX title_idx ON films (title) WITH (fillfactor = 70);
637637
<para>
638638
To create a <acronym>GIN</> index with fast updates disabled:
639639
<programlisting>
640-
CREATE INDEX gin_idx ON documents_table USING gin (locations) WITH (fastupdate = off);
640+
CREATE INDEX gin_idx ON documents_table USING GIN (locations) WITH (fastupdate = off);
641641
</programlisting>
642642
</para>
643643

doc/src/sgml/textsearch.sgml

+6-6
Original file line numberDiff line numberDiff line change
@@ -481,7 +481,7 @@ LIMIT 10;
481481
linkend="textsearch-indexes">) to speed up text searches:
482482

483483
<programlisting>
484-
CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('english', body));
484+
CREATE INDEX pgweb_idx ON pgweb USING GIN (to_tsvector('english', body));
485485
</programlisting>
486486

487487
Notice that the 2-argument version of <function>to_tsvector</function> is
@@ -511,7 +511,7 @@ CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('english', body));
511511
configuration name is specified by another column, e.g.:
512512

513513
<programlisting>
514-
CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector(config_name, body));
514+
CREATE INDEX pgweb_idx ON pgweb USING GIN (to_tsvector(config_name, body));
515515
</programlisting>
516516

517517
where <literal>config_name</> is a column in the <literal>pgweb</>
@@ -527,7 +527,7 @@ CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector(config_name, body));
527527
Indexes can even concatenate columns:
528528

529529
<programlisting>
530-
CREATE INDEX pgweb_idx ON pgweb USING gin(to_tsvector('english', title || ' ' || body));
530+
CREATE INDEX pgweb_idx ON pgweb USING GIN (to_tsvector('english', title || ' ' || body));
531531
</programlisting>
532532
</para>
533533

@@ -547,7 +547,7 @@ UPDATE pgweb SET textsearchable_index_col =
547547
Then we create a <acronym>GIN</acronym> index to speed up the search:
548548

549549
<programlisting>
550-
CREATE INDEX textsearch_idx ON pgweb USING gin(textsearchable_index_col);
550+
CREATE INDEX textsearch_idx ON pgweb USING GIN (textsearchable_index_col);
551551
</programlisting>
552552

553553
Now we are ready to perform a fast full text search:
@@ -3217,7 +3217,7 @@ SELECT plainto_tsquery('supernovae stars');
32173217
<tertiary>text search</tertiary>
32183218
</indexterm>
32193219

3220-
<literal>CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> USING gist(<replaceable>column</replaceable>);</literal>
3220+
<literal>CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> USING GIST (<replaceable>column</replaceable>);</literal>
32213221
</term>
32223222

32233223
<listitem>
@@ -3238,7 +3238,7 @@ SELECT plainto_tsquery('supernovae stars');
32383238
<tertiary>text search</tertiary>
32393239
</indexterm>
32403240

3241-
<literal>CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> USING gin(<replaceable>column</replaceable>);</literal>
3241+
<literal>CREATE INDEX <replaceable>name</replaceable> ON <replaceable>table</replaceable> USING GIN (<replaceable>column</replaceable>);</literal>
32423242
</term>
32433243

32443244
<listitem>

0 commit comments

Comments
 (0)