Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/seg.sgml`
e20d56070031602e838a1950db22dc3e11904b9d875837d00000000100000fa4
 (<literal>&lt;</literal>,
   <literal>&gt;</literal> or <literal>~</literal>) can be stored as well.
   (Certainty indicators are ignored by all the built-in operators, however.)
   <xref linkend="seg-repr-table"/> gives an overview of allowed
   representations; <xref linkend="seg-input-examples"/> shows some
   examples.
  </para>

  <para>
   In <xref linkend="seg-repr-table"/>, <replaceable>x</replaceable>, <replaceable>y</replaceable>, and
   <replaceable>delta</replaceable> denote
   floating-point numbers.  <replaceable>x</replaceable> and <replaceable>y</replaceable>, but
   not <replaceable>delta</replaceable>, can be preceded by a certainty indicator.
  </para>

  <table id="seg-repr-table">
   <title><type>seg</type> External Representations</title>
   <tgroup cols="2">
    <tbody>
     <row>
      <entry><literal><replaceable>x</replaceable></literal></entry>
      <entry>Single value (zero-length interval)
      </entry>
     </row>
     <row>
      <entry><literal><replaceable>x</replaceable> .. <replaceable>y</replaceable></literal></entry>
      <entry>Interval from <replaceable>x</replaceable> to <replaceable>y</replaceable>
      </entry>
     </row>
     <row>
      <entry><literal><replaceable>x</replaceable> (+-) <replaceable>delta</replaceable></literal></entry>
      <entry>Interval from <replaceable>x</replaceable> - <replaceable>delta</replaceable> to
      <replaceable>x</replaceable> + <replaceable>delta</replaceable>
      </entry>
     </row>
     <row>
      <entry><literal><replaceable>x</replaceable> ..</literal></entry>
      <entry>Open interval with lower bound <replaceable>x</replaceable>
      </entry>
     </row>
     <row>
      <entry><literal>.. <replaceable>x</replaceable></literal></entry>
      <entry>Open interval with upper bound <replaceable>x</replaceable>
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <table id="seg-input-examples">
   <title>Examples of Valid <type>seg</type> Input</title>
   <tgroup cols="2">
    <colspec colname="col1" colwidth="1*"/>
    <colspec colname="col2" colwidth="2*"/>
    <tbody>
     <row>
      <entry><literal>5.0</literal></entry>
      <entry>
       Creates a zero-length segment (a point, if you will)
      </entry>
     </row>
     <row>
      <entry><literal>~5.0</literal></entry>
      <entry>
       Creates a zero-length segment and records
       <literal>~</literal> in the data.  <literal>~</literal> is ignored
       by <type>seg</type> operations, but
       is preserved as a comment.
      </entry>
     </row>
     <row>
      <entry><literal>&lt;5.0</literal></entry>
      <entry>
       Creates a point at 5.0.  <literal>&lt;</literal> is ignored but
       is preserved as a comment.
      </entry>
     </row>
     <row>
      <entry><literal>&gt;5.0</literal></entry>
      <entry>
       Creates a point at 5.0.  <literal>&gt;</literal> is ignored but
       is preserved as a comment.
      </entry>
     </row>
     <row>
      <entry><literal>5(+-)0.3</literal></entry>
      <entry>
        Creates an interval <literal>4.7 .. 5.3</literal>.
        Note that the <literal>(+-)</literal> notation isn't preserved.
      </entry>
     </row>
     <row>
      <entry><literal>50 .. </literal></entry>
      <entry>Everything that is greater than or equal to 50</entry>
     </row>
     <row>
      <entry><literal>.. 0</literal></entry>
      <entry>Everything that is less than or equal to 0</entry>
     </row>
     <row>
      <entry><literal>1.5e-2 .. 2E-2 </literal></entry>
      <entry>Creates an interval <literal>0.015 .. 0.02</literal></entry>
     </row>
     <row>
      <entry><literal>1 ... 2</literal></entry>
      <entry>
       The same as <literal>1...2</literal>, or <literal>1 .. 2</literal>,
       or <literal>1..2</literal>
       (spaces around the range operator are ignored)
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Because the <literal>...</literal> operator is widely used

Title: External Representations of seg Data Type
Summary
The seg data type allows for various external representations, including single values, intervals with specific bounds, and open intervals, with optional certainty indicators that are preserved but ignored by built-in operators, as shown in the provided tables of allowed representations and input examples.