Home Explore Blog CI



postgresql

2nd chunk of `doc/src/sgml/isn.sgml`
f658f7581ffbc684b38c630be8991d4dadcd71b4ac04f1e90000000100000fb6
 display format
      </entry>
     </row>
     <row>
      <entry><type>UPC</type></entry>
      <entry>
       Universal Product Codes
      </entry>
     </row>
    </tbody>
   </tgroup>
  </table>

  <para>
   Some notes:
  </para>

  <orderedlist>
   <listitem>
    <para>ISBN13, ISMN13, ISSN13 numbers are all EAN13 numbers.</para>
   </listitem>
   <listitem>
    <para>EAN13 numbers aren't always ISBN13, ISMN13 or ISSN13 (some
    are).</para>
   </listitem>
   <listitem>
    <para>Some ISBN13 numbers can be displayed as ISBN.</para>
   </listitem>
   <listitem>
    <para>Some ISMN13 numbers can be displayed as ISMN.</para>
   </listitem>
   <listitem>
    <para>Some ISSN13 numbers can be displayed as ISSN.</para>
   </listitem>
   <listitem>
    <para>UPC numbers are a subset of the EAN13 numbers (they are basically
    EAN13 without the first <literal>0</literal> digit).</para>
   </listitem>
   <listitem>
    <para>All UPC, ISBN, ISMN and ISSN numbers can be represented as EAN13
    numbers.</para>
   </listitem>
  </orderedlist>

  <para>
   Internally, all these types use the same representation (a 64-bit
   integer), and all are interchangeable.  Multiple types are provided
   to control display formatting and to permit tighter validity checking
   of input that is supposed to denote one particular type of number.
  </para>

  <para>
   The <type>ISBN</type>, <type>ISMN</type>, and <type>ISSN</type> types will display the
   short version of the number (ISxN 10) whenever it's possible, and will show
   ISxN 13 format for numbers that do not fit in the short version.
   The <type>EAN13</type>, <type>ISBN13</type>, <type>ISMN13</type> and
   <type>ISSN13</type> types will always display the long version of the ISxN
   (EAN13).
  </para>
 </sect2>

 <sect2 id="isn-casts">
  <title>Casts</title>

  <para>
   The <filename>isn</filename> module provides the following pairs of type casts:
  </para>

  <itemizedlist>
   <listitem>
    <para>
     ISBN13 &lt;=&gt; EAN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISMN13 &lt;=&gt; EAN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISSN13 &lt;=&gt; EAN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISBN &lt;=&gt; EAN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISMN &lt;=&gt; EAN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISSN &lt;=&gt; EAN13
    </para>
   </listitem>
   <listitem>
    <para>
     UPC  &lt;=&gt; EAN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISBN &lt;=&gt; ISBN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISMN &lt;=&gt; ISMN13
    </para>
   </listitem>
   <listitem>
    <para>
     ISSN &lt;=&gt; ISSN13
    </para>
   </listitem>
  </itemizedlist>

  <para>
   When casting from <type>EAN13</type> to another type, there is a run-time
   check that the value is within the domain of the other type, and an error
   is thrown if not.  The other casts are simply relabelings that will
   always succeed.
  </para>
 </sect2>

 <sect2 id="isn-funcs-ops">
  <title>Functions and Operators</title>

  <para>
   The <filename>isn</filename> module provides the standard comparison operators,
   plus B-tree and hash indexing support for all these data types.  In
   addition, there are several specialized functions, shown in <xref linkend="isn-functions"/>.
   In this table,
   <type>isn</type> means any one of the module's data types.
  </para>

  <table id="isn-functions">
   <title><filename>isn</filename> Functions</title>
    <tgroup cols="1">
     <thead>
      <row>
       <entry role="func_table_entry"><para role="func_signature">
        Function
       </para>
       <para>
        Description
       </para></entry>
      </row>
     </thead>

     <tbody>
      <row>
       <entry role="func_table_entry"><para role="func_signature">
        <indexterm><primary>make_valid</primary></indexterm>
        <function>make_valid</function> ( <type>isn</type> )
        <returnvalue>isn</returnvalue>

Title: ISN Module: Data Types, Casts, and Functions
Summary
The ISN module provides various data types for international standard numbers, including ISBN, ISMN, ISSN, and EAN13, with support for casting between types, comparison operators, and specialized functions, such as validation and formatting, to work with these numbers.