|
1 |
| -<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.138 2006/12/18 18:56:28 tgl Exp $ --> |
| 1 | +<!-- $PostgreSQL: pgsql/doc/src/sgml/catalogs.sgml,v 2.139 2006/12/23 00:43:08 tgl Exp $ --> |
2 | 2 | <!--
|
3 | 3 | Documentation of the system catalogs, directed toward PostgreSQL developers
|
4 | 4 | -->
|
|
160 | 160 |
|
161 | 161 | <row>
|
162 | 162 | <entry><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link></entry>
|
163 |
| - <entry>index access method operator classes</entry> |
| 163 | + <entry>access method operator classes</entry> |
164 | 164 | </row>
|
165 | 165 |
|
166 | 166 | <row>
|
167 | 167 | <entry><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link></entry>
|
168 | 168 | <entry>operators</entry>
|
169 | 169 | </row>
|
170 | 170 |
|
| 171 | + <row> |
| 172 | + <entry><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link></entry> |
| 173 | + <entry>access method operator families</entry> |
| 174 | + </row> |
| 175 | + |
171 | 176 | <row>
|
172 | 177 | <entry><link linkend="catalog-pg-pltemplate"><structname>pg_pltemplate</structname></link></entry>
|
173 | 178 | <entry>template data for procedural languages</entry>
|
|
516 | 521 | </indexterm>
|
517 | 522 |
|
518 | 523 | <para>
|
519 |
| - The catalog <structname>pg_amop</structname> stores information about operators |
520 |
| - associated with index access method operator classes. There is one |
521 |
| - row for each operator that is a member of an operator class. |
| 524 | + The catalog <structname>pg_amop</structname> stores information about |
| 525 | + operators associated with access method operator families. There is one |
| 526 | + row for each operator that is a member of an operator family. An operator |
| 527 | + can appear in more than one family, but may not appear in more than one |
| 528 | + position within a family. |
522 | 529 | </para>
|
523 | 530 |
|
524 | 531 | <table>
|
|
536 | 543 | <tbody>
|
537 | 544 |
|
538 | 545 | <row>
|
539 |
| - <entry><structfield>amopclaid</structfield></entry> |
| 546 | + <entry><structfield>amopfamily</structfield></entry> |
540 | 547 | <entry><type>oid</type></entry>
|
541 |
| - <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry> |
542 |
| - <entry>The index operator class this entry is for</entry> |
| 548 | + <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry> |
| 549 | + <entry>The operator family this entry is for</entry> |
543 | 550 | </row>
|
544 | 551 |
|
545 | 552 | <row>
|
546 |
| - <entry><structfield>amopsubtype</structfield></entry> |
| 553 | + <entry><structfield>amoplefttype</structfield></entry> |
547 | 554 | <entry><type>oid</type></entry>
|
548 | 555 | <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
549 |
| - <entry>Subtype to distinguish multiple entries for one strategy; |
550 |
| - zero for default</entry> |
| 556 | + <entry>Left-hand input data type of operator</entry> |
| 557 | + </row> |
| 558 | + |
| 559 | + <row> |
| 560 | + <entry><structfield>amoprighttype</structfield></entry> |
| 561 | + <entry><type>oid</type></entry> |
| 562 | + <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry> |
| 563 | + <entry>Right-hand input data type of operator</entry> |
551 | 564 | </row>
|
552 | 565 |
|
553 | 566 | <row>
|
|
571 | 584 | <entry>OID of the operator</entry>
|
572 | 585 | </row>
|
573 | 586 |
|
| 587 | + <row> |
| 588 | + <entry><structfield>amopmethod</structfield></entry> |
| 589 | + <entry><type>oid</type></entry> |
| 590 | + <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry> |
| 591 | + <entry>Index access method operator family is for</entry> |
| 592 | + </row> |
| 593 | + |
574 | 594 | </tbody>
|
575 | 595 | </tgroup>
|
576 | 596 | </table>
|
577 | 597 |
|
| 598 | + <para> |
| 599 | + An entry's <structfield>amopmethod</> must match the |
| 600 | + <structname>opfmethod</> of its containing operator family (including |
| 601 | + <structfield>amopmethod</> here is an intentional denormalization of the |
| 602 | + catalog structure for performance reasons). Also, |
| 603 | + <structfield>amoplefttype</> and <structfield>amoprighttype</> must match |
| 604 | + the <structfield>oprleft</> and <structfield>oprright</> fields of the |
| 605 | + referenced <structname>pg_operator</> entry. |
| 606 | + </para> |
| 607 | + |
578 | 608 | </sect1>
|
579 | 609 |
|
580 | 610 |
|
|
586 | 616 | </indexterm>
|
587 | 617 |
|
588 | 618 | <para>
|
589 |
| - The catalog <structname>pg_amproc</structname> stores information about support |
590 |
| - procedures |
591 |
| - associated with index access method operator classes. There is one |
592 |
| - row for each support procedure belonging to an operator class. |
| 619 | + The catalog <structname>pg_amproc</structname> stores information about |
| 620 | + support procedures associated with access method operator families. There |
| 621 | + is one row for each support procedure belonging to an operator family. |
593 | 622 | </para>
|
594 | 623 |
|
595 | 624 | <table>
|
|
607 | 636 | <tbody>
|
608 | 637 |
|
609 | 638 | <row>
|
610 |
| - <entry><structfield>amopclaid</structfield></entry> |
| 639 | + <entry><structfield>amprocfamily</structfield></entry> |
611 | 640 | <entry><type>oid</type></entry>
|
612 |
| - <entry><literal><link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>.oid</literal></entry> |
613 |
| - <entry>The index operator class this entry is for</entry> |
| 641 | + <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry> |
| 642 | + <entry>The operator family this entry is for</entry> |
| 643 | + </row> |
| 644 | + |
| 645 | + <row> |
| 646 | + <entry><structfield>amproclefttype</structfield></entry> |
| 647 | + <entry><type>oid</type></entry> |
| 648 | + <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry> |
| 649 | + <entry>Left-hand input data type of associated operator</entry> |
614 | 650 | </row>
|
615 | 651 |
|
616 | 652 | <row>
|
617 |
| - <entry><structfield>amprocsubtype</structfield></entry> |
| 653 | + <entry><structfield>amprocrighttype</structfield></entry> |
618 | 654 | <entry><type>oid</type></entry>
|
619 | 655 | <entry><literal><link linkend="catalog-pg-type"><structname>pg_type</structname></link>.oid</literal></entry>
|
620 |
| - <entry>Subtype, if cross-type routine, else zero</entry> |
| 656 | + <entry>Right-hand input data type of associated operator</entry> |
621 | 657 | </row>
|
622 | 658 |
|
623 | 659 | <row>
|
|
638 | 674 | </tgroup>
|
639 | 675 | </table>
|
640 | 676 |
|
| 677 | + <para> |
| 678 | + The usual interpretation of the |
| 679 | + <structfield>amproclefttype</> and <structfield>amprocrighttype</> fields |
| 680 | + is that they identify the left and right input types of the operator(s) |
| 681 | + that a particular support procedure supports. For some access methods |
| 682 | + these match the input data type(s) of the support procedure itself, for |
| 683 | + others not. There is a notion of <quote>default</> support procedures for |
| 684 | + an index, which are those with <structfield>amproclefttype</> and |
| 685 | + <structfield>amprocrighttype</> both equal to the index opclass's |
| 686 | + <structfield>opcintype</>. |
| 687 | + </para> |
| 688 | + |
641 | 689 | </sect1>
|
642 | 690 |
|
643 | 691 |
|
|
2843 | 2891 | The catalog <structname>pg_opclass</structname> defines
|
2844 | 2892 | index access method operator classes. Each operator class defines
|
2845 | 2893 | semantics for index columns of a particular data type and a particular
|
2846 |
| - index access method. Note that there can be multiple operator classes |
2847 |
| - for a given data type/access method combination, thus supporting multiple |
2848 |
| - behaviors. |
| 2894 | + index access method. An operator class essentially specifies that a |
| 2895 | + particular operator family is applicable to a particular indexable column |
| 2896 | + data type. The set of operators from the family that are actually usable |
| 2897 | + with the indexed column are whichever ones accept the column's data type |
| 2898 | + as their lefthand input. |
2849 | 2899 | </para>
|
2850 | 2900 |
|
2851 | 2901 | <para>
|
|
2867 | 2917 | <tbody>
|
2868 | 2918 |
|
2869 | 2919 | <row>
|
2870 |
| - <entry><structfield>opcamid</structfield></entry> |
| 2920 | + <entry><structfield>opcmethod</structfield></entry> |
2871 | 2921 | <entry><type>oid</type></entry>
|
2872 | 2922 | <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry>
|
2873 | 2923 | <entry>Index access method operator class is for</entry>
|
|
2894 | 2944 | <entry>Owner of the operator class</entry>
|
2895 | 2945 | </row>
|
2896 | 2946 |
|
| 2947 | + <row> |
| 2948 | + <entry><structfield>opcfamily</structfield></entry> |
| 2949 | + <entry><type>oid</type></entry> |
| 2950 | + <entry><literal><link linkend="catalog-pg-opfamily"><structname>pg_opfamily</structname></link>.oid</literal></entry> |
| 2951 | + <entry>Operator family containing the operator class</entry> |
| 2952 | + </row> |
| 2953 | + |
2897 | 2954 | <row>
|
2898 | 2955 | <entry><structfield>opcintype</structfield></entry>
|
2899 | 2956 | <entry><type>oid</type></entry>
|
|
2920 | 2977 | </table>
|
2921 | 2978 |
|
2922 | 2979 | <para>
|
2923 |
| - The majority of the information defining an operator class is actually |
2924 |
| - not in its <structname>pg_opclass</structname> row, but in the associated |
2925 |
| - rows in <structname>pg_amop</structname> and |
2926 |
| - <structname>pg_amproc</structname>. Those rows are considered to be |
2927 |
| - part of the operator class definition — this is not unlike the way |
2928 |
| - that a relation is defined by a single <structname>pg_class</structname> |
2929 |
| - row plus associated rows in <structname>pg_attribute</structname> and |
2930 |
| - other tables. |
| 2980 | + An operator class's <structfield>opcmethod</> must match the |
| 2981 | + <structname>opfmethod</> of its containing operator family. |
| 2982 | + Also, there must be no more than one <structname>pg_opclass</structname> |
| 2983 | + row having <structname>opcdefault</> true for any given combination of |
| 2984 | + <structname>opcmethod</> and <structname>opcintype</>. |
2931 | 2985 | </para>
|
2932 | 2986 |
|
2933 | 2987 | </sect1>
|
|
2993 | 3047 | </entry>
|
2994 | 3048 | </row>
|
2995 | 3049 |
|
| 3050 | + <row> |
| 3051 | + <entry><structfield>oprcanmerge</structfield></entry> |
| 3052 | + <entry><type>bool</type></entry> |
| 3053 | + <entry></entry> |
| 3054 | + <entry>This operator supports merge joins</entry> |
| 3055 | + </row> |
| 3056 | + |
2996 | 3057 | <row>
|
2997 | 3058 | <entry><structfield>oprcanhash</structfield></entry>
|
2998 | 3059 | <entry><type>bool</type></entry>
|
|
3035 | 3096 | <entry>Negator of this operator, if any</entry>
|
3036 | 3097 | </row>
|
3037 | 3098 |
|
3038 |
| - <row> |
3039 |
| - <entry><structfield>oprlsortop</structfield></entry> |
3040 |
| - <entry><type>oid</type></entry> |
3041 |
| - <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry> |
3042 |
| - <entry> |
3043 |
| - If this operator supports merge joins, the operator that sorts |
3044 |
| - the type of the left-hand operand (<literal>L<L</>) |
3045 |
| - </entry> |
3046 |
| - </row> |
3047 |
| - |
3048 |
| - <row> |
3049 |
| - <entry><structfield>oprrsortop</structfield></entry> |
3050 |
| - <entry><type>oid</type></entry> |
3051 |
| - <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry> |
3052 |
| - <entry> |
3053 |
| - If this operator supports merge joins, the operator that sorts |
3054 |
| - the type of the right-hand operand (<literal>R<R</>) |
3055 |
| - </entry> |
3056 |
| - </row> |
3057 |
| - |
3058 |
| - <row> |
3059 |
| - <entry><structfield>oprltcmpop</structfield></entry> |
3060 |
| - <entry><type>oid</type></entry> |
3061 |
| - <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry> |
3062 |
| - <entry> |
3063 |
| - If this operator supports merge joins, the less-than operator that |
3064 |
| - compares the left and right operand types (<literal>L<R</>) |
3065 |
| - </entry> |
3066 |
| - </row> |
3067 |
| - |
3068 |
| - <row> |
3069 |
| - <entry><structfield>oprgtcmpop</structfield></entry> |
3070 |
| - <entry><type>oid</type></entry> |
3071 |
| - <entry><literal><link linkend="catalog-pg-operator"><structname>pg_operator</structname></link>.oid</literal></entry> |
3072 |
| - <entry> |
3073 |
| - If this operator supports merge joins, the greater-than operator that |
3074 |
| - compares the left and right operand types (<literal>L>R</>) |
3075 |
| - </entry> |
3076 |
| - </row> |
3077 |
| - |
3078 | 3099 | <row>
|
3079 | 3100 | <entry><structfield>oprcode</structfield></entry>
|
3080 | 3101 | <entry><type>regproc</type></entry>
|
|
3107 | 3128 | </sect1>
|
3108 | 3129 |
|
3109 | 3130 |
|
| 3131 | + <sect1 id="catalog-pg-opfamily"> |
| 3132 | + <title><structname>pg_opfamily</structname></title> |
| 3133 | + |
| 3134 | + <indexterm zone="catalog-pg-opfamily"> |
| 3135 | + <primary>pg_opfamily</primary> |
| 3136 | + </indexterm> |
| 3137 | + |
| 3138 | + <para> |
| 3139 | + The catalog <structname>pg_opfamily</structname> defines operator families. |
| 3140 | + Each operator family is a collection of operators and associated |
| 3141 | + support routines that implement the semantics specified for a particular |
| 3142 | + index access method. Furthermore, the operators in a family are all |
| 3143 | + <quote>compatible</>, in a way that depends on the access method. |
| 3144 | + The operator family concept allows cross-data-type operators to be used |
| 3145 | + with indexes and to be reasoned about using knowledge of access method |
| 3146 | + semantics. |
| 3147 | + </para> |
| 3148 | + |
| 3149 | + <para> |
| 3150 | + Operator families are described at length in <xref linkend="xindex">. |
| 3151 | + </para> |
| 3152 | + |
| 3153 | + <table> |
| 3154 | + <title><structname>pg_opfamily</> Columns</title> |
| 3155 | + |
| 3156 | + <tgroup cols=4> |
| 3157 | + <thead> |
| 3158 | + <row> |
| 3159 | + <entry>Name</entry> |
| 3160 | + <entry>Type</entry> |
| 3161 | + <entry>References</entry> |
| 3162 | + <entry>Description</entry> |
| 3163 | + </row> |
| 3164 | + </thead> |
| 3165 | + <tbody> |
| 3166 | + |
| 3167 | + <row> |
| 3168 | + <entry><structfield>opfmethod</structfield></entry> |
| 3169 | + <entry><type>oid</type></entry> |
| 3170 | + <entry><literal><link linkend="catalog-pg-am"><structname>pg_am</structname></link>.oid</literal></entry> |
| 3171 | + <entry>Index access method operator family is for</entry> |
| 3172 | + </row> |
| 3173 | + |
| 3174 | + <row> |
| 3175 | + <entry><structfield>opfname</structfield></entry> |
| 3176 | + <entry><type>name</type></entry> |
| 3177 | + <entry></entry> |
| 3178 | + <entry>Name of this operator family</entry> |
| 3179 | + </row> |
| 3180 | + |
| 3181 | + <row> |
| 3182 | + <entry><structfield>opfnamespace</structfield></entry> |
| 3183 | + <entry><type>oid</type></entry> |
| 3184 | + <entry><literal><link linkend="catalog-pg-namespace"><structname>pg_namespace</structname></link>.oid</literal></entry> |
| 3185 | + <entry>Namespace of this operator family</entry> |
| 3186 | + </row> |
| 3187 | + |
| 3188 | + <row> |
| 3189 | + <entry><structfield>opfowner</structfield></entry> |
| 3190 | + <entry><type>oid</type></entry> |
| 3191 | + <entry><literal><link linkend="catalog-pg-authid"><structname>pg_authid</structname></link>.oid</literal></entry> |
| 3192 | + <entry>Owner of the operator family</entry> |
| 3193 | + </row> |
| 3194 | + |
| 3195 | + </tbody> |
| 3196 | + </tgroup> |
| 3197 | + </table> |
| 3198 | + |
| 3199 | + <para> |
| 3200 | + The majority of the information defining an operator family is not in its |
| 3201 | + <structname>pg_opfamily</structname> row, but in the associated rows in |
| 3202 | + <link linkend="catalog-pg-amop"><structname>pg_amop</structname></link>, |
| 3203 | + <link linkend="catalog-pg-amproc"><structname>pg_amproc</structname></link>, |
| 3204 | + and |
| 3205 | + <link linkend="catalog-pg-opclass"><structname>pg_opclass</structname></link>. |
| 3206 | + </para> |
| 3207 | + |
| 3208 | + </sect1> |
| 3209 | + |
| 3210 | + |
3110 | 3211 | <sect1 id="catalog-pg-pltemplate">
|
3111 | 3212 | <title><structname>pg_pltemplate</structname></title>
|
3112 | 3213 |
|
|
0 commit comments