Thread

Commits

  1. Doc: fix bogus intarray index example.

  1. intarray doc example fix

    Simon Norris <snorris@hillcrestgeo.ca> — 2021-06-03T20:55:02Z

    Hi list,
    
    I noticed a very small problem in the intarray docs example.
    Trying out the example gives below error, the example uses the wrong parameter for the given operator class:
    
    db=# CREATE TABLE message (mid INT PRIMARY KEY, sections INT[]);
    CREATE TABLE
    db=# CREATE INDEX message_rdtree_idx ON message USING GIST (sections gist__int_ops(siglen=32));
    ERROR:  unrecognized parameter "siglen"
    
    I'm not familiar with emailing patches, diff of suggested fix is below.
    
    thanks
    Simon
    
    diff --git a/doc/src/sgml/intarray.sgml b/doc/src/sgml/intarray.sgml
    index dfe98279c0..7b809a3519 100644
    --- a/doc/src/sgml/intarray.sgml
    +++ b/doc/src/sgml/intarray.sgml
    @@ -446,7 +446,7 @@
     CREATE TABLE message (mid INT PRIMARY KEY, sections INT[], ...);
    
     -- create specialized index with signature length of 32 bytes
    -CREATE INDEX message_rdtree_idx ON message USING GIST (sections gist__int_ops(siglen=32));
    +CREATE INDEX message_rdtree_idx ON message USING GIST (sections gist__intbig_ops(siglen=32));
    
     -- select messages in section 1 OR 2 - OVERLAP operator
     SELECT message.mid FROM message WHERE message.sections &amp;&amp; '{1,2}';
    
    
    
  2. Re: intarray doc example fix

    Tom Lane <tgl@sss.pgh.pa.us> — 2021-06-04T00:28:32Z

    Simon Norris <snorris@hillcrestgeo.ca> writes:
    > I noticed a very small problem in the intarray docs example.
    > Trying out the example gives below error, the example uses the wrong parameter for the given operator class:
    
    > db=# CREATE TABLE message (mid INT PRIMARY KEY, sections INT[]);
    > CREATE TABLE
    > db=# CREATE INDEX message_rdtree_idx ON message USING GIST (sections gist__int_ops(siglen=32));
    > ERROR:  unrecognized parameter "siglen"
    
    Yup, that's clearly a thinko.  Will fix, thanks for noticing it!
    
    			regards, tom lane