From 372728b0d49552641f0ea83d9d2e08817de038fa Mon Sep 17 00:00:00 2001 From: Tom Lane Date: Sun, 8 Apr 2018 13:16:50 -0400 Subject: [PATCH] Replace our traditional initial-catalog-data format with a better design. Historically, the initial catalog data to be installed during bootstrap has been written in DATA() lines in the catalog header files. This had lots of disadvantages: the format was badly underdocumented, it was very difficult to edit the data in any mechanized way, and due to the lack of any abstraction the data was verbose, hard to read/understand, and easy to get wrong. Hence, move this data into separate ".dat" files and represent it in a way that can easily be read and rewritten by Perl scripts. The new format is essentially "key => value" for each column; while it's a bit repetitive, explicit labeling of each value makes the data far more readable and less error-prone. Provide a way to abbreviate entries by omitting field values that match a specified default value for their column. This allows removal of a large amount of repetitive boilerplate and also lowers the barrier to adding new columns. Also teach genbki.pl how to translate symbolic OID references into numeric OIDs for more cases than just "regproc"-like pg_proc references. It can now do that for regprocedure-like references (thus solving the problem that regproc is ambiguous for overloaded functions), operators, types, opfamilies, opclasses, and access methods. Use this to turn nearly all OID cross-references in the initial data into symbolic form. This represents a very large step forward in readability and error resistance of the initial catalog data. It should also reduce the difficulty of renumbering OID assignments in uncommitted patches. Also, solve the longstanding problem that frontend code that would like to use OID macros and other information from the catalog headers often had difficulty with backend-only code in the headers. To do this, arrange for all generated macros, plus such other declarations as we deem fit, to be placed in "derived" header files that are safe for frontend inclusion. (Once clients migrate to using these pg_*_d.h headers, it will be possible to get rid of the pg_*_fn.h headers, which only exist to quarantine code away from clients. That is left for follow-on patches, however.) The now-automatically-generated macros include the Anum_xxx and Natts_xxx constants that we used to have to update by hand when adding or removing catalog columns. Replace the former manual method of generating OID macros for pg_type entries with an automatic method, ensuring that all built-in types have OID macros. (But note that this patch does not change the way that OID macros for pg_proc entries are built and used. It's not clear that making that match the other catalogs would be worth extra code churn.) Add SGML documentation explaining what the new data format is and how to work with it. Despite being a very large change in the catalog headers, there is no catversion bump here, because postgres.bki and related output files haven't changed at all. John Naylor, based on ideas from various people; review and minor additional coding by me; previous review by Alvaro Herrera Discussion: https://postgr.es/m/CAJVSVGWO48JbbwXkJz_yBFyGYW-M9YWxnPdxJBUosDC9ou_F0Q@mail.gmail.com --- doc/src/sgml/bki.sgml | 661 +- doc/src/sgml/libpq.sgml | 2 +- src/Makefile | 5 + src/backend/Makefile | 34 +- src/backend/catalog/.gitignore | 2 + src/backend/catalog/Catalog.pm | 313 +- src/backend/catalog/Makefile | 87 +- src/backend/catalog/README | 111 - src/backend/catalog/genbki.pl | 478 +- src/backend/utils/Gen_fmgrtab.pl | 62 +- src/backend/utils/Makefile | 15 +- src/include/Makefile | 6 +- src/include/catalog/.gitignore | 2 + src/include/catalog/Makefile | 31 + src/include/catalog/duplicate_oids | 6 +- src/include/catalog/genbki.h | 29 +- src/include/catalog/indexing.h | 2 +- src/include/catalog/pg_aggregate.dat | 598 + src/include/catalog/pg_aggregate.h | 336 +- src/include/catalog/pg_am.dat | 34 + src/include/catalog/pg_am.h | 62 +- src/include/catalog/pg_amop.dat | 2472 ++++ src/include/catalog/pg_amop.h | 1148 +- src/include/catalog/pg_amproc.dat | 1277 ++ src/include/catalog/pg_amproc.h | 554 +- src/include/catalog/pg_attrdef.h | 20 +- src/include/catalog/pg_attribute.h | 59 +- src/include/catalog/pg_auth_members.h | 22 +- src/include/catalog/pg_authid.dat | 67 + src/include/catalog/pg_authid.h | 71 +- src/include/catalog/pg_cast.dat | 535 + src/include/catalog/pg_cast.h | 368 +- src/include/catalog/pg_class.dat | 68 + src/include/catalog/pg_class.h | 76 +- src/include/catalog/pg_collation.dat | 31 + src/include/catalog/pg_collation.h | 42 +- src/include/catalog/pg_constraint.h | 56 +- src/include/catalog/pg_conversion.h | 29 +- src/include/catalog/pg_database.dat | 26 + src/include/catalog/pg_database.h | 34 +- src/include/catalog/pg_db_role_setting.h | 29 +- src/include/catalog/pg_default_acl.h | 27 +- src/include/catalog/pg_depend.h | 49 +- src/include/catalog/pg_description.h | 37 +- src/include/catalog/pg_enum.h | 27 +- src/include/catalog/pg_event_trigger.h | 22 +- src/include/catalog/pg_extension.h | 29 +- src/include/catalog/pg_foreign_data_wrapper.h | 23 +- src/include/catalog/pg_foreign_server.h | 23 +- src/include/catalog/pg_foreign_table.h | 19 +- src/include/catalog/pg_index.h | 38 +- src/include/catalog/pg_inherits.h | 24 +- src/include/catalog/pg_init_privs.h | 42 +- src/include/catalog/pg_language.dat | 31 + src/include/catalog/pg_language.h | 39 +- src/include/catalog/pg_largeobject.h | 19 +- src/include/catalog/pg_largeobject_metadata.h | 18 +- src/include/catalog/pg_namespace.dat | 25 + src/include/catalog/pg_namespace.h | 37 +- src/include/catalog/pg_opclass.dat | 357 + src/include/catalog/pg_opclass.h | 222 +- src/include/catalog/pg_operator.dat | 3340 +++++ src/include/catalog/pg_operator.h | 1854 +-- src/include/catalog/pg_opfamily.dat | 248 + src/include/catalog/pg_opfamily.h | 170 +- src/include/catalog/pg_partitioned_table.h | 24 +- src/include/catalog/pg_pltemplate.dat | 51 + src/include/catalog/pg_pltemplate.h | 39 +- src/include/catalog/pg_policy.h | 29 +- src/include/catalog/pg_proc.dat | 10210 ++++++++++++++++ src/include/catalog/pg_proc.h | 5637 +-------- src/include/catalog/pg_publication.h | 24 +- src/include/catalog/pg_publication_rel.h | 19 +- src/include/catalog/pg_range.dat | 31 + src/include/catalog/pg_range.h | 61 +- src/include/catalog/pg_replication_origin.h | 22 +- src/include/catalog/pg_rewrite.h | 23 +- src/include/catalog/pg_seclabel.h | 16 +- src/include/catalog/pg_sequence.h | 20 +- src/include/catalog/pg_shdepend.h | 42 +- src/include/catalog/pg_shdescription.h | 36 +- src/include/catalog/pg_shseclabel.h | 18 +- src/include/catalog/pg_statistic.h | 44 +- src/include/catalog/pg_statistic_ext.h | 26 +- src/include/catalog/pg_subscription.h | 20 +- src/include/catalog/pg_subscription_rel.h | 19 +- src/include/catalog/pg_tablespace.dat | 22 + src/include/catalog/pg_tablespace.h | 26 +- src/include/catalog/pg_transform.h | 25 +- src/include/catalog/pg_trigger.h | 35 +- src/include/catalog/pg_ts_config.dat | 19 + src/include/catalog/pg_ts_config.h | 29 +- src/include/catalog/pg_ts_config_map.dat | 35 + src/include/catalog/pg_ts_config_map.h | 47 +- src/include/catalog/pg_ts_dict.dat | 20 + src/include/catalog/pg_ts_dict.h | 31 +- src/include/catalog/pg_ts_parser.dat | 20 + src/include/catalog/pg_ts_parser.h | 58 +- src/include/catalog/pg_ts_template.dat | 30 + src/include/catalog/pg_ts_template.h | 49 +- src/include/catalog/pg_type.dat | 942 ++ src/include/catalog/pg_type.h | 565 +- src/include/catalog/pg_user_mapping.h | 19 +- src/include/catalog/reformat_dat_file.pl | 311 + src/include/catalog/toasting.h | 2 +- src/include/catalog/unused_oids | 8 +- src/interfaces/ecpg/ecpglib/pg_type.h | 65 +- src/tools/msvc/Solution.pm | 49 +- src/tools/msvc/clean.bat | 2 + src/tools/pgindent/pgindent | 8 +- 110 files changed, 22928 insertions(+), 12480 deletions(-) delete mode 100644 src/backend/catalog/README create mode 100644 src/include/catalog/Makefile create mode 100644 src/include/catalog/pg_aggregate.dat create mode 100644 src/include/catalog/pg_am.dat create mode 100644 src/include/catalog/pg_amop.dat create mode 100644 src/include/catalog/pg_amproc.dat create mode 100644 src/include/catalog/pg_authid.dat create mode 100644 src/include/catalog/pg_cast.dat create mode 100644 src/include/catalog/pg_class.dat create mode 100644 src/include/catalog/pg_collation.dat create mode 100644 src/include/catalog/pg_database.dat create mode 100644 src/include/catalog/pg_language.dat create mode 100644 src/include/catalog/pg_namespace.dat create mode 100644 src/include/catalog/pg_opclass.dat create mode 100644 src/include/catalog/pg_operator.dat create mode 100644 src/include/catalog/pg_opfamily.dat create mode 100644 src/include/catalog/pg_pltemplate.dat create mode 100644 src/include/catalog/pg_proc.dat create mode 100644 src/include/catalog/pg_range.dat create mode 100644 src/include/catalog/pg_tablespace.dat create mode 100644 src/include/catalog/pg_ts_config.dat create mode 100644 src/include/catalog/pg_ts_config_map.dat create mode 100644 src/include/catalog/pg_ts_dict.dat create mode 100644 src/include/catalog/pg_ts_parser.dat create mode 100644 src/include/catalog/pg_ts_template.dat create mode 100644 src/include/catalog/pg_type.dat create mode 100644 src/include/catalog/reformat_dat_file.pl diff --git a/doc/src/sgml/bki.sgml b/doc/src/sgml/bki.sgml index 33378b46eaa..c4ffc61b84b 100644 --- a/doc/src/sgml/bki.sgml +++ b/doc/src/sgml/bki.sgml @@ -1,38 +1,647 @@ - <acronym>BKI</acronym> Backend Interface + System Catalog Declarations and Initial Contents - Backend Interface (BKI) files are scripts in a - special language that is understood by the - PostgreSQL backend when running in the - bootstrap mode. The bootstrap mode allows system catalogs - to be created and filled from scratch, whereas ordinary SQL commands - require the catalogs to exist already. - BKI files can therefore be used to create the - database system in the first place. (And they are probably not - useful for anything else.) + PostgreSQL uses many different system catalogs + to keep track of the existence and properties of database objects, such as + tables and functions. Physically there is no difference between a system + catalog and a plain user table, but the backend C code knows the structure + and properties of each catalog, and can manipulate it directly at a low + level. Thus, for example, it is inadvisable to attempt to alter the + structure of a catalog on-the-fly; that would break assumptions built into + the C code about how rows of the catalog are laid out. But the structure + of the catalogs can change between major versions. - initdb uses a BKI file - to do part of its job when creating a new database cluster. The - input file used by initdb is created as - part of building and installing PostgreSQL - by a program named genbki.pl, which reads some - specially formatted C header files in the src/include/catalog/ - directory of the source tree. The created BKI file - is called postgres.bki and is - normally installed in the - share subdirectory of the installation tree. + The structures of the catalogs are declared in specially formatted C + header files in the src/include/catalog/ directory of + the source tree. In particular, for each catalog there is a header file + named after the catalog (e.g., pg_class.h + for pg_class), which defines the set of columns + the catalog has, as well as some other basic properties such as its OID. + Other critical files defining the catalog structure + include indexing.h, which defines the indexes present + on all the system catalogs, and toasting.h, which + defines TOAST tables for catalogs that need one. - Related information can be found in the documentation for - initdb. + Many of the catalogs have initial data that must be loaded into them + during the bootstrap phase + of initdb, to bring the system up to a point + where it is capable of executing SQL commands. (For + example, pg_class.h must contain an entry for itself, + as well as one for each other system catalog and index.) This + initial data is kept in editable form in data files that are also stored + in the src/include/catalog/ directory. For example, + pg_proc.dat describes all the initial rows that must + be inserted into the pg_proc catalog. + + To create the catalog files and load this initial data into them, a + backend running in bootstrap mode reads a BKI + (Backend Interface) file containing commands and initial data. + The postgres.bki file used in this mode is prepared + from the aforementioned header and data files, while building + a PostgreSQL distribution, by a Perl script + named genbki.pl. + Although it's specific to a particular PostgreSQL + release, postgres.bki is platform-independent and is + installed in the share subdirectory of the + installation tree. + + + + genbki.pl also produces a derived header file for + each catalog, for example pg_class_d.h for + the pg_class catalog. This file contains + automatically-generated macro definitions, and may contain other macros, + enum declarations, and so on that can be useful for client C code that + reads a particular catalog. + + + + Most Postgres developers don't need to be directly concerned with + the BKI file, but almost any nontrivial feature + addition in the backend will require modifying the catalog header files + and/or initial data files. The rest of this chapter gives some + information about that, and for completeness describes + the BKI file format. + + + + System Catalog Declaration Rules + + + The key part of a catalog header file is a C structure definition + describing the layout of each row of the catalog. This begins with + a CATALOG macro, which so far as the C compiler is + concerned is just shorthand for typedef struct + FormData_catalogname. + Each field in the struct gives rise to a catalog column. + Fields can be annotated using the BKI property macros described + in genbki.h, for example to define a default value + for a field or mark it as nullable or not nullable. + The CATALOG line can also be annotated, with some + other BKI property macros described in genbki.h, to + define other properties of the catalog as a whole, such as whether + it has OIDs (by default, it does). + + + + The system catalog cache code (and most catalog-munging code in general) + assumes that the fixed-length portions of all system catalog tuples are + in fact present, because it maps this C struct declaration onto them. + Thus, all variable-length fields and nullable fields must be placed at + the end, and they cannot be accessed as struct fields. + For example, if you tried to + set pg_type.typrelid + to be NULL, it would fail when some piece of code tried to reference + typetup->typrelid (or worse, + typetup->typelem, because that follows + typrelid). This would result in + random errors or even segmentation violations. + + + + As a partial guard against this type of error, variable-length or + nullable fields should not be made directly visible to the C compiler. + This is accomplished by wrapping them in #ifdef + CATALOG_VARLEN ... #endif (where + CATALOG_VARLEN is a symbol that is never defined). + This prevents C code from carelessly trying to access fields that might + not be there or might be at some other offset. + As an independent guard against creating incorrect rows, we + require all columns that should be non-nullable to be marked so + in pg_attribute. The bootstrap code will + automatically mark catalog columns as NOT NULL + if they are fixed-width and are not preceded by any nullable column. + Where this rule is inadequate, you can force correct marking by using + BKI_FORCE_NOT_NULL + and BKI_FORCE_NULL annotations as needed. But note + that NOT NULL constraints are only enforced in the + executor, not against tuples that are generated by random C code, + so care is still needed when manually creating or updating catalog rows. + + + + Frontend code should not include any pg_xxx.h + catalog header file, as these files may contain C code that won't compile + outside the backend. (Typically, that happens because these files also + contain declarations for functions + in src/backend/catalog/ files.) + Instead, frontend code may include the corresponding + generated pg_xxx_d.h header, which will contain + OID #defines and any other data that might be of use + on the client side. If you want macros or other code in a catalog header + to be visible to frontend code, write #ifdef + EXPOSE_TO_CLIENT_CODE ... #endif around that + section to instruct genbki.pl to copy that section + to the pg_xxx_d.h header. + + + + A few of the catalogs are so fundamental that they can't even be created + by the BKI create command that's + used for most catalogs, because that command needs to write information + into these catalogs to describe the new catalog. These are + called bootstrap catalogs, and defining one takes + a lot of extra work: you have to manually prepare appropriate entries for + them in the pre-loaded contents of pg_class + and pg_type, and those entries will need to be + updated for subsequent changes to the catalog's structure. + (Bootstrap catalogs also need pre-loaded entries + in pg_attribute, but + fortunately genbki.pl handles that chore nowadays.) + Avoid making new catalogs be bootstrap catalogs if at all possible. + + + + + System Catalog Initial Data + + + Each catalog that has any manually-created initial data (some do not) + has a corresponding .dat file that contains its + initial data in an editable format. + + + + Data File Format + + + Each .dat file contains Perl data structure literals + that are simply eval'd to produce an in-memory data structure consisting + of an array of hash references, one per catalog row. + A slightly modified excerpt from pg_database.dat + will demonstrate the key features: + + + +[ + +# LC_COLLATE and LC_CTYPE will be replaced at initdb time with user choices +# that might contain non-word characters, so we must double-quote them. + +{ oid => '1', oid_symbol => 'TemplateDbOid', + descr => 'database\'s default template', + datname => 'template1', datdba => 'PGUID', encoding => 'ENCODING', + datcollate => '"LC_COLLATE"', datctype => '"LC_CTYPE"', datistemplate => 't', + datallowconn => 't', datconnlimit => '-1', datlastsysoid => '0', + datfrozenxid => '0', datminmxid => '1', dattablespace => '1663', + datacl => '_null_' }, + +] + + + + Points to note: + + + + + + + The overall file layout is: open square bracket, one or more sets of + curly braces each of which represents a catalog row, close square + bracket. Write a comma after each closing curly brace. + + + + + + Within each catalog row, write comma-separated + key => + value pairs. The + allowed keys are the names of the catalog's + columns, plus the metadata keys oid, + oid_symbol, and descr. + (The use of oid and oid_symbol + is described in + below. descr supplies a description string for + the object, which will be inserted + into pg_description + or pg_shdescription as appropriate.) + While the metadata keys are optional, the catalog's defined columns + must all be provided, except when the catalog's .h + file specifies a default value for the column. + + + + + + All values must be single-quoted. Escape single quotes used within + a value with a backslash. (Backslashes meant as data need not be + doubled, however; this follows Perl's rules for simple quoted + literals.) + + + + + + Null values are represented by _null_. + + + + + + If a value is a macro to be expanded + by initdb, it should also contain double + quotes as shown above, unless we know that no special characters can + appear within the string that will be substituted. + + + + + + Comments are preceded by #, and must be on their + own lines. + + + + + + To aid readability, field values that are OIDs of other catalog + entries can be represented by names rather than numeric OIDs. + This is described in + below. + + + + + + Since hashes are unordered data structures, field order and line + layout aren't semantically significant. However, to maintain a + consistent appearance, we set a few rules that are applied by the + formatting script reformat_dat_file.pl: + + + + + + Within each pair of curly braces, the metadata + fields oid, oid_symbol, + and descr (if present) come first, in that + order, then the catalog's own fields appear in their defined order. + + + + + + Newlines are inserted between fields as needed to limit line length + to 80 characters, if possible. A newline is also inserted between + the metadata fields and the regular fields. + + + + + + If the catalog's .h file specifies a default + value for a column, and a data entry has that same + value, reformat_dat_file.pl will omit it from + the data file. This keeps the data representation compact. + + + + + + reformat_dat_file.pl preserves blank lines + and comment lines as-is. + + + + + + It's recommended to run reformat_dat_file.pl + before submitting catalog data patches. For convenience, you can + simply change to src/include/catalog/ and + run make reformat-dat-files. + + + + + + If you want to add a new method of making the data representation + smaller, you must implement it + in reformat_dat_file.pl and also + teach Catalog::ParseData() how to expand the + data back into the full representation. + + + + + + + + OID Assignment + + + A catalog row appearing in the initial data can be given a + manually-assigned OID by writing an oid + => nnnn metadata field. + Furthermore, if an OID is assigned, a C macro for that OID can be + created by writing an oid_symbol + => name metadata field. + + + + Pre-loaded catalog rows must have preassigned OIDs if there are OID + references to them in other pre-loaded rows. A preassigned OID is + also needed if the row's OID must be referenced from C code. + If neither case applies, the oid metadata field can + be omitted, in which case the bootstrap code assigns an OID + automatically, or leaves it zero in a catalog that has no OIDs. + In practice we usually preassign OIDs for all or none of the pre-loaded + rows in a given catalog, even if only some of them are actually + cross-referenced. + + + + Writing the actual numeric value of any OID in C code is considered + very bad form; always use a macro, instead. Direct references + to pg_proc OIDs are common enough that there's + a special mechanism to create the necessary macros automatically; + see src/backend/utils/Gen_fmgrtab.pl. Similarly + — but, for historical reasons, not done the same way — + there's an automatic method for creating macros + for pg_type + OIDs. oid_symbol entries are therefore not + necessary in those two catalogs. Likewise, macros for + the pg_class OIDs of system catalogs and + indexes are set up automatically. For all other system catalogs, you + have to manually specify any macros you need + via oid_symbol entries. + + + + To find an available OID for a new pre-loaded row, run the + script src/include/catalog/unused_oids. + It prints inclusive ranges of unused OIDs (e.g., the output + line 45-900 means OIDs 45 through 900 have not been + allocated yet). Currently, OIDs 1-9999 are reserved for manual + assignment; the unused_oids script simply looks + through the catalog headers and .dat files + to see which ones do not appear. You can also use + the duplicate_oids script to check for mistakes. + (That script is run automatically at compile time, and will stop the + build if a duplicate is found.) + + + + The OID counter starts at 10000 at the beginning of a bootstrap run. + If a catalog row is in a table that requires OIDs, but no OID was + preassigned by an oid field, then it will + receive an OID of 10000 or above. + + + + + OID Reference Lookup + + + Cross-references from one initial catalog row to another can be written + by just writing the preassigned OID of the referenced row. But + that's error-prone and hard to understand, so for frequently-referenced + catalogs, genbki.pl provides mechanisms to write + symbolic references instead. Currently this is possible for references + to access methods, functions, operators, opclasses, opfamilies, and + types. The rules are as follows: + + + + + + + Use of symbolic references is enabled in a particular catalog column + by attaching BKI_LOOKUP(lookuprule) + to the column's definition, where lookuprule + is pg_am, pg_proc, + pg_operator, + pg_opclass, + pg_opfamily, + or pg_type. + BKI_LOOKUP can be attached to columns of + type Oid, regproc, oidvector, + or Oid[]; in the latter two cases it implies performing a + lookup on each element of the array. + + + + + + In such a column, all entries must use the symbolic format except + when writing 0 for InvalidOid. (If the column is + declared regproc, you can optionally + write - instead of 0.) + genbki.pl will warn about unrecognized names. + + + + + + Access methods are just represented by their names, as are types. + Type names must match the referenced pg_type + entry's typname; you do not get to use any + aliases such as integer + for int4. + + + + + + A function can be represented by + its proname, if that is unique among + the pg_proc.dat entries (this works like regproc + input). Otherwise, write it + as proname(argtypename,argtypename,...), + like regprocedure. The argument type names must be spelled exactly as + they are in the pg_proc.dat entry's + proargtypes field. Do not insert any + spaces. + + + + + + Operators are represented + by oprname(lefttype,righttype), + writing the type names exactly as they appear in + the pg_operator.dat + entry's oprleft + and oprright fields. + (Write 0 for the omitted operand of a unary + operator.) + + + + + + The names of opclasses and opfamilies are only unique within an + access method, so they are represented + by access_method_name/object_name. + + + + + + In none of these cases is there any provision for + schema-qualification; all objects created during bootstrap are + expected to be in the pg_catalog schema. + + + + + + genbki.pl resolves all symbolic references while it + runs, and puts simple numeric OIDs into the emitted BKI file. There is + therefore no need for the bootstrap backend to deal with symbolic + references. + + + + + Recipes for Editing Data Files + + + Here are some suggestions about the easiest ways to perform common tasks + when updating catalog data files. + + + + Add a new column with a default to a catalog: + + Add the column to the header file with + a BKI_DEFAULT(value) + annotation. The data file need only be adjusted by adding the field + in existing rows where a non-default value is needed. + + + + + Add a default value to an existing column that doesn't have + one: + + Add a BKI_DEFAULT annotation to the header file, + then run make reformat-dat-files to remove + now-redundant field entries. + + + + + Remove a column, whether it has a default or not: + + Remove the column from the header, then run make + reformat-dat-files to remove now-useless field entries. + + + + + Change or remove an existing default value: + + You cannot simply change the header file, since that will cause the + current data to be interpreted incorrectly. First run make + expand-dat-files to rewrite the data files with all + default values inserted explicitly, then change or remove + the BKI_DEFAULT annotation, then run make + reformat-dat-files to remove superfluous fields again. + + + + + Ad-hoc bulk editing: + + reformat_dat_file.pl can be adapted to perform + many kinds of bulk changes. Look for its block comments showing where + one-off code can be inserted. In the following example, we are going + to consolidate two boolean fields in pg_proc + into a char field: + + + + + Add the new column, with a default, + to pg_proc.h: + ++ /* see PROKIND_ categories below */ ++ char prokind BKI_DEFAULT(f); + + + + + + + Create a new script based on reformat_dat_file.pl + to insert appropriate values on-the-fly: + +- # At this point we have the full row in memory as a hash +- # and can do any operations we want. As written, it only +- # removes default values, but this script can be adapted to +- # do one-off bulk-editing. ++ # One-off change to migrate to prokind ++ # Default has already been filled in by now, so change to other ++ # values as appropriate ++ if ($values{proisagg} eq 't') ++ { ++ $values{prokind} = 'a'; ++ } ++ elsif ($values{proiswindow} eq 't') ++ { ++ $values{prokind} = 'w'; ++ } + + + + + + + Run the new script: + +$ cd src/include/catalog +$ perl -I ../../backend/catalog rewrite_dat_with_prokind.pl pg_proc.dat + + At this point pg_proc.dat has all three + columns, prokind, + proisagg, + and proiswindow, though they will appear + only in rows where they have non-default values. + + + + + + Remove the old columns from pg_proc.h: + +- /* is it an aggregate? */ +- bool proisagg BKI_DEFAULT(f); +- +- /* is it a window function? */ +- bool proiswindow BKI_DEFAULT(f); + + + + + + + Finally, run make reformat-dat-files to remove + the useless old entries from pg_proc.dat. + + + + + For further examples of scripts used for bulk editing, see + convert_oid2name.pl + and remove_pg_type_oid_symbols.pl attached to this + message: + + + + + + <acronym>BKI</acronym> File Format @@ -76,10 +685,10 @@ rowtype_oid oid (name1 = type1 - FORCE NOT NULL | FORCE NULL , + FORCE NOT NULL | FORCE NULL , name2 = type2 - FORCE NOT NULL | FORCE NULL , + FORCE NOT NULL | FORCE NULL , ...) @@ -106,7 +715,7 @@ tables containing columns of other types, this cannot be done until after pg_type has been created and filled with appropriate entries. (That effectively means that only these - column types can be used in bootstrapped tables, but non-bootstrap + column types can be used in bootstrap catalogs, but non-bootstrap catalogs can contain any built-in type.) @@ -340,7 +949,7 @@ - Example + BKI Example The following sequence of commands will create the diff --git a/doc/src/sgml/libpq.sgml b/doc/src/sgml/libpq.sgml index 8729ccd5c5a..1626999a701 100644 --- a/doc/src/sgml/libpq.sgml +++ b/doc/src/sgml/libpq.sgml @@ -3566,7 +3566,7 @@ Oid PQftype(const PGresult *res, You can query the system table pg_type to obtain the names and properties of the various data types. The OIDs of the built-in data types are defined - in the file src/include/catalog/pg_type.h + in the file src/include/catalog/pg_type_d.h in the source tree. diff --git a/src/Makefile b/src/Makefile index bcdbd9588aa..0e56399cb9a 100644 --- a/src/Makefile +++ b/src/Makefile @@ -41,6 +41,11 @@ endif $(recurse) +# Update the commonly used headers before building the subdirectories; +# otherwise, in a parallel build, several different sub-jobs will try to +# remake them concurrently +$(SUBDIRS:%=all-%-recurse): | submake-generated-headers + install: install-local install-local: installdirs-local diff --git a/src/backend/Makefile b/src/backend/Makefile index 42a0748ade5..82a59eac2d7 100644 --- a/src/backend/Makefile +++ b/src/backend/Makefile @@ -53,7 +53,7 @@ endif ########################################################################## -all: submake-libpgport submake-schemapg postgres $(POSTGRES_IMP) +all: submake-libpgport submake-catalog-headers postgres $(POSTGRES_IMP) ifneq ($(PORTNAME), cygwin) ifneq ($(PORTNAME), win32) @@ -151,19 +151,17 @@ utils/errcodes.h: utils/generate-errcodes.pl utils/errcodes.txt utils/fmgrprotos.h: utils/fmgroids.h touch $@ -utils/fmgroids.h: utils/Gen_fmgrtab.pl catalog/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h +utils/fmgroids.h: utils/Gen_fmgrtab.pl catalog/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.dat $(top_srcdir)/src/include/access/transam.h $(MAKE) -C utils fmgroids.h fmgrprotos.h utils/probes.h: utils/probes.d $(MAKE) -C utils probes.h # run this unconditionally to avoid needing to know its dependencies here: -catalog/schemapg.h: | submake-schemapg +submake-catalog-headers: + $(MAKE) -C catalog distprep generated-header-symlinks -submake-schemapg: - $(MAKE) -C catalog schemapg.h - -.PHONY: submake-schemapg +.PHONY: submake-catalog-headers # Make symlinks for these headers in the include directory. That way # we can cut down on the -I options. Also, a symlink is automatically @@ -178,18 +176,13 @@ submake-schemapg: .PHONY: generated-headers -generated-headers: $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/catalog/schemapg.h $(top_builddir)/src/include/storage/lwlocknames.h $(top_builddir)/src/include/utils/errcodes.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/fmgrprotos.h $(top_builddir)/src/include/utils/probes.h +generated-headers: $(top_builddir)/src/include/parser/gram.h $(top_builddir)/src/include/storage/lwlocknames.h $(top_builddir)/src/include/utils/errcodes.h $(top_builddir)/src/include/utils/fmgroids.h $(top_builddir)/src/include/utils/fmgrprotos.h $(top_builddir)/src/include/utils/probes.h submake-catalog-headers $(top_builddir)/src/include/parser/gram.h: parser/gram.h prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \ cd '$(dir $@)' && rm -f $(notdir $@) && \ $(LN_S) "$$prereqdir/$(notdir $<)" . -$(top_builddir)/src/include/catalog/schemapg.h: catalog/schemapg.h - prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \ - cd '$(dir $@)' && rm -f $(notdir $@) && \ - $(LN_S) "$$prereqdir/$(notdir $<)" . - $(top_builddir)/src/include/storage/lwlocknames.h: storage/lmgr/lwlocknames.h prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \ cd '$(dir $@)' && rm -f $(notdir $@) && \ @@ -225,7 +218,7 @@ utils/probes.o: utils/probes.d $(SUBDIROBJS) distprep: $(MAKE) -C parser gram.c gram.h scan.c $(MAKE) -C bootstrap bootparse.c bootscanner.c - $(MAKE) -C catalog schemapg.h postgres.bki postgres.description postgres.shdescription + $(MAKE) -C catalog distprep $(MAKE) -C replication repl_gram.c repl_scanner.c syncrep_gram.c syncrep_scanner.c $(MAKE) -C storage/lmgr lwlocknames.h lwlocknames.c $(MAKE) -C utils fmgrtab.c fmgroids.h fmgrprotos.h errcodes.h @@ -327,13 +320,7 @@ endif ########################################################################## clean: - rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP) \ - $(top_builddir)/src/include/parser/gram.h \ - $(top_builddir)/src/include/catalog/schemapg.h \ - $(top_builddir)/src/include/storage/lwlocknames.h \ - $(top_builddir)/src/include/utils/fmgroids.h \ - $(top_builddir)/src/include/utils/fmgrprotos.h \ - $(top_builddir)/src/include/utils/probes.h + rm -f $(LOCALOBJS) postgres$(X) $(POSTGRES_IMP) ifeq ($(PORTNAME), cygwin) rm -f postgres.dll libpostgres.a endif @@ -345,15 +332,12 @@ distclean: clean rm -f port/tas.s port/dynloader.c port/pg_sema.c port/pg_shmem.c maintainer-clean: distclean + $(MAKE) -C catalog $@ rm -f bootstrap/bootparse.c \ bootstrap/bootscanner.c \ parser/gram.c \ parser/gram.h \ parser/scan.c \ - catalog/schemapg.h \ - catalog/postgres.bki \ - catalog/postgres.description \ - catalog/postgres.shdescription \ replication/repl_gram.c \ replication/repl_scanner.c \ replication/syncrep_gram.c \ diff --git a/src/backend/catalog/.gitignore b/src/backend/catalog/.gitignore index 557af3c0e5e..9abe91d6e64 100644 --- a/src/backend/catalog/.gitignore +++ b/src/backend/catalog/.gitignore @@ -2,3 +2,5 @@ /postgres.description /postgres.shdescription /schemapg.h +/pg_*_d.h +/bki-stamp diff --git a/src/backend/catalog/Catalog.pm b/src/backend/catalog/Catalog.pm index 9ced1547f6b..3b3bb6bc6ca 100644 --- a/src/backend/catalog/Catalog.pm +++ b/src/backend/catalog/Catalog.pm @@ -1,7 +1,7 @@ #---------------------------------------------------------------------- # # Catalog.pm -# Perl module that extracts info from catalog headers into Perl +# Perl module that extracts info from catalog files into Perl # data structures # # Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -16,12 +16,11 @@ package Catalog; use strict; use warnings; -# Call this function with an array of names of header files to parse. -# Returns a nested data structure describing the data in the headers. -sub Catalogs +# Parses a catalog header file into a data structure describing the schema +# of the catalog. +sub ParseHeader { - my (%catalogs, $catname, $declaring_attributes, $most_recent); - $catalogs{names} = []; + my $input_file = shift; # There are a few types which are given one name in the C source, but a # different name at the SQL level. These are enumerated here. @@ -34,108 +33,68 @@ sub Catalogs 'TransactionId' => 'xid', 'XLogRecPtr' => 'pg_lsn'); - foreach my $input_file (@_) - { my %catalog; + my $declaring_attributes = 0; my $is_varlen = 0; + my $is_client_code = 0; $catalog{columns} = []; - $catalog{data} = []; + $catalog{toasting} = []; + $catalog{indexing} = []; + $catalog{client_code} = []; open(my $ifh, '<', $input_file) || die "$input_file: $!"; - my ($filename) = ($input_file =~ m/(\w+)\.h$/); - my $natts_pat = "Natts_$filename"; - # Scan the input file. while (<$ifh>) { - # Strip C-style comments. - s;/\*(.|\n)*\*/;;g; - if (m;/\*;) - { - - # handle multi-line comments properly. - my $next_line = <$ifh>; - die "$input_file: ends within C-style comment\n" - if !defined $next_line; - $_ .= $next_line; - redo; - } - - # Remember input line number for later. - my $input_line_number = $.; - - # Strip useless whitespace and trailing semicolons. - chomp; - s/^\s+//; - s/;\s*$//; - s/\s+/ /g; - - # Push the data into the appropriate data structure. - if (/$natts_pat\s+(\d+)/) - { - $catalog{natts} = $1; - } - elsif ( - /^DATA\(insert(\s+OID\s+=\s+(\d+))?\s+\(\s*(.*)\s*\)\s*\)$/) - { - check_natts($filename, $catalog{natts}, $3, $input_file, - $input_line_number); - - push @{ $catalog{data} }, { oid => $2, bki_values => $3 }; - } - elsif (/^DESCR\(\"(.*)\"\)$/) + # Set appropriate flag when we're in certain code sections. + if (/^#/) { - $most_recent = $catalog{data}->[-1]; - - # this tests if most recent line is not a DATA() statement - if (ref $most_recent ne 'HASH') - { - die "DESCR() does not apply to any catalog ($input_file)"; - } - if (!defined $most_recent->{oid}) - { - die "DESCR() does not apply to any oid ($input_file)"; - } - elsif ($1 ne '') + $is_varlen = 1 if /^#ifdef\s+CATALOG_VARLEN/; + if (/^#ifdef\s+EXPOSE_TO_CLIENT_CODE/) { - $most_recent->{descr} = $1; + $is_client_code = 1; + next; } + next if !$is_client_code; } - elsif (/^SHDESCR\(\"(.*)\"\)$/) - { - $most_recent = $catalog{data}->[-1]; - # this tests if most recent line is not a DATA() statement - if (ref $most_recent ne 'HASH') - { - die - "SHDESCR() does not apply to any catalog ($input_file)"; - } - if (!defined $most_recent->{oid}) - { - die "SHDESCR() does not apply to any oid ($input_file)"; - } - elsif ($1 ne '') + if (!$is_client_code) + { + # Strip C-style comments. + s;/\*(.|\n)*\*/;;g; + if (m;/\*;) { - $most_recent->{shdescr} = $1; + + # handle multi-line comments properly. + my $next_line = <$ifh>; + die "$input_file: ends within C-style comment\n" + if !defined $next_line; + $_ .= $next_line; + redo; } + + # Strip useless whitespace and trailing semicolons. + chomp; + s/^\s+//; + s/;\s*$//; + s/\s+/ /g; } - elsif (/^DECLARE_TOAST\(\s*(\w+),\s*(\d+),\s*(\d+)\)/) + + # Push the data into the appropriate data structure. + if (/^DECLARE_TOAST\(\s*(\w+),\s*(\d+),\s*(\d+)\)/) { - $catname = 'toasting'; my ($toast_name, $toast_oid, $index_oid) = ($1, $2, $3); - push @{ $catalog{data} }, + push @{ $catalog{toasting} }, "declare toast $toast_oid $index_oid on $toast_name\n"; } elsif (/^DECLARE_(UNIQUE_)?INDEX\(\s*(\w+),\s*(\d+),\s*(.+)\)/) { - $catname = 'indexing'; my ($is_unique, $index_name, $index_oid, $using) = ($1, $2, $3, $4); - push @{ $catalog{data} }, + push @{ $catalog{indexing} }, sprintf( "declare %sindex %s %s %s\n", $is_unique ? 'unique ' : '', @@ -143,37 +102,51 @@ sub Catalogs } elsif (/^BUILD_INDICES/) { - push @{ $catalog{data} }, "build indices\n"; + push @{ $catalog{indexing} }, "build indices\n"; } - elsif (/^CATALOG\(([^,]*),(\d+)\)/) + elsif (/^CATALOG\((\w+),(\d+),(\w+)\)/) { - $catname = $1; + $catalog{catname} = $1; $catalog{relation_oid} = $2; - - # Store pg_* catalog names in the same order we receive them - push @{ $catalogs{names} }, $catname; + $catalog{relation_oid_macro} = $3; $catalog{bootstrap} = /BKI_BOOTSTRAP/ ? ' bootstrap' : ''; $catalog{shared_relation} = /BKI_SHARED_RELATION/ ? ' shared_relation' : ''; $catalog{without_oids} = /BKI_WITHOUT_OIDS/ ? ' without_oids' : ''; - $catalog{rowtype_oid} = - /BKI_ROWTYPE_OID\((\d+)\)/ ? " rowtype_oid $1" : ''; + if (/BKI_ROWTYPE_OID\((\d+),(\w+)\)/) + { + $catalog{rowtype_oid} = $1; + $catalog{rowtype_oid_clause} = " rowtype_oid $1"; + $catalog{rowtype_oid_macro} = $2; + } + else + { + $catalog{rowtype_oid} = ''; + $catalog{rowtype_oid_clause} = ''; + $catalog{rowtype_oid_macro} = ''; + } $catalog{schema_macro} = /BKI_SCHEMA_MACRO/ ? 1 : 0; $declaring_attributes = 1; } - elsif ($declaring_attributes) + elsif ($is_client_code) { - next if (/^{|^$/); - if (/^#/) + if (/^#endif/) { - $is_varlen = 1 if /^#ifdef\s+CATALOG_VARLEN/; - next; + $is_client_code = 0; + } + else + { + push @{ $catalog{client_code} }, $_; } + } + elsif ($declaring_attributes) + { + next if (/^{|^$/); if (/^}/) { - undef $declaring_attributes; + $declaring_attributes = 0; } else { @@ -208,10 +181,17 @@ sub Catalogs { $column{forcenotnull} = 1; } - elsif ($attopt =~ /BKI_DEFAULT\((\S+)\)/) + # We use quotes for values like \0 and \054, to + # make sure all compilers and syntax highlighters + # can recognize them properly. + elsif ($attopt =~ /BKI_DEFAULT\(['"]?([^'"]+)['"]?\)/) { $column{default} = $1; } + elsif ($attopt =~ /BKI_LOOKUP\((\w+)\)/) + { + $column{lookup} = $1; + } else { die @@ -227,41 +207,89 @@ sub Catalogs } } } - $catalogs{$catname} = \%catalog; close $ifh; - } - return \%catalogs; + return \%catalog; } -# Split a DATA line into fields. -# Call this on the bki_values element of a DATA item returned by Catalogs(); -# it returns a list of field values. We don't strip quoting from the fields. -# Note: it should be safe to assign the result to a list of length equal to -# the nominal number of catalog fields, because check_natts already checked -# the number of fields. -sub SplitDataLine +# Parses a file containing Perl data structure literals, returning live data. +# +# The parameter $preserve_formatting needs to be set for callers that want +# to work with non-data lines in the data files, such as comments and blank +# lines. If a caller just wants to consume the data, leave it unset. +sub ParseData { - my $bki_values = shift; - - # This handling of quoted strings might look too simplistic, but it - # matches what bootscanner.l does: that has no provision for quote marks - # inside quoted strings, either. If we don't have a quoted string, just - # snarf everything till next whitespace. That will accept some things - # that bootscanner.l will see as erroneous tokens; but it seems wiser - # to do that and let bootscanner.l complain than to silently drop - # non-whitespace characters. - my @result = $bki_values =~ /"[^"]*"|\S+/g; - - return @result; + my ($input_file, $schema, $preserve_formatting) = @_; + + open(my $ifd, '<', $input_file) || die "$input_file: $!"; + $input_file =~ /(\w+)\.dat$/ + or die "Input file needs to be a .dat file.\n"; + my $catname = $1; + my $data = []; + + # Scan the input file. + while (<$ifd>) + { + my $hash_ref; + + if (/{/) + { + # Capture the hash ref + # NB: Assumes that the next hash ref can't start on the + # same line where the present one ended. + # Not foolproof, but we shouldn't need a full parser, + # since we expect relatively well-behaved input. + + # Quick hack to detect when we have a full hash ref to + # parse. We can't just use a regex because of values in + # pg_aggregate and pg_proc like '{0,0}'. + my $lcnt = tr/{//; + my $rcnt = tr/}//; + + if ($lcnt == $rcnt) + { + eval '$hash_ref = ' . $_; + if (!ref $hash_ref) + { + die "Error parsing $_\n$!"; + } + + # Expand tuples to their full representation. + AddDefaultValues($hash_ref, $schema, $catname); + } + else + { + my $next_line = <$ifd>; + die "$input_file: ends within Perl hash\n" + if !defined $next_line; + $_ .= $next_line; + redo; + } + } + + # If we found a hash reference, keep it + # and annotate the line number. + # Only keep non-data strings if we + # are told to preserve formatting. + if (defined $hash_ref) + { + $hash_ref->{line_number} = $.; + push @$data, $hash_ref; + } + elsif ($preserve_formatting) + { + push @$data, $_; + } + } + close $ifd; + return $data; } -# Fill in default values of a record using the given schema. It's the -# caller's responsibility to specify other values beforehand. +# Fill in default values of a record using the given schema. +# It's the caller's responsibility to specify other values beforehand. sub AddDefaultValues { - my ($row, $schema) = @_; + my ($row, $schema, $catname) = @_; my @missing_fields; - my $msg; foreach my $column (@$schema) { @@ -276,6 +304,13 @@ sub AddDefaultValues { $row->{$attname} = $column->{default}; } + elsif ($catname eq 'pg_proc' && $attname eq 'pronargs' && + defined($row->{proargtypes})) + { + # pg_proc.pronargs can be derived from proargtypes. + my @proargtypes = split /\s+/, $row->{proargtypes}; + $row->{$attname} = scalar(@proargtypes); + } else { # Failed to find a value. @@ -285,14 +320,15 @@ sub AddDefaultValues if (@missing_fields) { - $msg = "Missing values for: " . join(', ', @missing_fields); - $msg .= "\nShowing other values for context:\n"; + my $msg = "Failed to form full tuple for $catname\n"; + $msg .= "Missing values for: " . join(', ', @missing_fields); + $msg .= "\nOther values for row:\n"; while (my($key, $value) = each %$row) { $msg .= "$key => $value, "; } + die $msg; } - return $msg; } # Rename temporary files to final names. @@ -308,7 +344,6 @@ sub RenameTempFile rename($temp_name, $final_name) || die "rename: $temp_name: $!"; } - # Find a symbol defined in a particular header file and extract the value. # # The include path has to be passed as a reference to an array. @@ -340,22 +375,18 @@ sub FindDefinedSymbol die "$catalog_header: not found in any include directory\n"; } - -# verify the number of fields in the passed-in DATA line -sub check_natts +# Similar to FindDefinedSymbol, but looks in the bootstrap metadata. +sub FindDefinedSymbolFromData { - my ($catname, $natts, $bki_val, $file, $line) = @_; - - die -"Could not find definition for Natts_${catname} before start of DATA() in $file\n" - unless defined $natts; - - my $nfields = scalar(SplitDataLine($bki_val)); - - die sprintf -"Wrong number of attributes in DATA() entry at %s:%d (expected %d but got %d)\n", - $file, $line, $natts, $nfields - unless $natts == $nfields; + my ($data, $symbol) = @_; + foreach my $row (@{ $data }) + { + if ($row->{oid_symbol} eq $symbol) + { + return $row->{oid}; + } + } + die "no definition found for $symbol\n"; } 1; diff --git a/src/backend/catalog/Makefile b/src/backend/catalog/Makefile index 30ca5095347..d25d98a40b8 100644 --- a/src/backend/catalog/Makefile +++ b/src/backend/catalog/Makefile @@ -2,6 +2,9 @@ # # Makefile for backend/catalog # +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# # src/backend/catalog/Makefile # #------------------------------------------------------------------------- @@ -22,13 +25,11 @@ BKIFILES = postgres.bki postgres.description postgres.shdescription include $(top_srcdir)/src/backend/common.mk -all: $(BKIFILES) schemapg.h - -# Note: there are some undocumented dependencies on the ordering in which -# the catalog header files are assembled into postgres.bki. In particular, -# indexing.h had better be last, and toasting.h just before it. - -POSTGRES_BKI_SRCS = $(addprefix $(top_srcdir)/src/include/catalog/,\ +# Note: the order of this list determines the order in which the catalog +# header files are assembled into postgres.bki. BKI_BOOTSTRAP catalogs +# must appear first, and there are reputedly other, undocumented ordering +# dependencies. +CATALOG_HEADERS := \ pg_proc.h pg_type.h pg_attribute.h pg_class.h \ pg_attrdef.h pg_constraint.h pg_inherits.h pg_index.h pg_operator.h \ pg_opfamily.h pg_opclass.h pg_am.h pg_amop.h pg_amproc.h \ @@ -45,34 +46,63 @@ POSTGRES_BKI_SRCS = $(addprefix $(top_srcdir)/src/include/catalog/,\ pg_default_acl.h pg_init_privs.h pg_seclabel.h pg_shseclabel.h \ pg_collation.h pg_partitioned_table.h pg_range.h pg_transform.h \ pg_sequence.h pg_publication.h pg_publication_rel.h pg_subscription.h \ - pg_subscription_rel.h \ - toasting.h indexing.h \ - ) + pg_subscription_rel.h + +GENERATED_HEADERS := $(CATALOG_HEADERS:%.h=%_d.h) schemapg.h + +# In the list of headers used to assemble postgres.bki, indexing.h needs +# be last, and toasting.h just before it. This ensures we don't try to +# create indexes or toast tables before their catalogs exist. +POSTGRES_BKI_SRCS := $(addprefix $(top_srcdir)/src/include/catalog/,\ + $(CATALOG_HEADERS) toasting.h indexing.h \ + ) + +# The .dat files we need can just be listed alphabetically. +POSTGRES_BKI_DATA = $(addprefix $(top_srcdir)/src/include/catalog/,\ + pg_aggregate.dat pg_am.dat pg_amop.dat pg_amproc.dat pg_authid.dat \ + pg_cast.dat pg_class.dat pg_collation.dat \ + pg_database.dat pg_language.dat \ + pg_namespace.dat pg_opclass.dat pg_operator.dat pg_opfamily.dat \ + pg_pltemplate.dat pg_proc.dat pg_range.dat pg_tablespace.dat \ + pg_ts_config.dat pg_ts_config_map.dat pg_ts_dict.dat pg_ts_parser.dat \ + pg_ts_template.dat pg_type.dat \ + ) # location of Catalog.pm catalogdir = $(top_srcdir)/src/backend/catalog -# locations of headers that genbki.pl needs to read -pg_includes = -I$(top_srcdir)/src/include/catalog -I$(top_builddir)/src/include/catalog +all: distprep generated-header-symlinks -# see explanation in ../parser/Makefile -postgres.description: postgres.bki ; +distprep: bki-stamp -postgres.shdescription: postgres.bki ; +.PHONY: generated-header-symlinks -schemapg.h: postgres.bki ; +generated-header-symlinks: $(top_builddir)/src/include/catalog/header-stamp -# Technically, this should depend on Makefile.global, but then -# postgres.bki would need to be rebuilt after every configure run, -# even in distribution tarballs. So this is cheating a bit, but it -# will achieve the goal of updating the version number when it -# changes. -postgres.bki: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(top_srcdir)/configure $(top_srcdir)/src/include/catalog/duplicate_oids +# Technically, this should depend on Makefile.global which supplies +# $(MAJORVERSION); but then postgres.bki would need to be rebuilt after every +# configure run, even in distribution tarballs. So depending on configure.in +# instead is cheating a bit, but it will achieve the goal of updating the +# version number when it changes. +bki-stamp: genbki.pl Catalog.pm $(POSTGRES_BKI_SRCS) $(POSTGRES_BKI_DATA) $(top_srcdir)/configure.in $(top_srcdir)/src/include/catalog/duplicate_oids cd $(top_srcdir)/src/include/catalog && $(PERL) ./duplicate_oids - $(PERL) -I $(catalogdir) $< $(pg_includes) --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS) - + $(PERL) -I $(catalogdir) $< --set-version=$(MAJORVERSION) $(POSTGRES_BKI_SRCS) + touch $@ + +# The generated headers must all be symlinked into builddir/src/include/, +# using absolute links for the reasons explained in src/backend/Makefile. +# We use header-stamp to record that we've done this because the symlinks +# themselves may appear older than bki-stamp. +$(top_builddir)/src/include/catalog/header-stamp: bki-stamp + prereqdir=`cd '$(dir $<)' >/dev/null && pwd` && \ + cd '$(dir $@)' && for file in $(GENERATED_HEADERS); do \ + rm -f $$file && $(LN_S) "$$prereqdir/$$file" . ; \ + done + touch $@ + +# Note: installation of generated headers is handled elsewhere .PHONY: install-data -install-data: $(BKIFILES) installdirs +install-data: bki-stamp installdirs $(INSTALL_DATA) $(call vpathsearch,postgres.bki) '$(DESTDIR)$(datadir)/postgres.bki' $(INSTALL_DATA) $(call vpathsearch,postgres.description) '$(DESTDIR)$(datadir)/postgres.description' $(INSTALL_DATA) $(call vpathsearch,postgres.shdescription) '$(DESTDIR)$(datadir)/postgres.shdescription' @@ -87,9 +117,10 @@ installdirs: uninstall-data: rm -f $(addprefix '$(DESTDIR)$(datadir)'/, $(BKIFILES) system_views.sql information_schema.sql sql_features.txt) -# postgres.bki, postgres.description, postgres.shdescription, and schemapg.h -# are in the distribution tarball, so they are not cleaned here. +# postgres.bki, postgres.description, postgres.shdescription, +# and the generated headers are in the distribution tarball, +# so they are not cleaned here. clean: maintainer-clean: clean - rm -f $(BKIFILES) + rm -f bki-stamp $(BKIFILES) $(GENERATED_HEADERS) diff --git a/src/backend/catalog/README b/src/backend/catalog/README deleted file mode 100644 index 7e0ddf312dd..00000000000 --- a/src/backend/catalog/README +++ /dev/null @@ -1,111 +0,0 @@ -src/backend/catalog/README - -System Catalog -============== - -This directory contains .c files that manipulate the system catalogs; -src/include/catalog contains the .h files that define the structure -of the system catalogs. - -When the compile-time scripts (Gen_fmgrtab.pl and genbki.pl) -execute, they grep the DATA statements out of the .h files and munge -these in order to generate the postgres.bki file. The .bki file is then -used as input to initdb (which is just a wrapper around postgres -running single-user in bootstrapping mode) in order to generate the -initial (template) system catalog relation files. - ------------------------------------------------------------------ - -People who are going to hose around with the .h files should be aware -of the following facts: - -- It is very important that the DATA statements be properly formatted -(e.g., no broken lines, proper use of white-space and _null_). The -scripts are line-oriented and break easily. In addition, the only -documentation on the proper format for them is the code in the -bootstrap/ directory. Just be careful when adding new DATA -statements. - -- Some catalogs require that OIDs be preallocated to tuples because -of cross-references from other pre-loaded tuples. For example, pg_type -contains pointers into pg_proc (e.g., pg_type.typinput), and pg_proc -contains back-pointers into pg_type (pg_proc.proargtypes). For such -cases, the OID assigned to a tuple may be explicitly set by use of the -"OID = n" clause of the .bki insert statement. If no such pointers are -required to a given tuple, then the OID = n clause may be omitted -(then the system generates an OID in the usual way, or leaves it 0 in a -catalog that has no OIDs). In practice we usually preassign OIDs -for all or none of the pre-loaded tuples in a given catalog, even if only -some of them are actually cross-referenced. - -- We also sometimes preallocate OIDs for catalog tuples whose OIDs must -be known directly in the C code. In such cases, put a #define in the -catalog's .h file, and use the #define symbol in the C code. Writing -the actual numeric value of any OID in C code is considered very bad form. -Direct references to pg_proc OIDs are common enough that there's a special -mechanism to create the necessary #define's automatically: see -backend/utils/Gen_fmgrtab.pl. We also have standard conventions for setting -up #define's for the pg_class OIDs of system catalogs and indexes. For all -the other system catalogs, you have to manually create any #define's you -need. - -- If you need to find a valid OID for a new predefined tuple, -use the unused_oids script. It generates inclusive ranges of -*unused* OIDs (e.g., the line "45-900" means OIDs 45 through 900 have -not been allocated yet). Currently, OIDs 1-9999 are reserved for manual -assignment; the unused_oids script simply looks through the include/catalog -headers to see which ones do not appear in "OID =" clauses in DATA lines. -(As of Postgres 8.1, it also looks at CATALOG and DECLARE_INDEX lines.) -You can also use the duplicate_oids script to check for mistakes. - -- The OID counter starts at 10000 at bootstrap. If a catalog row is in a -table that requires OIDs, but no OID was preassigned by an "OID =" clause, -then it will receive an OID of 10000 or above. - -- To create a "BOOTSTRAP" table you have to do a lot of extra work: these -tables are not created through a normal CREATE TABLE operation, but spring -into existence when first written to during initdb. Therefore, you must -manually create appropriate entries for them in the pre-loaded contents of -pg_class, pg_attribute, and pg_type. Avoid making new catalogs be bootstrap -catalogs if at all possible; generally, only tables that must be written to -in order to create a table should be bootstrapped. - -- Certain BOOTSTRAP tables must be at the start of the Makefile -POSTGRES_BKI_SRCS variable, as these cannot be created through the standard -heap_create_with_catalog process, because it needs these tables to exist -already. The list of files this currently includes is: - pg_proc.h pg_type.h pg_attribute.h pg_class.h -Within this list, pg_type.h must come before pg_attribute.h. -Also, indexing.h must be last, since the indexes can't be created until all -the tables are in place, and toasting.h should probably be next-to-last -(or at least after all the tables that need toast tables). There are -reputedly some other order dependencies in the .bki list, too. - ------------------------------------------------------------------ - -When munging the .c files, you should be aware of certain conventions: - -- The system catalog cache code (and most catalog-munging code in -general) assumes that the fixed-length portions of all system catalog -tuples are in fact present, because it maps C struct declarations onto -them. Thus, the variable-length fields must all be at the end, and -only the variable-length fields of a catalog tuple are permitted to be -NULL. For example, if you set pg_type.typrelid to be NULL, a -piece of code will likely perform "typetup->typrelid" (or, worse, -"typetup->typelem", which follows typrelid). This will result in -random errors or even segmentation violations. Hence, do NOT insert -catalog tuples that contain NULL attributes except in their -variable-length portions! (The bootstrapping code is fairly good about -marking NOT NULL each of the columns that can legally be referenced via -C struct declarations ... but those markings won't be enforced against -DATA commands, so you must get it right in a DATA line.) - -- Modification of the catalogs must be performed with the proper -updating of catalog indexes! That is, most catalogs have indexes -on them; when you munge them using the executor, the executor will -take care of doing the index updates, but if you make direct access -method calls to insert new or modified tuples into a heap, you must -also make the calls to insert the tuple into ALL of its indexes! If -not, the new tuple will generally be "invisible" to the system because -most of the accesses to the catalogs in question will be through the -associated indexes. diff --git a/src/backend/catalog/genbki.pl b/src/backend/catalog/genbki.pl index b4abbff101f..56312ded8a0 100644 --- a/src/backend/catalog/genbki.pl +++ b/src/backend/catalog/genbki.pl @@ -3,9 +3,9 @@ # # genbki.pl # Perl script that generates postgres.bki, postgres.description, -# postgres.shdescription, and schemapg.h from specially formatted -# header files. The .bki files are used to initialize the postgres -# template database. +# postgres.shdescription, and symbol definition headers from specially +# formatted header files and data files. The BKI files are used to +# initialize the postgres template database. # # Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California @@ -20,7 +20,6 @@ use strict; use warnings; my @input_files; -my @include_path; my $output_path = ''; my $major_version; @@ -36,10 +35,6 @@ while (@ARGV) { $output_path = length($arg) > 2 ? substr($arg, 2) : shift @ARGV; } - elsif ($arg =~ /^-I/) - { - push @include_path, length($arg) > 2 ? substr($arg, 2) : shift @ARGV; - } elsif ($arg =~ /^--set-version=(.*)$/) { $major_version = $1; @@ -53,8 +48,7 @@ while (@ARGV) } # Sanity check arguments. -die "No input files.\n" if !@input_files; -die "No include path; you must specify -I at least once.\n" if !@include_path; +die "No input files.\n" if !@input_files; die "--set-version must be specified.\n" if !defined $major_version; # Make sure output_path ends in a slash. @@ -78,25 +72,151 @@ my $shdescrfile = $output_path . 'postgres.shdescription'; open my $shdescr, '>', $shdescrfile . $tmpext or die "can't open $shdescrfile$tmpext: $!"; +# Read all the files into internal data structures. Not all catalogs +# will have a data file. +my @catnames; +my %catalogs; +my %catalog_data; +my @toast_decls; +my @index_decls; +foreach my $header (@input_files) +{ + $header =~ /(.+)\.h$/ + or die "Input files need to be header files.\n"; + my $datfile = "$1.dat"; + + my $catalog = Catalog::ParseHeader($header); + my $catname = $catalog->{catname}; + my $schema = $catalog->{columns}; + + if (defined $catname) + { + push @catnames, $catname; + $catalogs{$catname} = $catalog; + } + + if (-e $datfile) + { + $catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0); + } + + foreach my $toast_decl (@{ $catalog->{toasting} }) + { + push @toast_decls, $toast_decl; + } + foreach my $index_decl (@{ $catalog->{indexing} }) + { + push @index_decls, $index_decl; + } +} + # Fetch some special data that we will substitute into the output file. # CAUTION: be wary about what symbols you substitute into the .bki file here! # It's okay to substitute things that are expected to be really constant # within a given Postgres release, such as fixed OIDs. Do not substitute # anything that could depend on platform or configuration. (The right place # to handle those sorts of things is in initdb.c's bootstrap_template1().) -# NB: make sure that the files used here are known to be part of the .bki -# file's dependencies by src/backend/catalog/Makefile. -my $BOOTSTRAP_SUPERUSERID = - Catalog::FindDefinedSymbol('pg_authid.h', \@include_path, - 'BOOTSTRAP_SUPERUSERID'); -my $PG_CATALOG_NAMESPACE = - Catalog::FindDefinedSymbol('pg_namespace.h', \@include_path, - 'PG_CATALOG_NAMESPACE'); +my $BOOTSTRAP_SUPERUSERID = Catalog::FindDefinedSymbolFromData( + $catalog_data{pg_authid}, 'BOOTSTRAP_SUPERUSERID'); +my $PG_CATALOG_NAMESPACE = Catalog::FindDefinedSymbolFromData( + $catalog_data{pg_namespace}, 'PG_CATALOG_NAMESPACE'); + + +# Build lookup tables for OID macro substitutions and for pg_attribute +# copies of pg_type values. -# Read all the input header files into internal data structures -my $catalogs = Catalog::Catalogs(@input_files); +# index access method OID lookup +my %amoids; +foreach my $row (@{ $catalog_data{pg_am} }) +{ + $amoids{ $row->{amname} } = $row->{oid}; +} -# Generate postgres.bki, postgres.description, and postgres.shdescription +# opclass OID lookup +my %opcoids; +foreach my $row (@{ $catalog_data{pg_opclass} }) +{ + # There is no unique name, so we need to combine access method + # and opclass name. + my $key = sprintf "%s/%s", + $row->{opcmethod}, $row->{opcname}; + $opcoids{$key} = $row->{oid}; +} + +# operator OID lookup +my %operoids; +foreach my $row (@{ $catalog_data{pg_operator} }) +{ + # There is no unique name, so we need to invent one that contains + # the relevant type names. + my $key = sprintf "%s(%s,%s)", + $row->{oprname}, $row->{oprleft}, $row->{oprright}; + $operoids{$key} = $row->{oid}; +} + +# opfamily OID lookup +my %opfoids; +foreach my $row (@{ $catalog_data{pg_opfamily} }) +{ + # There is no unique name, so we need to combine access method + # and opfamily name. + my $key = sprintf "%s/%s", + $row->{opfmethod}, $row->{opfname}; + $opfoids{$key} = $row->{oid}; +} + +# procedure OID lookup +my %procoids; +foreach my $row (@{ $catalog_data{pg_proc} }) +{ + # Generate an entry under just the proname (corresponds to regproc lookup) + my $prokey = $row->{proname}; + if (defined $procoids{$prokey}) + { + $procoids{$prokey} = 'MULTIPLE'; + } + else + { + $procoids{$prokey} = $row->{oid}; + } + # Also generate an entry using proname(proargtypes). This is not quite + # identical to regprocedure lookup because we don't worry much about + # special SQL names for types etc; we just use the names in the source + # proargtypes field. These *should* be unique, but do a multiplicity + # check anyway. + $prokey .= '(' . join(',', split(/\s+/, $row->{proargtypes})) . ')'; + if (defined $procoids{$prokey}) + { + $procoids{$prokey} = 'MULTIPLE'; + } + else + { + $procoids{$prokey} = $row->{oid}; + } +} + +# type lookups +my %typeoids; +my %types; +foreach my $row (@{ $catalog_data{pg_type} }) +{ + $typeoids{ $row->{typname} } = $row->{oid}; + $types{ $row->{typname} } = $row; +} + +# Map catalog name to OID lookup. +my %lookup_kind = ( + pg_am => \%amoids, + pg_opclass => \%opcoids, + pg_operator => \%operoids, + pg_opfamily => \%opfoids, + pg_proc => \%procoids, + pg_type => \%typeoids +); + + +# Generate postgres.bki, postgres.description, postgres.shdescription, +# and pg_*_d.h headers. # version marker for .bki file print $bki "# PostgreSQL $major_version\n"; @@ -104,32 +224,69 @@ print $bki "# PostgreSQL $major_version\n"; # vars to hold data needed for schemapg.h my %schemapg_entries; my @tables_needing_macros; -my %regprocoids; -my %types; # produce output, one catalog at a time -foreach my $catname (@{ $catalogs->{names} }) +foreach my $catname (@catnames) { + my $catalog = $catalogs{$catname}; + + # Create one definition header with macro definitions for each catalog. + my $def_file = $output_path . $catname . '_d.h'; + open my $def, '>', $def_file . $tmpext + or die "can't open $def_file$tmpext: $!"; + + # Opening boilerplate for pg_*_d.h + printf $def <{relation_oid_macro}, $catalog->{relation_oid} + if $catalog->{relation_oid_macro}; + printf $def "#define %s %s\n", + $catalog->{rowtype_oid_macro}, $catalog->{rowtype_oid} + if $catalog->{rowtype_oid_macro}; + print $def "\n"; # .bki CREATE command for this catalog - my $catalog = $catalogs->{$catname}; print $bki "create $catname $catalog->{relation_oid}" . $catalog->{shared_relation} . $catalog->{bootstrap} . $catalog->{without_oids} - . $catalog->{rowtype_oid} . "\n"; + . $catalog->{rowtype_oid_clause}; - my @attnames; my $first = 1; - print $bki " (\n"; + print $bki "\n (\n"; my $schema = $catalog->{columns}; + my $attnum = 0; foreach my $column (@$schema) { + $attnum++; my $attname = $column->{name}; my $atttype = $column->{type}; - push @attnames, $attname; + # Emit column definitions if (!$first) { print $bki " ,\n"; @@ -146,10 +303,23 @@ foreach my $catname (@{ $catalogs->{names} }) { print $bki " FORCE NULL"; } + + # Emit Anum_* constants + print $def + sprintf("#define Anum_%s_%s %s\n", $catname, $attname, $attnum); } print $bki "\n )\n"; - # Open it, unless bootstrap case (create bootstrap does this + # Emit Natts_* constant + print $def "\n#define Natts_$catname $attnum\n\n"; + + # Emit client code copied from source header + foreach my $line (@{ $catalog->{client_code} }) + { + print $def $line; + } + + # Open it, unless it's a bootstrap catalog (create bootstrap does this # automatically) if (!$catalog->{bootstrap}) { @@ -157,21 +327,15 @@ foreach my $catname (@{ $catalogs->{names} }) } # For pg_attribute.h, we generate data entries ourselves. - # NB: pg_type.h must come before pg_attribute.h in the input list - # of catalog names, since we use info from pg_type.h here. if ($catname eq 'pg_attribute') { - gen_pg_attribute($schema, @attnames); + gen_pg_attribute($schema); } - # Ordinary catalog with DATA line(s) - foreach my $row (@{ $catalog->{data} }) + # Ordinary catalog with a data file + foreach my $row (@{ $catalog_data{$catname} }) { - - # Split line into tokens without interpreting their meaning. - my %bki_values; - @bki_values{@attnames} = - Catalog::SplitDataLine($row->{bki_values}); + my %bki_values = %$row; # Perform required substitutions on fields foreach my $column (@$schema) @@ -184,71 +348,102 @@ foreach my $catname (@{ $catalogs->{names} }) $bki_values{$attname} =~ s/\bPGUID\b/$BOOTSTRAP_SUPERUSERID/g; $bki_values{$attname} =~ s/\bPGNSP\b/$PG_CATALOG_NAMESPACE/g; - # Replace regproc columns' values with OIDs. - # If we don't have a unique value to substitute, - # just do nothing (regprocin will complain). - if ($atttype eq 'regproc') + # Replace OID synonyms with OIDs per the appropriate lookup rule. + # + # If the column type is oidvector or oid[], we have to replace + # each element of the array as per the lookup rule. + if ($column->{lookup}) { - my $procoid = $regprocoids{ $bki_values{$attname} }; - $bki_values{$attname} = $procoid - if defined($procoid) && $procoid ne 'MULTIPLE'; + my $lookup = $lookup_kind{ $column->{lookup} }; + my @lookupnames; + my @lookupoids; + + die "unrecognized BKI_LOOKUP type " . $column->{lookup} + if !defined($lookup); + + if ($atttype eq 'oidvector') + { + @lookupnames = split /\s+/, $bki_values{$attname}; + @lookupoids = lookup_oids($lookup, $catname, + \%bki_values, @lookupnames); + $bki_values{$attname} = join(' ', @lookupoids); + } + elsif ($atttype eq 'oid[]') + { + if ($bki_values{$attname} ne '_null_') + { + $bki_values{$attname} =~ s/[{}]//g; + @lookupnames = split /,/, $bki_values{$attname}; + @lookupoids = lookup_oids($lookup, $catname, + \%bki_values, @lookupnames); + $bki_values{$attname} = + sprintf "{%s}", join(',', @lookupoids); + } + } + else + { + $lookupnames[0] = $bki_values{$attname}; + @lookupoids = lookup_oids($lookup, $catname, + \%bki_values, @lookupnames); + $bki_values{$attname} = $lookupoids[0]; + } } } - # Save pg_proc oids for use in later regproc substitutions. - # This relies on the order we process the files in! - if ($catname eq 'pg_proc') + # Special hack to generate OID symbols for pg_type entries + # that lack one. + if ($catname eq 'pg_type' and !exists $bki_values{oid_symbol}) { - if (defined($regprocoids{ $bki_values{proname} })) - { - $regprocoids{ $bki_values{proname} } = 'MULTIPLE'; - } - else - { - $regprocoids{ $bki_values{proname} } = $row->{oid}; - } - } - - # Save pg_type info for pg_attribute processing below - if ($catname eq 'pg_type') - { - my %type = %bki_values; - $type{oid} = $row->{oid}; - $types{ $type{typname} } = \%type; + my $symbol = form_pg_type_symbol($bki_values{typname}); + $bki_values{oid_symbol} = $symbol + if defined $symbol; } # Write to postgres.bki - my $oid = $row->{oid} ? "OID = $row->{oid} " : ''; - printf $bki "insert %s( %s )\n", $oid, - join(' ', @bki_values{@attnames}); + print_bki_insert(\%bki_values, $schema); # Write comments to postgres.description and # postgres.shdescription - if (defined $row->{descr}) + if (defined $bki_values{descr}) { - printf $descr "%s\t%s\t0\t%s\n", - $row->{oid}, $catname, $row->{descr}; + if ($catalog->{shared_relation}) + { + printf $shdescr "%s\t%s\t%s\n", + $bki_values{oid}, $catname, $bki_values{descr}; + } + else + { + printf $descr "%s\t%s\t0\t%s\n", + $bki_values{oid}, $catname, $bki_values{descr}; + } } - if (defined $row->{shdescr}) + + # Emit OID symbol + if (defined $bki_values{oid_symbol}) { - printf $shdescr "%s\t%s\t%s\n", - $row->{oid}, $catname, $row->{shdescr}; + printf $def "#define %s %s\n", + $bki_values{oid_symbol}, $bki_values{oid}; } } print $bki "close $catname\n"; + print $def sprintf("\n#endif\t\t\t\t\t\t\t/* %s_D_H */\n", uc $catname); + + # Close and rename definition header + close $def; + Catalog::RenameTempFile($def_file, $tmpext); } # Any information needed for the BKI that is not contained in a pg_*.h header # (i.e., not contained in a header with a CATALOG() statement) comes here # Write out declare toast/index statements -foreach my $declaration (@{ $catalogs->{toasting}->{data} }) +foreach my $declaration (@toast_decls) { print $bki $declaration; } -foreach my $declaration (@{ $catalogs->{indexing}->{data} }) +foreach my $declaration (@index_decls) { print $bki $declaration; } @@ -288,7 +483,7 @@ foreach my $table_name (@tables_needing_macros) } # Closing boilerplate for schemapg.h -print $schemapg "\n#endif /* SCHEMAPG_H */\n"; +print $schemapg "\n#endif\t\t\t\t\t\t\t/* SCHEMAPG_H */\n"; # We're done emitting data close $bki; @@ -314,11 +509,16 @@ exit 0; sub gen_pg_attribute { my $schema = shift; - my @attnames = @_; - foreach my $table_name (@{ $catalogs->{names} }) + my @attnames; + foreach my $column (@$schema) + { + push @attnames, $column->{name}; + } + + foreach my $table_name (@catnames) { - my $table = $catalogs->{$table_name}; + my $table = $catalogs{$table_name}; # Currently, all bootstrapped relations also need schemapg.h # entries, so skip if the relation isn't to be in schemapg.h. @@ -341,7 +541,7 @@ sub gen_pg_attribute $priornotnull &= ($row{attnotnull} eq 't'); # If it's bootstrapped, put an entry in postgres.bki. - print_bki_insert(\%row, @attnames) if $table->{bootstrap}; + print_bki_insert(\%row, $schema) if $table->{bootstrap}; # Store schemapg entries for later. morph_row_for_schemapg(\%row, $schema); @@ -377,7 +577,7 @@ sub gen_pg_attribute && $attr->{name} eq 'oid'; morph_row_for_pgattr(\%row, $schema, $attr, 1); - print_bki_insert(\%row, @attnames); + print_bki_insert(\%row, $schema); } } } @@ -441,21 +641,54 @@ sub morph_row_for_pgattr $row->{attnotnull} = 'f'; } - my $error = Catalog::AddDefaultValues($row, $pgattr_schema); - if ($error) - { - die "Failed to form full tuple for pg_attribute: ", $error; - } + Catalog::AddDefaultValues($row, $pgattr_schema, 'pg_attribute'); } -# Write a pg_attribute entry to postgres.bki +# Write an entry to postgres.bki. Adding quotes here allows us to keep +# most double quotes out of the catalog data files for readability. See +# bootscanner.l for what tokens need quoting. sub print_bki_insert { - my $row = shift; - my @attnames = @_; - my $oid = $row->{oid} ? "OID = $row->{oid} " : ''; - my $bki_values = join ' ', @{$row}{@attnames}; - printf $bki "insert %s( %s )\n", $oid, $bki_values; + my $row = shift; + my $schema = shift; + + my @bki_values; + my $oid = $row->{oid} ? "OID = $row->{oid} " : ''; + + foreach my $column (@$schema) + { + my $attname = $column->{name}; + my $atttype = $column->{type}; + my $bki_value = $row->{$attname}; + + # Fold backslash-zero to empty string if it's the entire string, + # since that represents a NUL char in C code. + $bki_value = '' if $bki_value eq '\0'; + + $bki_value = sprintf(qq'"%s"', $bki_value) + if $bki_value ne '_null_' + and $bki_value !~ /^"[^"]+"$/ + and ( length($bki_value) == 0 # Empty string + or $bki_value =~ /\s/ # Contains whitespace + + # To preserve historical formatting, operator names are + # always quoted. Likewise for values of multi-element types, + # even if they only contain a single element. + or $attname eq 'oprname' + or $atttype eq 'oidvector' + or $atttype eq 'int2vector' + or $atttype =~ /\[\]$/ + + # Quote strings that have non-word characters. We make + # exceptions for values that are octals or negative numbers, + # for the same historical reason as above. + or ( $bki_value =~ /\W/ + and $bki_value !~ /^\\\d{3}$/ + and $bki_value !~ /^-\d*$/)); + + push @bki_values, $bki_value; + } + printf $bki "insert %s( %s )\n", $oid, join(' ', @bki_values); } # Given a row reference, modify it so that it becomes a valid entry for @@ -481,8 +714,7 @@ sub morph_row_for_schemapg } elsif ($atttype eq 'char') { - # Replace empty string by zero char constant; add single quotes - $row->{$attname} = '\0' if $row->{$attname} eq q|""|; + # Add single quotes $row->{$attname} = sprintf("'%s'", $row->{$attname}); } @@ -501,18 +733,66 @@ sub morph_row_for_schemapg } } +# Perform OID lookups on an array of OID names. +# If we don't have a unique value to substitute, warn and +# leave the entry unchanged. +sub lookup_oids +{ + my ($lookup, $catname, $bki_values, @lookupnames) = @_; + + my @lookupoids; + foreach my $lookupname (@lookupnames) + { + my $lookupoid = $lookup->{$lookupname}; + if (defined($lookupoid) and $lookupoid ne 'MULTIPLE') + { + push @lookupoids, $lookupoid; + } + else + { + push @lookupoids, $lookupname; + warn sprintf "unresolved OID reference \"%s\" in %s.dat line %s", + $lookupname, $catname, $bki_values->{line_number} + if $lookupname ne '-' and $lookupname ne '0'; + } + } + return @lookupoids; +} + +# Determine canonical pg_type OID #define symbol from the type name. +sub form_pg_type_symbol +{ + my $typename = shift; + + # Skip for rowtypes of bootstrap tables, since they have their + # own naming convention defined elsewhere. + return + if $typename eq 'pg_type' + or $typename eq 'pg_proc' + or $typename eq 'pg_attribute' + or $typename eq 'pg_class'; + + # Transform like so: + # foo_bar -> FOO_BAROID + # _foo_bar -> FOO_BARARRAYOID + $typename =~ /(_)?(.+)/; + my $arraystr = $1 ? 'ARRAY' : ''; + my $name = uc $2; + return $name . $arraystr . 'OID'; +} + sub usage { die <. diff --git a/src/backend/utils/Gen_fmgrtab.pl b/src/backend/utils/Gen_fmgrtab.pl index 4ae86df1f71..3b112c69d8e 100644 --- a/src/backend/utils/Gen_fmgrtab.pl +++ b/src/backend/utils/Gen_fmgrtab.pl @@ -3,7 +3,7 @@ # # Gen_fmgrtab.pl # Perl script that generates fmgroids.h, fmgrprotos.h, and fmgrtab.c -# from pg_proc.h +# from pg_proc.dat # # Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group # Portions Copyright (c) 1994, Regents of the University of California @@ -20,7 +20,7 @@ use strict; use warnings; # Collect arguments -my $infile; # pg_proc.h +my @input_files; my $output_path = ''; my @include_path; @@ -29,7 +29,7 @@ while (@ARGV) my $arg = shift @ARGV; if ($arg !~ /^-/) { - $infile = $arg; + push @input_files, $arg; } elsif ($arg =~ /^-o/) { @@ -52,38 +52,50 @@ if ($output_path ne '' && substr($output_path, -1) ne '/') } # Sanity check arguments. -die "No input files.\n" if !$infile; +die "No input files.\n" if !@input_files; die "No include path; you must specify -I at least once.\n" if !@include_path; -my $FirstBootstrapObjectId = - Catalog::FindDefinedSymbol('access/transam.h', \@include_path, 'FirstBootstrapObjectId'); -my $INTERNALlanguageId = - Catalog::FindDefinedSymbol('catalog/pg_language.h', \@include_path, 'INTERNALlanguageId'); +# Read all the input files into internal data structures. +# Note: We pass data file names as arguments and then look for matching +# headers to parse the schema from. This is backwards from genbki.pl, +# but the Makefile dependencies look more sensible this way. +my %catalogs; +my %catalog_data; +foreach my $datfile (@input_files) +{ + $datfile =~ /(.+)\.dat$/ + or die "Input files need to be data (.dat) files.\n"; -# Read all the data from the include/catalog files. -my $catalogs = Catalog::Catalogs($infile); + my $header = "$1.h"; + die "There in no header file corresponding to $datfile" + if ! -e $header; -# Collect the raw data from pg_proc.h. -my @fmgr = (); -my @attnames; -foreach my $column (@{ $catalogs->{pg_proc}->{columns} }) -{ - push @attnames, $column->{name}; + my $catalog = Catalog::ParseHeader($header); + my $catname = $catalog->{catname}; + my $schema = $catalog->{columns}; + + $catalogs{$catname} = $catalog; + $catalog_data{$catname} = Catalog::ParseData($datfile, $schema, 0); } -my $data = $catalogs->{pg_proc}->{data}; -foreach my $row (@$data) -{ +# Fetch some values for later. +my $FirstBootstrapObjectId = Catalog::FindDefinedSymbol( + 'access/transam.h', \@include_path, 'FirstBootstrapObjectId'); +my $INTERNALlanguageId = Catalog::FindDefinedSymbolFromData( + $catalog_data{pg_language}, 'INTERNALlanguageId'); + +# Collect certain fields from pg_proc.dat. +my @fmgr = (); - # Split line into tokens without interpreting their meaning. - my %bki_values; - @bki_values{@attnames} = Catalog::SplitDataLine($row->{bki_values}); +foreach my $row (@{ $catalog_data{pg_proc} }) +{ + my %bki_values = %$row; # Select out just the rows for internal-language procedures. next if $bki_values{prolang} ne $INTERNALlanguageId; push @fmgr, - { oid => $row->{oid}, + { oid => $bki_values{oid}, strict => $bki_values{proisstrict}, retset => $bki_values{proretset}, nargs => $bki_values{pronargs}, @@ -281,10 +293,10 @@ Catalog::RenameTempFile($tabfile, $tmpext); sub usage { die <. EOM diff --git a/src/backend/utils/Makefile b/src/backend/utils/Makefile index 163c81a1c22..343637af858 100644 --- a/src/backend/utils/Makefile +++ b/src/backend/utils/Makefile @@ -1,8 +1,13 @@ +#------------------------------------------------------------------------- # -# Makefile for utils +# Makefile for backend/utils +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California # # src/backend/utils/Makefile # +#------------------------------------------------------------------------- subdir = src/backend/utils top_builddir = ../../.. @@ -20,6 +25,10 @@ all: errcodes.h fmgroids.h fmgrprotos.h probes.h $(SUBDIRS:%=%-recursive): fmgroids.h fmgrprotos.h +FMGR_DATA := $(addprefix $(top_srcdir)/src/include/catalog/,\ + pg_language.dat pg_proc.dat \ + ) + # see notes in src/backend/parser/Makefile fmgrprotos.h: fmgroids.h touch $@ @@ -27,8 +36,8 @@ fmgrprotos.h: fmgroids.h fmgroids.h: fmgrtab.c touch $@ -fmgrtab.c: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(top_srcdir)/src/include/catalog/pg_proc.h - $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(top_srcdir)/src/include/catalog/pg_proc.h +fmgrtab.c: Gen_fmgrtab.pl $(catalogdir)/Catalog.pm $(FMGR_DATA) $(top_srcdir)/src/include/access/transam.h + $(PERL) -I $(catalogdir) $< -I $(top_srcdir)/src/include/ $(FMGR_DATA) errcodes.h: $(top_srcdir)/src/backend/utils/errcodes.txt generate-errcodes.pl $(PERL) $(srcdir)/generate-errcodes.pl $< > $@ diff --git a/src/include/Makefile b/src/include/Makefile index a689d352b6b..59e18c73d71 100644 --- a/src/include/Makefile +++ b/src/include/Makefile @@ -54,7 +54,7 @@ install: all installdirs chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$dir/*.h || exit; \ done ifeq ($(vpath_build),yes) - for file in dynloader.h catalog/schemapg.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \ + for file in dynloader.h catalog/schemapg.h catalog/pg_*_d.h parser/gram.h storage/lwlocknames.h utils/probes.h; do \ cp $$file '$(DESTDIR)$(includedir_server)'/$$file || exit; \ chmod $(INSTALL_DATA_MODE) '$(DESTDIR)$(includedir_server)'/$$file || exit; \ done @@ -73,7 +73,9 @@ uninstall: clean: - rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h parser/gram.h utils/probes.h catalog/schemapg.h + rm -f utils/fmgroids.h utils/fmgrprotos.h utils/errcodes.h + rm -f parser/gram.h storage/lwlocknames.h utils/probes.h + rm -f catalog/schemapg.h catalog/pg_*_d.h catalog/header-stamp distclean maintainer-clean: clean rm -f pg_config.h pg_config_ext.h pg_config_os.h dynloader.h stamp-h stamp-ext-h diff --git a/src/include/catalog/.gitignore b/src/include/catalog/.gitignore index 650202eb757..6c8da5401dd 100644 --- a/src/include/catalog/.gitignore +++ b/src/include/catalog/.gitignore @@ -1 +1,3 @@ /schemapg.h +/pg_*_d.h +/header-stamp diff --git a/src/include/catalog/Makefile b/src/include/catalog/Makefile new file mode 100644 index 00000000000..1da3ea7f441 --- /dev/null +++ b/src/include/catalog/Makefile @@ -0,0 +1,31 @@ +#------------------------------------------------------------------------- +# +# Makefile for src/include/catalog +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/Makefile +# +#------------------------------------------------------------------------- + +subdir = src/include/catalog +top_builddir = ../../.. +include $(top_builddir)/src/Makefile.global + +# location of Catalog.pm +catalogdir = $(top_srcdir)/src/backend/catalog + +# 'make reformat-dat-files' is a convenience target for rewriting the +# catalog data files in our standard format. This includes collapsing +# out any entries that are redundant with a BKI_DEFAULT annotation. +reformat-dat-files: + $(PERL) -I $(catalogdir) reformat_dat_file.pl pg_*.dat + +# 'make expand-dat-files' is a convenience target for expanding out all +# default values in the catalog data files. This should be run before +# altering or removing any BKI_DEFAULT annotation. +expand-dat-files: + $(PERL) -I $(catalogdir) reformat_dat_file.pl pg_*.dat --full-tuples + +.PHONY: reformat-dat-files expand-dat-files diff --git a/src/include/catalog/duplicate_oids b/src/include/catalog/duplicate_oids index 7342d618edf..8c143cf06f0 100755 --- a/src/include/catalog/duplicate_oids +++ b/src/include/catalog/duplicate_oids @@ -5,7 +5,7 @@ use warnings; BEGIN { - @ARGV = (glob("pg_*.h"), qw(indexing.h toasting.h)); + @ARGV = (glob("pg_*.h"), glob("pg_*.dat"), qw(indexing.h toasting.h)); } my %oidcounts; @@ -14,8 +14,8 @@ while (<>) { next if /^CATALOG\(.*BKI_BOOTSTRAP/; next - unless /^DATA\(insert *OID *= *(\d+)/ - || /^CATALOG\([^,]*, *(\d+).*BKI_ROWTYPE_OID\((\d+)\)/ + unless /\boid *=> *'(\d+)'/ + || /^CATALOG\([^,]*, *(\d+).*BKI_ROWTYPE_OID\((\d+),/ || /^CATALOG\([^,]*, *(\d+)/ || /^DECLARE_INDEX\([^,]*, *(\d+)/ || /^DECLARE_UNIQUE_INDEX\([^,]*, *(\d+)/ diff --git a/src/include/catalog/genbki.h b/src/include/catalog/genbki.h index 96ac4025de2..b1e2cbdb629 100644 --- a/src/include/catalog/genbki.h +++ b/src/include/catalog/genbki.h @@ -3,7 +3,7 @@ * genbki.h * Required include file for all POSTGRES catalog header files * - * genbki.h defines CATALOG(), DATA(), BKI_BOOTSTRAP and related macros + * genbki.h defines CATALOG(), BKI_BOOTSTRAP and related macros * so that the catalog header files can be read by the C compiler. * (These same words are recognized by genbki.pl to build the BKI * bootstrap file from these header files.) @@ -20,23 +20,26 @@ #define GENBKI_H /* Introduces a catalog's structure definition */ -#define CATALOG(name,oid) typedef struct CppConcat(FormData_,name) +#define CATALOG(name,oid,oidmacro) typedef struct CppConcat(FormData_,name) /* Options that may appear after CATALOG (on the same line) */ #define BKI_BOOTSTRAP #define BKI_SHARED_RELATION #define BKI_WITHOUT_OIDS -#define BKI_ROWTYPE_OID(oid) +#define BKI_ROWTYPE_OID(oid,oidmacro) #define BKI_SCHEMA_MACRO + +/* Options that may appear after an attribute (on the same line) */ #define BKI_FORCE_NULL #define BKI_FORCE_NOT_NULL - /* Specifies a default value for a catalog field */ #define BKI_DEFAULT(value) +/* Indicates how to perform name lookups for an OID or OID-array field */ +#define BKI_LOOKUP(catalog) + +/* The following are never defined; they are here only for documentation. */ /* - * This is never defined; it's here only for documentation. - * * Variable-length catalog fields (except possibly the first not nullable one) * should not be visible in C structures, so they are made invisible by #ifdefs * of an undefined symbol. See also MARKNOTNULL in bootstrap.c for how this is @@ -44,10 +47,14 @@ */ #undef CATALOG_VARLEN -/* Declarations that provide the initial content of a catalog */ -/* In C, these need to expand into some harmless, repeatable declaration */ -#define DATA(x) extern int no_such_variable -#define DESCR(x) extern int no_such_variable -#define SHDESCR(x) extern int no_such_variable +/* + * There is code in some catalog headers that needs to be visible to clients, + * but we don't want clients to include the full header because of safety + * issues with other code in the header. To handle that, surround code that + * should be visible to clients with "#ifdef EXPOSE_TO_CLIENT_CODE". That + * instructs genbki.pl to copy the section when generating the corresponding + * "_d" header, which can be included by both client and backend code. + */ +#undef EXPOSE_TO_CLIENT_CODE #endif /* GENBKI_H */ diff --git a/src/include/catalog/indexing.h b/src/include/catalog/indexing.h index 7dd9d108d6c..42499e235f2 100644 --- a/src/include/catalog/indexing.h +++ b/src/include/catalog/indexing.h @@ -43,7 +43,7 @@ extern void CatalogTupleDelete(Relation heapRel, ItemPointer tid); /* * These macros are just to keep the C compiler from spitting up on the - * upcoming commands for genbki.pl. + * upcoming commands for Catalog.pm. */ #define DECLARE_INDEX(name,oid,decl) extern int no_such_variable #define DECLARE_UNIQUE_INDEX(name,oid,decl) extern int no_such_variable diff --git a/src/include/catalog/pg_aggregate.dat b/src/include/catalog/pg_aggregate.dat new file mode 100644 index 00000000000..f8d20410efe --- /dev/null +++ b/src/include/catalog/pg_aggregate.dat @@ -0,0 +1,598 @@ +#---------------------------------------------------------------------- +# +# pg_aggregate.dat +# Initial contents of the pg_aggregate system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_aggregate.dat +# +#---------------------------------------------------------------------- + +[ + +# avg +{ aggfnoid => 'avg(int8)', aggtransfn => 'int8_avg_accum', + aggfinalfn => 'numeric_poly_avg', aggcombinefn => 'int8_avg_combine', + aggserialfn => 'int8_avg_serialize', aggdeserialfn => 'int8_avg_deserialize', + aggmtransfn => 'int8_avg_accum', aggminvtransfn => 'int8_avg_accum_inv', + aggmfinalfn => 'numeric_poly_avg', aggtranstype => 'internal', + aggtransspace => '48', aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'avg(int4)', aggtransfn => 'int4_avg_accum', + aggfinalfn => 'int8_avg', aggcombinefn => 'int4_avg_combine', + aggmtransfn => 'int4_avg_accum', aggminvtransfn => 'int4_avg_accum_inv', + aggmfinalfn => 'int8_avg', aggtranstype => '_int8', aggmtranstype => '_int8', + agginitval => '{0,0}', aggminitval => '{0,0}' }, +{ aggfnoid => 'avg(int2)', aggtransfn => 'int2_avg_accum', + aggfinalfn => 'int8_avg', aggcombinefn => 'int4_avg_combine', + aggmtransfn => 'int2_avg_accum', aggminvtransfn => 'int2_avg_accum_inv', + aggmfinalfn => 'int8_avg', aggtranstype => '_int8', aggmtranstype => '_int8', + agginitval => '{0,0}', aggminitval => '{0,0}' }, +{ aggfnoid => 'avg(numeric)', aggtransfn => 'numeric_avg_accum', + aggfinalfn => 'numeric_avg', aggcombinefn => 'numeric_avg_combine', + aggserialfn => 'numeric_avg_serialize', + aggdeserialfn => 'numeric_avg_deserialize', + aggmtransfn => 'numeric_avg_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_avg', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, +{ aggfnoid => 'avg(float4)', aggtransfn => 'float4_accum', + aggfinalfn => 'float8_avg', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'avg(float8)', aggtransfn => 'float8_accum', + aggfinalfn => 'float8_avg', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'avg(interval)', aggtransfn => 'interval_accum', + aggfinalfn => 'interval_avg', aggcombinefn => 'interval_combine', + aggmtransfn => 'interval_accum', aggminvtransfn => 'interval_accum_inv', + aggmfinalfn => 'interval_avg', aggtranstype => '_interval', + aggmtranstype => '_interval', agginitval => '{0 second,0 second}', + aggminitval => '{0 second,0 second}' }, + +# sum +{ aggfnoid => 'sum(int8)', aggtransfn => 'int8_avg_accum', + aggfinalfn => 'numeric_poly_sum', aggcombinefn => 'int8_avg_combine', + aggserialfn => 'int8_avg_serialize', aggdeserialfn => 'int8_avg_deserialize', + aggmtransfn => 'int8_avg_accum', aggminvtransfn => 'int8_avg_accum_inv', + aggmfinalfn => 'numeric_poly_sum', aggtranstype => 'internal', + aggtransspace => '48', aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'sum(int4)', aggtransfn => 'int4_sum', aggcombinefn => 'int8pl', + aggmtransfn => 'int4_avg_accum', aggminvtransfn => 'int4_avg_accum_inv', + aggmfinalfn => 'int2int4_sum', aggtranstype => 'int8', + aggmtranstype => '_int8', aggminitval => '{0,0}' }, +{ aggfnoid => 'sum(int2)', aggtransfn => 'int2_sum', aggcombinefn => 'int8pl', + aggmtransfn => 'int2_avg_accum', aggminvtransfn => 'int2_avg_accum_inv', + aggmfinalfn => 'int2int4_sum', aggtranstype => 'int8', + aggmtranstype => '_int8', aggminitval => '{0,0}' }, +{ aggfnoid => 'sum(float4)', aggtransfn => 'float4pl', + aggcombinefn => 'float4pl', aggtranstype => 'float4' }, +{ aggfnoid => 'sum(float8)', aggtransfn => 'float8pl', + aggcombinefn => 'float8pl', aggtranstype => 'float8' }, +{ aggfnoid => 'sum(money)', aggtransfn => 'cash_pl', aggcombinefn => 'cash_pl', + aggmtransfn => 'cash_pl', aggminvtransfn => 'cash_mi', + aggtranstype => 'money', aggmtranstype => 'money' }, +{ aggfnoid => 'sum(interval)', aggtransfn => 'interval_pl', + aggcombinefn => 'interval_pl', aggmtransfn => 'interval_pl', + aggminvtransfn => 'interval_mi', aggtranstype => 'interval', + aggmtranstype => 'interval' }, +{ aggfnoid => 'sum(numeric)', aggtransfn => 'numeric_avg_accum', + aggfinalfn => 'numeric_sum', aggcombinefn => 'numeric_avg_combine', + aggserialfn => 'numeric_avg_serialize', + aggdeserialfn => 'numeric_avg_deserialize', + aggmtransfn => 'numeric_avg_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_sum', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, + +# max +{ aggfnoid => 'max(int8)', aggtransfn => 'int8larger', + aggcombinefn => 'int8larger', aggsortop => '>(int8,int8)', + aggtranstype => 'int8' }, +{ aggfnoid => 'max(int4)', aggtransfn => 'int4larger', + aggcombinefn => 'int4larger', aggsortop => '>(int4,int4)', + aggtranstype => 'int4' }, +{ aggfnoid => 'max(int2)', aggtransfn => 'int2larger', + aggcombinefn => 'int2larger', aggsortop => '>(int2,int2)', + aggtranstype => 'int2' }, +{ aggfnoid => 'max(oid)', aggtransfn => 'oidlarger', + aggcombinefn => 'oidlarger', aggsortop => '>(oid,oid)', + aggtranstype => 'oid' }, +{ aggfnoid => 'max(float4)', aggtransfn => 'float4larger', + aggcombinefn => 'float4larger', aggsortop => '>(float4,float4)', + aggtranstype => 'float4' }, +{ aggfnoid => 'max(float8)', aggtransfn => 'float8larger', + aggcombinefn => 'float8larger', aggsortop => '>(float8,float8)', + aggtranstype => 'float8' }, +{ aggfnoid => 'max(abstime)', aggtransfn => 'int4larger', + aggcombinefn => 'int4larger', aggsortop => '>(abstime,abstime)', + aggtranstype => 'abstime' }, +{ aggfnoid => 'max(date)', aggtransfn => 'date_larger', + aggcombinefn => 'date_larger', aggsortop => '>(date,date)', + aggtranstype => 'date' }, +{ aggfnoid => 'max(time)', aggtransfn => 'time_larger', + aggcombinefn => 'time_larger', aggsortop => '>(time,time)', + aggtranstype => 'time' }, +{ aggfnoid => 'max(timetz)', aggtransfn => 'timetz_larger', + aggcombinefn => 'timetz_larger', aggsortop => '>(timetz,timetz)', + aggtranstype => 'timetz' }, +{ aggfnoid => 'max(money)', aggtransfn => 'cashlarger', + aggcombinefn => 'cashlarger', aggsortop => '>(money,money)', + aggtranstype => 'money' }, +{ aggfnoid => 'max(timestamp)', aggtransfn => 'timestamp_larger', + aggcombinefn => 'timestamp_larger', aggsortop => '>(timestamp,timestamp)', + aggtranstype => 'timestamp' }, +{ aggfnoid => 'max(timestamptz)', aggtransfn => 'timestamptz_larger', + aggcombinefn => 'timestamptz_larger', + aggsortop => '>(timestamptz,timestamptz)', aggtranstype => 'timestamptz' }, +{ aggfnoid => 'max(interval)', aggtransfn => 'interval_larger', + aggcombinefn => 'interval_larger', aggsortop => '>(interval,interval)', + aggtranstype => 'interval' }, +{ aggfnoid => 'max(text)', aggtransfn => 'text_larger', + aggcombinefn => 'text_larger', aggsortop => '>(text,text)', + aggtranstype => 'text' }, +{ aggfnoid => 'max(numeric)', aggtransfn => 'numeric_larger', + aggcombinefn => 'numeric_larger', aggsortop => '>(numeric,numeric)', + aggtranstype => 'numeric' }, +{ aggfnoid => 'max(anyarray)', aggtransfn => 'array_larger', + aggcombinefn => 'array_larger', aggsortop => '>(anyarray,anyarray)', + aggtranstype => 'anyarray' }, +{ aggfnoid => 'max(bpchar)', aggtransfn => 'bpchar_larger', + aggcombinefn => 'bpchar_larger', aggsortop => '>(bpchar,bpchar)', + aggtranstype => 'bpchar' }, +{ aggfnoid => 'max(tid)', aggtransfn => 'tidlarger', + aggcombinefn => 'tidlarger', aggsortop => '>(tid,tid)', + aggtranstype => 'tid' }, +{ aggfnoid => 'max(anyenum)', aggtransfn => 'enum_larger', + aggcombinefn => 'enum_larger', aggsortop => '>(anyenum,anyenum)', + aggtranstype => 'anyenum' }, +{ aggfnoid => 'max(inet)', aggtransfn => 'network_larger', + aggcombinefn => 'network_larger', aggsortop => '>(inet,inet)', + aggtranstype => 'inet' }, + +# min +{ aggfnoid => 'min(int8)', aggtransfn => 'int8smaller', + aggcombinefn => 'int8smaller', aggsortop => '<(int8,int8)', + aggtranstype => 'int8' }, +{ aggfnoid => 'min(int4)', aggtransfn => 'int4smaller', + aggcombinefn => 'int4smaller', aggsortop => '<(int4,int4)', + aggtranstype => 'int4' }, +{ aggfnoid => 'min(int2)', aggtransfn => 'int2smaller', + aggcombinefn => 'int2smaller', aggsortop => '<(int2,int2)', + aggtranstype => 'int2' }, +{ aggfnoid => 'min(oid)', aggtransfn => 'oidsmaller', + aggcombinefn => 'oidsmaller', aggsortop => '<(oid,oid)', + aggtranstype => 'oid' }, +{ aggfnoid => 'min(float4)', aggtransfn => 'float4smaller', + aggcombinefn => 'float4smaller', aggsortop => '<(float4,float4)', + aggtranstype => 'float4' }, +{ aggfnoid => 'min(float8)', aggtransfn => 'float8smaller', + aggcombinefn => 'float8smaller', aggsortop => '<(float8,float8)', + aggtranstype => 'float8' }, +{ aggfnoid => 'min(abstime)', aggtransfn => 'int4smaller', + aggcombinefn => 'int4smaller', aggsortop => '<(abstime,abstime)', + aggtranstype => 'abstime' }, +{ aggfnoid => 'min(date)', aggtransfn => 'date_smaller', + aggcombinefn => 'date_smaller', aggsortop => '<(date,date)', + aggtranstype => 'date' }, +{ aggfnoid => 'min(time)', aggtransfn => 'time_smaller', + aggcombinefn => 'time_smaller', aggsortop => '<(time,time)', + aggtranstype => 'time' }, +{ aggfnoid => 'min(timetz)', aggtransfn => 'timetz_smaller', + aggcombinefn => 'timetz_smaller', aggsortop => '<(timetz,timetz)', + aggtranstype => 'timetz' }, +{ aggfnoid => 'min(money)', aggtransfn => 'cashsmaller', + aggcombinefn => 'cashsmaller', aggsortop => '<(money,money)', + aggtranstype => 'money' }, +{ aggfnoid => 'min(timestamp)', aggtransfn => 'timestamp_smaller', + aggcombinefn => 'timestamp_smaller', aggsortop => '<(timestamp,timestamp)', + aggtranstype => 'timestamp' }, +{ aggfnoid => 'min(timestamptz)', aggtransfn => 'timestamptz_smaller', + aggcombinefn => 'timestamptz_smaller', + aggsortop => '<(timestamptz,timestamptz)', aggtranstype => 'timestamptz' }, +{ aggfnoid => 'min(interval)', aggtransfn => 'interval_smaller', + aggcombinefn => 'interval_smaller', aggsortop => '<(interval,interval)', + aggtranstype => 'interval' }, +{ aggfnoid => 'min(text)', aggtransfn => 'text_smaller', + aggcombinefn => 'text_smaller', aggsortop => '<(text,text)', + aggtranstype => 'text' }, +{ aggfnoid => 'min(numeric)', aggtransfn => 'numeric_smaller', + aggcombinefn => 'numeric_smaller', aggsortop => '<(numeric,numeric)', + aggtranstype => 'numeric' }, +{ aggfnoid => 'min(anyarray)', aggtransfn => 'array_smaller', + aggcombinefn => 'array_smaller', aggsortop => '<(anyarray,anyarray)', + aggtranstype => 'anyarray' }, +{ aggfnoid => 'min(bpchar)', aggtransfn => 'bpchar_smaller', + aggcombinefn => 'bpchar_smaller', aggsortop => '<(bpchar,bpchar)', + aggtranstype => 'bpchar' }, +{ aggfnoid => 'min(tid)', aggtransfn => 'tidsmaller', + aggcombinefn => 'tidsmaller', aggsortop => '<(tid,tid)', + aggtranstype => 'tid' }, +{ aggfnoid => 'min(anyenum)', aggtransfn => 'enum_smaller', + aggcombinefn => 'enum_smaller', aggsortop => '<(anyenum,anyenum)', + aggtranstype => 'anyenum' }, +{ aggfnoid => 'min(inet)', aggtransfn => 'network_smaller', + aggcombinefn => 'network_smaller', aggsortop => '<(inet,inet)', + aggtranstype => 'inet' }, + +# count +{ aggfnoid => 'count(any)', aggtransfn => 'int8inc_any', + aggcombinefn => 'int8pl', aggmtransfn => 'int8inc_any', + aggminvtransfn => 'int8dec_any', aggtranstype => 'int8', + aggmtranstype => 'int8', agginitval => '0', aggminitval => '0' }, +{ aggfnoid => 'count()', aggtransfn => 'int8inc', aggcombinefn => 'int8pl', + aggmtransfn => 'int8inc', aggminvtransfn => 'int8dec', aggtranstype => 'int8', + aggmtranstype => 'int8', agginitval => '0', aggminitval => '0' }, + +# var_pop +{ aggfnoid => 'var_pop(int8)', aggtransfn => 'int8_accum', + aggfinalfn => 'numeric_var_pop', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'int8_accum', aggminvtransfn => 'int8_accum_inv', + aggmfinalfn => 'numeric_var_pop', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, +{ aggfnoid => 'var_pop(int4)', aggtransfn => 'int4_accum', + aggfinalfn => 'numeric_poly_var_pop', aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int4_accum', + aggminvtransfn => 'int4_accum_inv', aggmfinalfn => 'numeric_poly_var_pop', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'var_pop(int2)', aggtransfn => 'int2_accum', + aggfinalfn => 'numeric_poly_var_pop', aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int2_accum', + aggminvtransfn => 'int2_accum_inv', aggmfinalfn => 'numeric_poly_var_pop', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'var_pop(float4)', aggtransfn => 'float4_accum', + aggfinalfn => 'float8_var_pop', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'var_pop(float8)', aggtransfn => 'float8_accum', + aggfinalfn => 'float8_var_pop', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'var_pop(numeric)', aggtransfn => 'numeric_accum', + aggfinalfn => 'numeric_var_pop', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'numeric_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_var_pop', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, + +# var_samp +{ aggfnoid => 'var_samp(int8)', aggtransfn => 'int8_accum', + aggfinalfn => 'numeric_var_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'int8_accum', aggminvtransfn => 'int8_accum_inv', + aggmfinalfn => 'numeric_var_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, +{ aggfnoid => 'var_samp(int4)', aggtransfn => 'int4_accum', + aggfinalfn => 'numeric_poly_var_samp', aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int4_accum', + aggminvtransfn => 'int4_accum_inv', aggmfinalfn => 'numeric_poly_var_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'var_samp(int2)', aggtransfn => 'int2_accum', + aggfinalfn => 'numeric_poly_var_samp', aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int2_accum', + aggminvtransfn => 'int2_accum_inv', aggmfinalfn => 'numeric_poly_var_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'var_samp(float4)', aggtransfn => 'float4_accum', + aggfinalfn => 'float8_var_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'var_samp(float8)', aggtransfn => 'float8_accum', + aggfinalfn => 'float8_var_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'var_samp(numeric)', aggtransfn => 'numeric_accum', + aggfinalfn => 'numeric_var_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'numeric_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_var_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, + +# variance: historical Postgres syntax for var_samp +{ aggfnoid => 'variance(int8)', aggtransfn => 'int8_accum', + aggfinalfn => 'numeric_var_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'int8_accum', aggminvtransfn => 'int8_accum_inv', + aggmfinalfn => 'numeric_var_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, +{ aggfnoid => 'variance(int4)', aggtransfn => 'int4_accum', + aggfinalfn => 'numeric_poly_var_samp', aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int4_accum', + aggminvtransfn => 'int4_accum_inv', aggmfinalfn => 'numeric_poly_var_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'variance(int2)', aggtransfn => 'int2_accum', + aggfinalfn => 'numeric_poly_var_samp', aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int2_accum', + aggminvtransfn => 'int2_accum_inv', aggmfinalfn => 'numeric_poly_var_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'variance(float4)', aggtransfn => 'float4_accum', + aggfinalfn => 'float8_var_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'variance(float8)', aggtransfn => 'float8_accum', + aggfinalfn => 'float8_var_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'variance(numeric)', aggtransfn => 'numeric_accum', + aggfinalfn => 'numeric_var_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'numeric_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_var_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, + +# stddev_pop +{ aggfnoid => 'stddev_pop(int8)', aggtransfn => 'int8_accum', + aggfinalfn => 'numeric_stddev_pop', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'int8_accum', aggminvtransfn => 'int8_accum_inv', + aggmfinalfn => 'numeric_stddev_pop', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, +{ aggfnoid => 'stddev_pop(int4)', aggtransfn => 'int4_accum', + aggfinalfn => 'numeric_poly_stddev_pop', + aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int4_accum', + aggminvtransfn => 'int4_accum_inv', aggmfinalfn => 'numeric_poly_stddev_pop', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'stddev_pop(int2)', aggtransfn => 'int2_accum', + aggfinalfn => 'numeric_poly_stddev_pop', + aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int2_accum', + aggminvtransfn => 'int2_accum_inv', aggmfinalfn => 'numeric_poly_stddev_pop', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'stddev_pop(float4)', aggtransfn => 'float4_accum', + aggfinalfn => 'float8_stddev_pop', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'stddev_pop(float8)', aggtransfn => 'float8_accum', + aggfinalfn => 'float8_stddev_pop', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'stddev_pop(numeric)', aggtransfn => 'numeric_accum', + aggfinalfn => 'numeric_stddev_pop', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'numeric_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_stddev_pop', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, + +# stddev_samp +{ aggfnoid => 'stddev_samp(int8)', aggtransfn => 'int8_accum', + aggfinalfn => 'numeric_stddev_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'int8_accum', aggminvtransfn => 'int8_accum_inv', + aggmfinalfn => 'numeric_stddev_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, +{ aggfnoid => 'stddev_samp(int4)', aggtransfn => 'int4_accum', + aggfinalfn => 'numeric_poly_stddev_samp', + aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int4_accum', + aggminvtransfn => 'int4_accum_inv', aggmfinalfn => 'numeric_poly_stddev_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'stddev_samp(int2)', aggtransfn => 'int2_accum', + aggfinalfn => 'numeric_poly_stddev_samp', + aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int2_accum', + aggminvtransfn => 'int2_accum_inv', aggmfinalfn => 'numeric_poly_stddev_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'stddev_samp(float4)', aggtransfn => 'float4_accum', + aggfinalfn => 'float8_stddev_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'stddev_samp(float8)', aggtransfn => 'float8_accum', + aggfinalfn => 'float8_stddev_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'stddev_samp(numeric)', aggtransfn => 'numeric_accum', + aggfinalfn => 'numeric_stddev_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'numeric_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_stddev_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, + +# stddev: historical Postgres syntax for stddev_samp +{ aggfnoid => 'stddev(int8)', aggtransfn => 'int8_accum', + aggfinalfn => 'numeric_stddev_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'int8_accum', aggminvtransfn => 'int8_accum_inv', + aggmfinalfn => 'numeric_stddev_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, +{ aggfnoid => 'stddev(int4)', aggtransfn => 'int4_accum', + aggfinalfn => 'numeric_poly_stddev_samp', + aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int4_accum', + aggminvtransfn => 'int4_accum_inv', aggmfinalfn => 'numeric_poly_stddev_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'stddev(int2)', aggtransfn => 'int2_accum', + aggfinalfn => 'numeric_poly_stddev_samp', + aggcombinefn => 'numeric_poly_combine', + aggserialfn => 'numeric_poly_serialize', + aggdeserialfn => 'numeric_poly_deserialize', aggmtransfn => 'int2_accum', + aggminvtransfn => 'int2_accum_inv', aggmfinalfn => 'numeric_poly_stddev_samp', + aggtranstype => 'internal', aggtransspace => '48', + aggmtranstype => 'internal', aggmtransspace => '48' }, +{ aggfnoid => 'stddev(float4)', aggtransfn => 'float4_accum', + aggfinalfn => 'float8_stddev_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'stddev(float8)', aggtransfn => 'float8_accum', + aggfinalfn => 'float8_stddev_samp', aggcombinefn => 'float8_combine', + aggtranstype => '_float8', agginitval => '{0,0,0}' }, +{ aggfnoid => 'stddev(numeric)', aggtransfn => 'numeric_accum', + aggfinalfn => 'numeric_stddev_samp', aggcombinefn => 'numeric_combine', + aggserialfn => 'numeric_serialize', aggdeserialfn => 'numeric_deserialize', + aggmtransfn => 'numeric_accum', aggminvtransfn => 'numeric_accum_inv', + aggmfinalfn => 'numeric_stddev_samp', aggtranstype => 'internal', + aggtransspace => '128', aggmtranstype => 'internal', + aggmtransspace => '128' }, + +# SQL2003 binary regression aggregates +{ aggfnoid => 'regr_count', aggtransfn => 'int8inc_float8_float8', + aggcombinefn => 'int8pl', aggtranstype => 'int8', agginitval => '0' }, +{ aggfnoid => 'regr_sxx', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_sxx', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'regr_syy', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_syy', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'regr_sxy', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_sxy', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'regr_avgx', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_avgx', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'regr_avgy', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_avgy', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'regr_r2', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_r2', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'regr_slope', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_slope', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'regr_intercept', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_regr_intercept', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'covar_pop', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_covar_pop', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'covar_samp', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_covar_samp', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, +{ aggfnoid => 'corr', aggtransfn => 'float8_regr_accum', + aggfinalfn => 'float8_corr', aggcombinefn => 'float8_regr_combine', + aggtranstype => '_float8', agginitval => '{0,0,0,0,0,0}' }, + +# boolean-and and boolean-or +{ aggfnoid => 'bool_and', aggtransfn => 'booland_statefunc', + aggcombinefn => 'booland_statefunc', aggmtransfn => 'bool_accum', + aggminvtransfn => 'bool_accum_inv', aggmfinalfn => 'bool_alltrue', + aggsortop => '<(bool,bool)', aggtranstype => 'bool', + aggmtranstype => 'internal', aggmtransspace => '16' }, +{ aggfnoid => 'bool_or', aggtransfn => 'boolor_statefunc', + aggcombinefn => 'boolor_statefunc', aggmtransfn => 'bool_accum', + aggminvtransfn => 'bool_accum_inv', aggmfinalfn => 'bool_anytrue', + aggsortop => '>(bool,bool)', aggtranstype => 'bool', + aggmtranstype => 'internal', aggmtransspace => '16' }, +{ aggfnoid => 'every', aggtransfn => 'booland_statefunc', + aggcombinefn => 'booland_statefunc', aggmtransfn => 'bool_accum', + aggminvtransfn => 'bool_accum_inv', aggmfinalfn => 'bool_alltrue', + aggsortop => '<(bool,bool)', aggtranstype => 'bool', + aggmtranstype => 'internal', aggmtransspace => '16' }, + +# bitwise integer +{ aggfnoid => 'bit_and(int2)', aggtransfn => 'int2and', + aggcombinefn => 'int2and', aggtranstype => 'int2' }, +{ aggfnoid => 'bit_or(int2)', aggtransfn => 'int2or', aggcombinefn => 'int2or', + aggtranstype => 'int2' }, +{ aggfnoid => 'bit_and(int4)', aggtransfn => 'int4and', + aggcombinefn => 'int4and', aggtranstype => 'int4' }, +{ aggfnoid => 'bit_or(int4)', aggtransfn => 'int4or', aggcombinefn => 'int4or', + aggtranstype => 'int4' }, +{ aggfnoid => 'bit_and(int8)', aggtransfn => 'int8and', + aggcombinefn => 'int8and', aggtranstype => 'int8' }, +{ aggfnoid => 'bit_or(int8)', aggtransfn => 'int8or', aggcombinefn => 'int8or', + aggtranstype => 'int8' }, +{ aggfnoid => 'bit_and(bit)', aggtransfn => 'bitand', aggcombinefn => 'bitand', + aggtranstype => 'bit' }, +{ aggfnoid => 'bit_or(bit)', aggtransfn => 'bitor', aggcombinefn => 'bitor', + aggtranstype => 'bit' }, + +# xml +{ aggfnoid => 'xmlagg', aggtransfn => 'xmlconcat2', aggtranstype => 'xml' }, + +# array +{ aggfnoid => 'array_agg(anynonarray)', aggtransfn => 'array_agg_transfn', + aggfinalfn => 'array_agg_finalfn', aggfinalextra => 't', + aggtranstype => 'internal' }, +{ aggfnoid => 'array_agg(anyarray)', aggtransfn => 'array_agg_array_transfn', + aggfinalfn => 'array_agg_array_finalfn', aggfinalextra => 't', + aggtranstype => 'internal' }, + +# text +{ aggfnoid => 'string_agg(text,text)', aggtransfn => 'string_agg_transfn', + aggfinalfn => 'string_agg_finalfn', aggtranstype => 'internal' }, + +# bytea +{ aggfnoid => 'string_agg(bytea,bytea)', + aggtransfn => 'bytea_string_agg_transfn', + aggfinalfn => 'bytea_string_agg_finalfn', aggtranstype => 'internal' }, + +# json +{ aggfnoid => 'json_agg', aggtransfn => 'json_agg_transfn', + aggfinalfn => 'json_agg_finalfn', aggtranstype => 'internal' }, +{ aggfnoid => 'json_object_agg', aggtransfn => 'json_object_agg_transfn', + aggfinalfn => 'json_object_agg_finalfn', aggtranstype => 'internal' }, + +# jsonb +{ aggfnoid => 'jsonb_agg', aggtransfn => 'jsonb_agg_transfn', + aggfinalfn => 'jsonb_agg_finalfn', aggtranstype => 'internal' }, +{ aggfnoid => 'jsonb_object_agg', aggtransfn => 'jsonb_object_agg_transfn', + aggfinalfn => 'jsonb_object_agg_finalfn', aggtranstype => 'internal' }, + +# ordered-set and hypothetical-set aggregates +{ aggfnoid => 'percentile_disc(float8,anyelement)', aggkind => 'o', + aggnumdirectargs => '1', aggtransfn => 'ordered_set_transition', + aggfinalfn => 'percentile_disc_final', aggfinalextra => 't', + aggfinalmodify => 's', aggmfinalmodify => 's', aggtranstype => 'internal' }, +{ aggfnoid => 'percentile_cont(float8,float8)', aggkind => 'o', + aggnumdirectargs => '1', aggtransfn => 'ordered_set_transition', + aggfinalfn => 'percentile_cont_float8_final', aggfinalmodify => 's', + aggmfinalmodify => 's', aggtranstype => 'internal' }, +{ aggfnoid => 'percentile_cont(float8,interval)', aggkind => 'o', + aggnumdirectargs => '1', aggtransfn => 'ordered_set_transition', + aggfinalfn => 'percentile_cont_interval_final', aggfinalmodify => 's', + aggmfinalmodify => 's', aggtranstype => 'internal' }, +{ aggfnoid => 'percentile_disc(_float8,anyelement)', aggkind => 'o', + aggnumdirectargs => '1', aggtransfn => 'ordered_set_transition', + aggfinalfn => 'percentile_disc_multi_final', aggfinalextra => 't', + aggfinalmodify => 's', aggmfinalmodify => 's', aggtranstype => 'internal' }, +{ aggfnoid => 'percentile_cont(_float8,float8)', aggkind => 'o', + aggnumdirectargs => '1', aggtransfn => 'ordered_set_transition', + aggfinalfn => 'percentile_cont_float8_multi_final', aggfinalmodify => 's', + aggmfinalmodify => 's', aggtranstype => 'internal' }, +{ aggfnoid => 'percentile_cont(_float8,interval)', aggkind => 'o', + aggnumdirectargs => '1', aggtransfn => 'ordered_set_transition', + aggfinalfn => 'percentile_cont_interval_multi_final', aggfinalmodify => 's', + aggmfinalmodify => 's', aggtranstype => 'internal' }, +{ aggfnoid => 'mode', aggkind => 'o', aggtransfn => 'ordered_set_transition', + aggfinalfn => 'mode_final', aggfinalextra => 't', aggfinalmodify => 's', + aggmfinalmodify => 's', aggtranstype => 'internal' }, +{ aggfnoid => 'rank(any)', aggkind => 'h', aggnumdirectargs => '1', + aggtransfn => 'ordered_set_transition_multi', aggfinalfn => 'rank_final', + aggfinalextra => 't', aggfinalmodify => 'w', aggmfinalmodify => 'w', + aggtranstype => 'internal' }, +{ aggfnoid => 'percent_rank(any)', aggkind => 'h', aggnumdirectargs => '1', + aggtransfn => 'ordered_set_transition_multi', + aggfinalfn => 'percent_rank_final', aggfinalextra => 't', + aggfinalmodify => 'w', aggmfinalmodify => 'w', aggtranstype => 'internal' }, +{ aggfnoid => 'cume_dist(any)', aggkind => 'h', aggnumdirectargs => '1', + aggtransfn => 'ordered_set_transition_multi', aggfinalfn => 'cume_dist_final', + aggfinalextra => 't', aggfinalmodify => 'w', aggmfinalmodify => 'w', + aggtranstype => 'internal' }, +{ aggfnoid => 'dense_rank(any)', aggkind => 'h', aggnumdirectargs => '1', + aggtransfn => 'ordered_set_transition_multi', + aggfinalfn => 'dense_rank_final', aggfinalextra => 't', aggfinalmodify => 'w', + aggmfinalmodify => 'w', aggtranstype => 'internal' }, + +] diff --git a/src/include/catalog/pg_aggregate.h b/src/include/catalog/pg_aggregate.h index 67a0850c181..79f9ce0c146 100644 --- a/src/include/catalog/pg_aggregate.h +++ b/src/include/catalog/pg_aggregate.h @@ -2,7 +2,6 @@ * * pg_aggregate.h * definition of the system "aggregate" relation (pg_aggregate) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_aggregate.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,64 +19,82 @@ #define PG_AGGREGATE_H #include "catalog/genbki.h" +#include "catalog/pg_aggregate_d.h" /* ---------------------------------------------------------------- * pg_aggregate definition. - * * cpp turns this into typedef struct FormData_pg_aggregate - * - * aggfnoid pg_proc OID of the aggregate itself - * aggkind aggregate kind, see AGGKIND_ categories below - * aggnumdirectargs number of arguments that are "direct" arguments - * aggtransfn transition function - * aggfinalfn final function (0 if none) - * aggcombinefn combine function (0 if none) - * aggserialfn function to convert transtype to bytea (0 if none) - * aggdeserialfn function to convert bytea to transtype (0 if none) - * aggmtransfn forward function for moving-aggregate mode (0 if none) - * aggminvtransfn inverse function for moving-aggregate mode (0 if none) - * aggmfinalfn final function for moving-aggregate mode (0 if none) - * aggfinalextra true to pass extra dummy arguments to aggfinalfn - * aggmfinalextra true to pass extra dummy arguments to aggmfinalfn - * aggfinalmodify tells whether aggfinalfn modifies transition state - * aggmfinalmodify tells whether aggmfinalfn modifies transition state - * aggsortop associated sort operator (0 if none) - * aggtranstype type of aggregate's transition (state) data - * aggtransspace estimated size of state data (0 for default estimate) - * aggmtranstype type of moving-aggregate state data (0 if none) - * aggmtransspace estimated size of moving-agg state (0 for default est) - * agginitval initial value for transition state (can be NULL) - * aggminitval initial value for moving-agg state (can be NULL) * ---------------------------------------------------------------- */ -#define AggregateRelationId 2600 - -CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS +CATALOG(pg_aggregate,2600,AggregateRelationId) BKI_WITHOUT_OIDS { - regproc aggfnoid; - char aggkind; - int16 aggnumdirectargs; - regproc aggtransfn; - regproc aggfinalfn; - regproc aggcombinefn; - regproc aggserialfn; - regproc aggdeserialfn; - regproc aggmtransfn; - regproc aggminvtransfn; - regproc aggmfinalfn; - bool aggfinalextra; - bool aggmfinalextra; - char aggfinalmodify; - char aggmfinalmodify; - Oid aggsortop; - Oid aggtranstype; - int32 aggtransspace; - Oid aggmtranstype; - int32 aggmtransspace; + /* pg_proc OID of the aggregate itself */ + regproc aggfnoid BKI_LOOKUP(pg_proc); + + /* aggregate kind, see AGGKIND_ categories below */ + char aggkind BKI_DEFAULT(n); + + /* number of arguments that are "direct" arguments */ + int16 aggnumdirectargs BKI_DEFAULT(0); + + /* transition function */ + regproc aggtransfn BKI_LOOKUP(pg_proc); + + /* final function (0 if none) */ + regproc aggfinalfn BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); + + /* combine function (0 if none) */ + regproc aggcombinefn BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); + + /* function to convert transtype to bytea (0 if none) */ + regproc aggserialfn BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); + + /* function to convert bytea to transtype (0 if none) */ + regproc aggdeserialfn BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); + + /* forward function for moving-aggregate mode (0 if none) */ + regproc aggmtransfn BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); + + /* inverse function for moving-aggregate mode (0 if none) */ + regproc aggminvtransfn BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); + + /* final function for moving-aggregate mode (0 if none) */ + regproc aggmfinalfn BKI_DEFAULT(-) BKI_LOOKUP(pg_proc); + + /* true to pass extra dummy arguments to aggfinalfn */ + bool aggfinalextra BKI_DEFAULT(f); + + /* true to pass extra dummy arguments to aggmfinalfn */ + bool aggmfinalextra BKI_DEFAULT(f); + + /* tells whether aggfinalfn modifies transition state */ + char aggfinalmodify BKI_DEFAULT(r); + + /* tells whether aggmfinalfn modifies transition state */ + char aggmfinalmodify BKI_DEFAULT(r); + + /* associated sort operator (0 if none) */ + Oid aggsortop BKI_DEFAULT(0) BKI_LOOKUP(pg_operator); + + /* type of aggregate's transition (state) data */ + Oid aggtranstype BKI_LOOKUP(pg_type); + + /* estimated size of state data (0 for default estimate) */ + int32 aggtransspace BKI_DEFAULT(0); + + /* type of moving-aggregate state data (0 if none) */ + Oid aggmtranstype BKI_DEFAULT(0) BKI_LOOKUP(pg_type); + + /* estimated size of moving-agg state (0 for default est) */ + int32 aggmtransspace BKI_DEFAULT(0); #ifdef CATALOG_VARLEN /* variable-length fields start here */ - text agginitval; - text aggminitval; + + /* initial value for transition state (can be NULL) */ + text agginitval BKI_DEFAULT(_null_); + + /* initial value for moving-agg state (can be NULL) */ + text aggminitval BKI_DEFAULT(_null_); #endif } FormData_pg_aggregate; @@ -88,34 +105,7 @@ CATALOG(pg_aggregate,2600) BKI_WITHOUT_OIDS */ typedef FormData_pg_aggregate *Form_pg_aggregate; -/* ---------------- - * compiler constants for pg_aggregate - * ---------------- - */ - -#define Natts_pg_aggregate 22 -#define Anum_pg_aggregate_aggfnoid 1 -#define Anum_pg_aggregate_aggkind 2 -#define Anum_pg_aggregate_aggnumdirectargs 3 -#define Anum_pg_aggregate_aggtransfn 4 -#define Anum_pg_aggregate_aggfinalfn 5 -#define Anum_pg_aggregate_aggcombinefn 6 -#define Anum_pg_aggregate_aggserialfn 7 -#define Anum_pg_aggregate_aggdeserialfn 8 -#define Anum_pg_aggregate_aggmtransfn 9 -#define Anum_pg_aggregate_aggminvtransfn 10 -#define Anum_pg_aggregate_aggmfinalfn 11 -#define Anum_pg_aggregate_aggfinalextra 12 -#define Anum_pg_aggregate_aggmfinalextra 13 -#define Anum_pg_aggregate_aggfinalmodify 14 -#define Anum_pg_aggregate_aggmfinalmodify 15 -#define Anum_pg_aggregate_aggsortop 16 -#define Anum_pg_aggregate_aggtranstype 17 -#define Anum_pg_aggregate_aggtransspace 18 -#define Anum_pg_aggregate_aggmtranstype 19 -#define Anum_pg_aggregate_aggmtransspace 20 -#define Anum_pg_aggregate_agginitval 21 -#define Anum_pg_aggregate_aggminitval 22 +#ifdef EXPOSE_TO_CLIENT_CODE /* * Symbolic values for aggkind column. We distinguish normal aggregates @@ -144,190 +134,6 @@ typedef FormData_pg_aggregate *Form_pg_aggregate; #define AGGMODIFY_SHARABLE 's' #define AGGMODIFY_READ_WRITE 'w' - -/* ---------------- - * initial contents of pg_aggregate - * --------------- - */ - -/* avg */ -DATA(insert ( 2100 n 0 int8_avg_accum numeric_poly_avg int8_avg_combine int8_avg_serialize int8_avg_deserialize int8_avg_accum int8_avg_accum_inv numeric_poly_avg f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2101 n 0 int4_avg_accum int8_avg int4_avg_combine - - int4_avg_accum int4_avg_accum_inv int8_avg f f r r 0 1016 0 1016 0 "{0,0}" "{0,0}" )); -DATA(insert ( 2102 n 0 int2_avg_accum int8_avg int4_avg_combine - - int2_avg_accum int2_avg_accum_inv int8_avg f f r r 0 1016 0 1016 0 "{0,0}" "{0,0}" )); -DATA(insert ( 2103 n 0 numeric_avg_accum numeric_avg numeric_avg_combine numeric_avg_serialize numeric_avg_deserialize numeric_avg_accum numeric_accum_inv numeric_avg f f r r 0 2281 128 2281 128 _null_ _null_ )); -DATA(insert ( 2104 n 0 float4_accum float8_avg float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2105 n 0 float8_accum float8_avg float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2106 n 0 interval_accum interval_avg interval_combine - - interval_accum interval_accum_inv interval_avg f f r r 0 1187 0 1187 0 "{0 second,0 second}" "{0 second,0 second}" )); - -/* sum */ -DATA(insert ( 2107 n 0 int8_avg_accum numeric_poly_sum int8_avg_combine int8_avg_serialize int8_avg_deserialize int8_avg_accum int8_avg_accum_inv numeric_poly_sum f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2108 n 0 int4_sum - int8pl - - int4_avg_accum int4_avg_accum_inv int2int4_sum f f r r 0 20 0 1016 0 _null_ "{0,0}" )); -DATA(insert ( 2109 n 0 int2_sum - int8pl - - int2_avg_accum int2_avg_accum_inv int2int4_sum f f r r 0 20 0 1016 0 _null_ "{0,0}" )); -DATA(insert ( 2110 n 0 float4pl - float4pl - - - - - f f r r 0 700 0 0 0 _null_ _null_ )); -DATA(insert ( 2111 n 0 float8pl - float8pl - - - - - f f r r 0 701 0 0 0 _null_ _null_ )); -DATA(insert ( 2112 n 0 cash_pl - cash_pl - - cash_pl cash_mi - f f r r 0 790 0 790 0 _null_ _null_ )); -DATA(insert ( 2113 n 0 interval_pl - interval_pl - - interval_pl interval_mi - f f r r 0 1186 0 1186 0 _null_ _null_ )); -DATA(insert ( 2114 n 0 numeric_avg_accum numeric_sum numeric_avg_combine numeric_avg_serialize numeric_avg_deserialize numeric_avg_accum numeric_accum_inv numeric_sum f f r r 0 2281 128 2281 128 _null_ _null_ )); - -/* max */ -DATA(insert ( 2115 n 0 int8larger - int8larger - - - - - f f r r 413 20 0 0 0 _null_ _null_ )); -DATA(insert ( 2116 n 0 int4larger - int4larger - - - - - f f r r 521 23 0 0 0 _null_ _null_ )); -DATA(insert ( 2117 n 0 int2larger - int2larger - - - - - f f r r 520 21 0 0 0 _null_ _null_ )); -DATA(insert ( 2118 n 0 oidlarger - oidlarger - - - - - f f r r 610 26 0 0 0 _null_ _null_ )); -DATA(insert ( 2119 n 0 float4larger - float4larger - - - - - f f r r 623 700 0 0 0 _null_ _null_ )); -DATA(insert ( 2120 n 0 float8larger - float8larger - - - - - f f r r 674 701 0 0 0 _null_ _null_ )); -DATA(insert ( 2121 n 0 int4larger - int4larger - - - - - f f r r 563 702 0 0 0 _null_ _null_ )); -DATA(insert ( 2122 n 0 date_larger - date_larger - - - - - f f r r 1097 1082 0 0 0 _null_ _null_ )); -DATA(insert ( 2123 n 0 time_larger - time_larger - - - - - f f r r 1112 1083 0 0 0 _null_ _null_ )); -DATA(insert ( 2124 n 0 timetz_larger - timetz_larger - - - - - f f r r 1554 1266 0 0 0 _null_ _null_ )); -DATA(insert ( 2125 n 0 cashlarger - cashlarger - - - - - f f r r 903 790 0 0 0 _null_ _null_ )); -DATA(insert ( 2126 n 0 timestamp_larger - timestamp_larger - - - - - f f r r 2064 1114 0 0 0 _null_ _null_ )); -DATA(insert ( 2127 n 0 timestamptz_larger - timestamptz_larger - - - - - f f r r 1324 1184 0 0 0 _null_ _null_ )); -DATA(insert ( 2128 n 0 interval_larger - interval_larger - - - - - f f r r 1334 1186 0 0 0 _null_ _null_ )); -DATA(insert ( 2129 n 0 text_larger - text_larger - - - - - f f r r 666 25 0 0 0 _null_ _null_ )); -DATA(insert ( 2130 n 0 numeric_larger - numeric_larger - - - - - f f r r 1756 1700 0 0 0 _null_ _null_ )); -DATA(insert ( 2050 n 0 array_larger - array_larger - - - - - f f r r 1073 2277 0 0 0 _null_ _null_ )); -DATA(insert ( 2244 n 0 bpchar_larger - bpchar_larger - - - - - f f r r 1060 1042 0 0 0 _null_ _null_ )); -DATA(insert ( 2797 n 0 tidlarger - tidlarger - - - - - f f r r 2800 27 0 0 0 _null_ _null_ )); -DATA(insert ( 3526 n 0 enum_larger - enum_larger - - - - - f f r r 3519 3500 0 0 0 _null_ _null_ )); -DATA(insert ( 3564 n 0 network_larger - network_larger - - - - - f f r r 1205 869 0 0 0 _null_ _null_ )); - -/* min */ -DATA(insert ( 2131 n 0 int8smaller - int8smaller - - - - - f f r r 412 20 0 0 0 _null_ _null_ )); -DATA(insert ( 2132 n 0 int4smaller - int4smaller - - - - - f f r r 97 23 0 0 0 _null_ _null_ )); -DATA(insert ( 2133 n 0 int2smaller - int2smaller - - - - - f f r r 95 21 0 0 0 _null_ _null_ )); -DATA(insert ( 2134 n 0 oidsmaller - oidsmaller - - - - - f f r r 609 26 0 0 0 _null_ _null_ )); -DATA(insert ( 2135 n 0 float4smaller - float4smaller - - - - - f f r r 622 700 0 0 0 _null_ _null_ )); -DATA(insert ( 2136 n 0 float8smaller - float8smaller - - - - - f f r r 672 701 0 0 0 _null_ _null_ )); -DATA(insert ( 2137 n 0 int4smaller - int4smaller - - - - - f f r r 562 702 0 0 0 _null_ _null_ )); -DATA(insert ( 2138 n 0 date_smaller - date_smaller - - - - - f f r r 1095 1082 0 0 0 _null_ _null_ )); -DATA(insert ( 2139 n 0 time_smaller - time_smaller - - - - - f f r r 1110 1083 0 0 0 _null_ _null_ )); -DATA(insert ( 2140 n 0 timetz_smaller - timetz_smaller - - - - - f f r r 1552 1266 0 0 0 _null_ _null_ )); -DATA(insert ( 2141 n 0 cashsmaller - cashsmaller - - - - - f f r r 902 790 0 0 0 _null_ _null_ )); -DATA(insert ( 2142 n 0 timestamp_smaller - timestamp_smaller - - - - - f f r r 2062 1114 0 0 0 _null_ _null_ )); -DATA(insert ( 2143 n 0 timestamptz_smaller - timestamptz_smaller - - - - - f f r r 1322 1184 0 0 0 _null_ _null_ )); -DATA(insert ( 2144 n 0 interval_smaller - interval_smaller - - - - - f f r r 1332 1186 0 0 0 _null_ _null_ )); -DATA(insert ( 2145 n 0 text_smaller - text_smaller - - - - - f f r r 664 25 0 0 0 _null_ _null_ )); -DATA(insert ( 2146 n 0 numeric_smaller - numeric_smaller - - - - - f f r r 1754 1700 0 0 0 _null_ _null_ )); -DATA(insert ( 2051 n 0 array_smaller - array_smaller - - - - - f f r r 1072 2277 0 0 0 _null_ _null_ )); -DATA(insert ( 2245 n 0 bpchar_smaller - bpchar_smaller - - - - - f f r r 1058 1042 0 0 0 _null_ _null_ )); -DATA(insert ( 2798 n 0 tidsmaller - tidsmaller - - - - - f f r r 2799 27 0 0 0 _null_ _null_ )); -DATA(insert ( 3527 n 0 enum_smaller - enum_smaller - - - - - f f r r 3518 3500 0 0 0 _null_ _null_ )); -DATA(insert ( 3565 n 0 network_smaller - network_smaller - - - - - f f r r 1203 869 0 0 0 _null_ _null_ )); - -/* count */ -DATA(insert ( 2147 n 0 int8inc_any - int8pl - - int8inc_any int8dec_any - f f r r 0 20 0 20 0 0 0 )); -DATA(insert ( 2803 n 0 int8inc - int8pl - - int8inc int8dec - f f r r 0 20 0 20 0 0 0 )); - -/* var_pop */ -DATA(insert ( 2718 n 0 int8_accum numeric_var_pop numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_pop f f r r 0 2281 128 2281 128 _null_ _null_ )); -DATA(insert ( 2719 n 0 int4_accum numeric_poly_var_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_pop f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2720 n 0 int2_accum numeric_poly_var_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_pop f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2721 n 0 float4_accum float8_var_pop float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2722 n 0 float8_accum float8_var_pop float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2723 n 0 numeric_accum numeric_var_pop numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_pop f f r r 0 2281 128 2281 128 _null_ _null_ )); - -/* var_samp */ -DATA(insert ( 2641 n 0 int8_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); -DATA(insert ( 2642 n 0 int4_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2643 n 0 int2_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2644 n 0 float4_accum float8_var_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2645 n 0 float8_accum float8_var_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2646 n 0 numeric_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); - -/* variance: historical Postgres syntax for var_samp */ -DATA(insert ( 2148 n 0 int8_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_var_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); -DATA(insert ( 2149 n 0 int4_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_var_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2150 n 0 int2_accum numeric_poly_var_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_var_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2151 n 0 float4_accum float8_var_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2152 n 0 float8_accum float8_var_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2153 n 0 numeric_accum numeric_var_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_var_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); - -/* stddev_pop */ -DATA(insert ( 2724 n 0 int8_accum numeric_stddev_pop numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_pop f f r r 0 2281 128 2281 128 _null_ _null_ )); -DATA(insert ( 2725 n 0 int4_accum numeric_poly_stddev_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_pop f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2726 n 0 int2_accum numeric_poly_stddev_pop numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_pop f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2727 n 0 float4_accum float8_stddev_pop float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2728 n 0 float8_accum float8_stddev_pop float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2729 n 0 numeric_accum numeric_stddev_pop numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_pop f f r r 0 2281 128 2281 128 _null_ _null_ )); - -/* stddev_samp */ -DATA(insert ( 2712 n 0 int8_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); -DATA(insert ( 2713 n 0 int4_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2714 n 0 int2_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2715 n 0 float4_accum float8_stddev_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2716 n 0 float8_accum float8_stddev_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2717 n 0 numeric_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); - -/* stddev: historical Postgres syntax for stddev_samp */ -DATA(insert ( 2154 n 0 int8_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize int8_accum int8_accum_inv numeric_stddev_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); -DATA(insert ( 2155 n 0 int4_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int4_accum int4_accum_inv numeric_poly_stddev_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2156 n 0 int2_accum numeric_poly_stddev_samp numeric_poly_combine numeric_poly_serialize numeric_poly_deserialize int2_accum int2_accum_inv numeric_poly_stddev_samp f f r r 0 2281 48 2281 48 _null_ _null_ )); -DATA(insert ( 2157 n 0 float4_accum float8_stddev_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2158 n 0 float8_accum float8_stddev_samp float8_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0}" _null_ )); -DATA(insert ( 2159 n 0 numeric_accum numeric_stddev_samp numeric_combine numeric_serialize numeric_deserialize numeric_accum numeric_accum_inv numeric_stddev_samp f f r r 0 2281 128 2281 128 _null_ _null_ )); - -/* SQL2003 binary regression aggregates */ -DATA(insert ( 2818 n 0 int8inc_float8_float8 - int8pl - - - - - f f r r 0 20 0 0 0 0 _null_ )); -DATA(insert ( 2819 n 0 float8_regr_accum float8_regr_sxx float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2820 n 0 float8_regr_accum float8_regr_syy float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2821 n 0 float8_regr_accum float8_regr_sxy float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2822 n 0 float8_regr_accum float8_regr_avgx float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2823 n 0 float8_regr_accum float8_regr_avgy float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2824 n 0 float8_regr_accum float8_regr_r2 float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2825 n 0 float8_regr_accum float8_regr_slope float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2826 n 0 float8_regr_accum float8_regr_intercept float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2827 n 0 float8_regr_accum float8_covar_pop float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2828 n 0 float8_regr_accum float8_covar_samp float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); -DATA(insert ( 2829 n 0 float8_regr_accum float8_corr float8_regr_combine - - - - - f f r r 0 1022 0 0 0 "{0,0,0,0,0,0}" _null_ )); - -/* boolean-and and boolean-or */ -DATA(insert ( 2517 n 0 booland_statefunc - booland_statefunc - - bool_accum bool_accum_inv bool_alltrue f f r r 58 16 0 2281 16 _null_ _null_ )); -DATA(insert ( 2518 n 0 boolor_statefunc - boolor_statefunc - - bool_accum bool_accum_inv bool_anytrue f f r r 59 16 0 2281 16 _null_ _null_ )); -DATA(insert ( 2519 n 0 booland_statefunc - booland_statefunc - - bool_accum bool_accum_inv bool_alltrue f f r r 58 16 0 2281 16 _null_ _null_ )); - -/* bitwise integer */ -DATA(insert ( 2236 n 0 int2and - int2and - - - - - f f r r 0 21 0 0 0 _null_ _null_ )); -DATA(insert ( 2237 n 0 int2or - int2or - - - - - f f r r 0 21 0 0 0 _null_ _null_ )); -DATA(insert ( 2238 n 0 int4and - int4and - - - - - f f r r 0 23 0 0 0 _null_ _null_ )); -DATA(insert ( 2239 n 0 int4or - int4or - - - - - f f r r 0 23 0 0 0 _null_ _null_ )); -DATA(insert ( 2240 n 0 int8and - int8and - - - - - f f r r 0 20 0 0 0 _null_ _null_ )); -DATA(insert ( 2241 n 0 int8or - int8or - - - - - f f r r 0 20 0 0 0 _null_ _null_ )); -DATA(insert ( 2242 n 0 bitand - bitand - - - - - f f r r 0 1560 0 0 0 _null_ _null_ )); -DATA(insert ( 2243 n 0 bitor - bitor - - - - - f f r r 0 1560 0 0 0 _null_ _null_ )); - -/* xml */ -DATA(insert ( 2901 n 0 xmlconcat2 - - - - - - - f f r r 0 142 0 0 0 _null_ _null_ )); - -/* array */ -DATA(insert ( 2335 n 0 array_agg_transfn array_agg_finalfn - - - - - - t f r r 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 4053 n 0 array_agg_array_transfn array_agg_array_finalfn - - - - - - t f r r 0 2281 0 0 0 _null_ _null_ )); - -/* text */ -DATA(insert ( 3538 n 0 string_agg_transfn string_agg_finalfn - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); - -/* bytea */ -DATA(insert ( 3545 n 0 bytea_string_agg_transfn bytea_string_agg_finalfn - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); - -/* json */ -DATA(insert ( 3175 n 0 json_agg_transfn json_agg_finalfn - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3197 n 0 json_object_agg_transfn json_object_agg_finalfn - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); - -/* jsonb */ -DATA(insert ( 3267 n 0 jsonb_agg_transfn jsonb_agg_finalfn - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3270 n 0 jsonb_object_agg_transfn jsonb_object_agg_finalfn - - - - - - f f r r 0 2281 0 0 0 _null_ _null_ )); - -/* ordered-set and hypothetical-set aggregates */ -DATA(insert ( 3972 o 1 ordered_set_transition percentile_disc_final - - - - - - t f s s 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3974 o 1 ordered_set_transition percentile_cont_float8_final - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3976 o 1 ordered_set_transition percentile_cont_interval_final - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3978 o 1 ordered_set_transition percentile_disc_multi_final - - - - - - t f s s 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3980 o 1 ordered_set_transition percentile_cont_float8_multi_final - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3982 o 1 ordered_set_transition percentile_cont_interval_multi_final - - - - - - f f s s 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3984 o 0 ordered_set_transition mode_final - - - - - - t f s s 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3986 h 1 ordered_set_transition_multi rank_final - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3988 h 1 ordered_set_transition_multi percent_rank_final - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3990 h 1 ordered_set_transition_multi cume_dist_final - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); -DATA(insert ( 3992 h 1 ordered_set_transition_multi dense_rank_final - - - - - - t f w w 0 2281 0 0 0 _null_ _null_ )); +#endif /* EXPOSE_TO_CLIENT_CODE */ #endif /* PG_AGGREGATE_H */ diff --git a/src/include/catalog/pg_am.dat b/src/include/catalog/pg_am.dat new file mode 100644 index 00000000000..8722cacaaef --- /dev/null +++ b/src/include/catalog/pg_am.dat @@ -0,0 +1,34 @@ +#---------------------------------------------------------------------- +# +# pg_am.dat +# Initial contents of the pg_am system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_am.dat +# +#---------------------------------------------------------------------- + +[ + +{ oid => '403', oid_symbol => 'BTREE_AM_OID', + descr => 'b-tree index access method', + amname => 'btree', amhandler => 'bthandler', amtype => 'i' }, +{ oid => '405', oid_symbol => 'HASH_AM_OID', + descr => 'hash index access method', + amname => 'hash', amhandler => 'hashhandler', amtype => 'i' }, +{ oid => '783', oid_symbol => 'GIST_AM_OID', + descr => 'GiST index access method', + amname => 'gist', amhandler => 'gisthandler', amtype => 'i' }, +{ oid => '2742', oid_symbol => 'GIN_AM_OID', + descr => 'GIN index access method', + amname => 'gin', amhandler => 'ginhandler', amtype => 'i' }, +{ oid => '4000', oid_symbol => 'SPGIST_AM_OID', + descr => 'SP-GiST index access method', + amname => 'spgist', amhandler => 'spghandler', amtype => 'i' }, +{ oid => '3580', oid_symbol => 'BRIN_AM_OID', + descr => 'block range index (BRIN) access method', + amname => 'brin', amhandler => 'brinhandler', amtype => 'i' }, + +] diff --git a/src/include/catalog/pg_am.h b/src/include/catalog/pg_am.h index 2e785c4cec2..f821749af82 100644 --- a/src/include/catalog/pg_am.h +++ b/src/include/catalog/pg_am.h @@ -2,7 +2,6 @@ * * pg_am.h * definition of the system "access method" relation (pg_am) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,11 +10,8 @@ * src/include/catalog/pg_am.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. - * - * XXX do NOT break up DATA() statements into multiple lines! - * the scripts are not as smart as you might think... + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -23,19 +19,23 @@ #define PG_AM_H #include "catalog/genbki.h" +#include "catalog/pg_am_d.h" /* ---------------- * pg_am definition. cpp turns this into * typedef struct FormData_pg_am * ---------------- */ -#define AccessMethodRelationId 2601 - -CATALOG(pg_am,2601) +CATALOG(pg_am,2601,AccessMethodRelationId) { - NameData amname; /* access method name */ - regproc amhandler; /* handler function */ - char amtype; /* see AMTYPE_xxx constants below */ + /* access method name */ + NameData amname; + + /* handler function */ + regproc amhandler BKI_LOOKUP(pg_proc); + + /* see AMTYPE_xxx constants below */ + char amtype; } FormData_pg_am; /* ---------------- @@ -45,43 +45,13 @@ CATALOG(pg_am,2601) */ typedef FormData_pg_am *Form_pg_am; -/* ---------------- - * compiler constants for pg_am - * ---------------- - */ -#define Natts_pg_am 3 -#define Anum_pg_am_amname 1 -#define Anum_pg_am_amhandler 2 -#define Anum_pg_am_amtype 3 +#ifdef EXPOSE_TO_CLIENT_CODE -/* ---------------- - * compiler constant for amtype - * ---------------- +/* + * Allowed values for amtype */ #define AMTYPE_INDEX 'i' /* index access method */ -/* ---------------- - * initial contents of pg_am - * ---------------- - */ - -DATA(insert OID = 403 ( btree bthandler i )); -DESCR("b-tree index access method"); -#define BTREE_AM_OID 403 -DATA(insert OID = 405 ( hash hashhandler i )); -DESCR("hash index access method"); -#define HASH_AM_OID 405 -DATA(insert OID = 783 ( gist gisthandler i )); -DESCR("GiST index access method"); -#define GIST_AM_OID 783 -DATA(insert OID = 2742 ( gin ginhandler i )); -DESCR("GIN index access method"); -#define GIN_AM_OID 2742 -DATA(insert OID = 4000 ( spgist spghandler i )); -DESCR("SP-GiST index access method"); -#define SPGIST_AM_OID 4000 -DATA(insert OID = 3580 ( brin brinhandler i )); -DESCR("block range index (BRIN) access method"); -#define BRIN_AM_OID 3580 +#endif /* EXPOSE_TO_CLIENT_CODE */ #endif /* PG_AM_H */ diff --git a/src/include/catalog/pg_amop.dat b/src/include/catalog/pg_amop.dat new file mode 100644 index 00000000000..b1cf8ec5fca --- /dev/null +++ b/src/include/catalog/pg_amop.dat @@ -0,0 +1,2472 @@ +#---------------------------------------------------------------------- +# +# pg_amop.dat +# Initial contents of the pg_amop system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_amop.dat +# +#---------------------------------------------------------------------- + +[ + +# btree integer_ops + +# default operators int2 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '<(int2,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '2', amopopr => '<=(int2,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '3', amopopr => '=(int2,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '4', amopopr => '>=(int2,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '5', amopopr => '>(int2,int2)', + amopmethod => 'btree' }, + +# crosstype operators int24 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '<(int2,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '2', amopopr => '<=(int2,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '3', amopopr => '=(int2,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '4', amopopr => '>=(int2,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '5', amopopr => '>(int2,int4)', + amopmethod => 'btree' }, + +# crosstype operators int28 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '<(int2,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '2', amopopr => '<=(int2,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '3', amopopr => '=(int2,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '4', amopopr => '>=(int2,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '5', amopopr => '>(int2,int8)', + amopmethod => 'btree' }, + +# default operators int4 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '<(int4,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '2', amopopr => '<=(int4,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '3', amopopr => '=(int4,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '4', amopopr => '>=(int4,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '5', amopopr => '>(int4,int4)', + amopmethod => 'btree' }, + +# crosstype operators int42 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '<(int4,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '2', amopopr => '<=(int4,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '3', amopopr => '=(int4,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '4', amopopr => '>=(int4,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '5', amopopr => '>(int4,int2)', + amopmethod => 'btree' }, + +# crosstype operators int48 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '<(int4,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '2', amopopr => '<=(int4,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '3', amopopr => '=(int4,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '4', amopopr => '>=(int4,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '5', amopopr => '>(int4,int8)', + amopmethod => 'btree' }, + +# default operators int8 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '<(int8,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '2', amopopr => '<=(int8,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '3', amopopr => '=(int8,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '4', amopopr => '>=(int8,int8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '5', amopopr => '>(int8,int8)', + amopmethod => 'btree' }, + +# crosstype operators int82 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '<(int8,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '2', amopopr => '<=(int8,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '3', amopopr => '=(int8,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '4', amopopr => '>=(int8,int2)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '5', amopopr => '>(int8,int2)', + amopmethod => 'btree' }, + +# crosstype operators int84 +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '<(int8,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '2', amopopr => '<=(int8,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '3', amopopr => '=(int8,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '4', amopopr => '>=(int8,int4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '5', amopopr => '>(int8,int4)', + amopmethod => 'btree' }, + +# btree oid_ops + +{ amopfamily => 'btree/oid_ops', amoplefttype => 'oid', amoprighttype => 'oid', + amopstrategy => '1', amopopr => '<(oid,oid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oid_ops', amoplefttype => 'oid', amoprighttype => 'oid', + amopstrategy => '2', amopopr => '<=(oid,oid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oid_ops', amoplefttype => 'oid', amoprighttype => 'oid', + amopstrategy => '3', amopopr => '=(oid,oid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oid_ops', amoplefttype => 'oid', amoprighttype => 'oid', + amopstrategy => '4', amopopr => '>=(oid,oid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oid_ops', amoplefttype => 'oid', amoprighttype => 'oid', + amopstrategy => '5', amopopr => '>(oid,oid)', amopmethod => 'btree' }, + +# btree tid_ops + +{ amopfamily => 'btree/tid_ops', amoplefttype => 'tid', amoprighttype => 'tid', + amopstrategy => '1', amopopr => '<(tid,tid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tid_ops', amoplefttype => 'tid', amoprighttype => 'tid', + amopstrategy => '2', amopopr => '<=(tid,tid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tid_ops', amoplefttype => 'tid', amoprighttype => 'tid', + amopstrategy => '3', amopopr => '=(tid,tid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tid_ops', amoplefttype => 'tid', amoprighttype => 'tid', + amopstrategy => '4', amopopr => '>=(tid,tid)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tid_ops', amoplefttype => 'tid', amoprighttype => 'tid', + amopstrategy => '5', amopopr => '>(tid,tid)', amopmethod => 'btree' }, + +# btree oidvector_ops + +{ amopfamily => 'btree/oidvector_ops', amoplefttype => 'oidvector', + amoprighttype => 'oidvector', amopstrategy => '1', + amopopr => '<(oidvector,oidvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oidvector_ops', amoplefttype => 'oidvector', + amoprighttype => 'oidvector', amopstrategy => '2', + amopopr => '<=(oidvector,oidvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oidvector_ops', amoplefttype => 'oidvector', + amoprighttype => 'oidvector', amopstrategy => '3', + amopopr => '=(oidvector,oidvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oidvector_ops', amoplefttype => 'oidvector', + amoprighttype => 'oidvector', amopstrategy => '4', + amopopr => '>=(oidvector,oidvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/oidvector_ops', amoplefttype => 'oidvector', + amoprighttype => 'oidvector', amopstrategy => '5', + amopopr => '>(oidvector,oidvector)', amopmethod => 'btree' }, + +# btree float_ops + +# default operators float4 +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '1', amopopr => '<(float4,float4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '2', + amopopr => '<=(float4,float4)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '3', amopopr => '=(float4,float4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '4', + amopopr => '>=(float4,float4)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '5', amopopr => '>(float4,float4)', + amopmethod => 'btree' }, + +# crosstype operators float48 +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '1', amopopr => '<(float4,float8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '2', + amopopr => '<=(float4,float8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '3', amopopr => '=(float4,float8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '4', + amopopr => '>=(float4,float8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '5', amopopr => '>(float4,float8)', + amopmethod => 'btree' }, + +# default operators float8 +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '1', amopopr => '<(float8,float8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '2', + amopopr => '<=(float8,float8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '3', amopopr => '=(float8,float8)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '4', + amopopr => '>=(float8,float8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '5', amopopr => '>(float8,float8)', + amopmethod => 'btree' }, + +# crosstype operators float84 +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '1', amopopr => '<(float8,float4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '2', + amopopr => '<=(float8,float4)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '3', amopopr => '=(float8,float4)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '4', + amopopr => '>=(float8,float4)', amopmethod => 'btree' }, +{ amopfamily => 'btree/float_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '5', amopopr => '>(float8,float4)', + amopmethod => 'btree' }, + +# btree char_ops + +{ amopfamily => 'btree/char_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '1', amopopr => '<(char,char)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/char_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '2', amopopr => '<=(char,char)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/char_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '3', amopopr => '=(char,char)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/char_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '4', amopopr => '>=(char,char)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/char_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '5', amopopr => '>(char,char)', + amopmethod => 'btree' }, + +# btree name_ops + +{ amopfamily => 'btree/name_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '1', amopopr => '<(name,name)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/name_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '2', amopopr => '<=(name,name)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/name_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '3', amopopr => '=(name,name)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/name_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '4', amopopr => '>=(name,name)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/name_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '5', amopopr => '>(name,name)', + amopmethod => 'btree' }, + +# btree text_ops + +{ amopfamily => 'btree/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '1', amopopr => '<(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '2', amopopr => '<=(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '3', amopopr => '=(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '4', amopopr => '>=(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '5', amopopr => '>(text,text)', + amopmethod => 'btree' }, + +# btree bpchar_ops + +{ amopfamily => 'btree/bpchar_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '1', amopopr => '<(bpchar,bpchar)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '2', + amopopr => '<=(bpchar,bpchar)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '3', amopopr => '=(bpchar,bpchar)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '4', + amopopr => '>=(bpchar,bpchar)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '5', amopopr => '>(bpchar,bpchar)', + amopmethod => 'btree' }, + +# btree bytea_ops + +{ amopfamily => 'btree/bytea_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '1', amopopr => '<(bytea,bytea)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bytea_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '2', amopopr => '<=(bytea,bytea)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bytea_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '3', amopopr => '=(bytea,bytea)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bytea_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '4', amopopr => '>=(bytea,bytea)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bytea_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '5', amopopr => '>(bytea,bytea)', + amopmethod => 'btree' }, + +# btree abstime_ops + +{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '1', + amopopr => '<(abstime,abstime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '2', + amopopr => '<=(abstime,abstime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '3', + amopopr => '=(abstime,abstime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '4', + amopopr => '>=(abstime,abstime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/abstime_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '5', + amopopr => '>(abstime,abstime)', amopmethod => 'btree' }, + +# btree datetime_ops + +# default operators date +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '1', amopopr => '<(date,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '2', amopopr => '<=(date,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '3', amopopr => '=(date,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '4', amopopr => '>=(date,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '5', amopopr => '>(date,date)', + amopmethod => 'btree' }, + +# crosstype operators vs timestamp +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '1', + amopopr => '<(date,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '2', + amopopr => '<=(date,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '3', + amopopr => '=(date,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '4', + amopopr => '>=(date,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '5', + amopopr => '>(date,timestamp)', amopmethod => 'btree' }, + +# crosstype operators vs timestamptz +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '1', + amopopr => '<(date,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '2', + amopopr => '<=(date,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '3', + amopopr => '=(date,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '4', + amopopr => '>=(date,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '5', + amopopr => '>(date,timestamptz)', amopmethod => 'btree' }, + +# default operators timestamp +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '1', + amopopr => '<(timestamp,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '2', + amopopr => '<=(timestamp,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '3', + amopopr => '=(timestamp,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '4', + amopopr => '>=(timestamp,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '5', + amopopr => '>(timestamp,timestamp)', amopmethod => 'btree' }, + +# crosstype operators vs date +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '1', amopopr => '<(timestamp,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '2', amopopr => '<=(timestamp,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '3', amopopr => '=(timestamp,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '4', amopopr => '>=(timestamp,date)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '5', amopopr => '>(timestamp,date)', + amopmethod => 'btree' }, + +# crosstype operators vs timestamptz +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '1', + amopopr => '<(timestamp,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '2', + amopopr => '<=(timestamp,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '3', + amopopr => '=(timestamp,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '4', + amopopr => '>=(timestamp,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '5', + amopopr => '>(timestamp,timestamptz)', amopmethod => 'btree' }, + +# default operators timestamptz +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '1', + amopopr => '<(timestamptz,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '2', + amopopr => '<=(timestamptz,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '3', + amopopr => '=(timestamptz,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '4', + amopopr => '>=(timestamptz,timestamptz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '5', + amopopr => '>(timestamptz,timestamptz)', amopmethod => 'btree' }, + +# crosstype operators vs date +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '1', + amopopr => '<(timestamptz,date)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '2', + amopopr => '<=(timestamptz,date)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '3', + amopopr => '=(timestamptz,date)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '4', + amopopr => '>=(timestamptz,date)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '5', + amopopr => '>(timestamptz,date)', amopmethod => 'btree' }, + +# crosstype operators vs timestamp +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '1', + amopopr => '<(timestamptz,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '2', + amopopr => '<=(timestamptz,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '3', + amopopr => '=(timestamptz,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '4', + amopopr => '>=(timestamptz,timestamp)', amopmethod => 'btree' }, +{ amopfamily => 'btree/datetime_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '5', + amopopr => '>(timestamptz,timestamp)', amopmethod => 'btree' }, + +# btree time_ops + +{ amopfamily => 'btree/time_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '1', amopopr => '<(time,time)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/time_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '2', amopopr => '<=(time,time)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/time_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '3', amopopr => '=(time,time)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/time_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '4', amopopr => '>=(time,time)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/time_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '5', amopopr => '>(time,time)', + amopmethod => 'btree' }, + +# btree timetz_ops + +{ amopfamily => 'btree/timetz_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '1', amopopr => '<(timetz,timetz)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/timetz_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '2', + amopopr => '<=(timetz,timetz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/timetz_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '3', amopopr => '=(timetz,timetz)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/timetz_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '4', + amopopr => '>=(timetz,timetz)', amopmethod => 'btree' }, +{ amopfamily => 'btree/timetz_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '5', amopopr => '>(timetz,timetz)', + amopmethod => 'btree' }, + +# btree interval_ops + +{ amopfamily => 'btree/interval_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '1', + amopopr => '<(interval,interval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/interval_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '2', + amopopr => '<=(interval,interval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/interval_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '3', + amopopr => '=(interval,interval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/interval_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '4', + amopopr => '>=(interval,interval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/interval_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '5', + amopopr => '>(interval,interval)', amopmethod => 'btree' }, + +# btree macaddr + +{ amopfamily => 'btree/macaddr_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '1', + amopopr => '<(macaddr,macaddr)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '2', + amopopr => '<=(macaddr,macaddr)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '3', + amopopr => '=(macaddr,macaddr)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '4', + amopopr => '>=(macaddr,macaddr)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '5', + amopopr => '>(macaddr,macaddr)', amopmethod => 'btree' }, + +# btree macaddr8 + +{ amopfamily => 'btree/macaddr8_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '1', + amopopr => '<(macaddr8,macaddr8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr8_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '2', + amopopr => '<=(macaddr8,macaddr8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr8_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '3', + amopopr => '=(macaddr8,macaddr8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr8_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '4', + amopopr => '>=(macaddr8,macaddr8)', amopmethod => 'btree' }, +{ amopfamily => 'btree/macaddr8_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '5', + amopopr => '>(macaddr8,macaddr8)', amopmethod => 'btree' }, + +# btree network + +{ amopfamily => 'btree/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '1', amopopr => '<(inet,inet)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '2', amopopr => '<=(inet,inet)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '3', amopopr => '=(inet,inet)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '4', amopopr => '>=(inet,inet)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '5', amopopr => '>(inet,inet)', + amopmethod => 'btree' }, + +# btree numeric + +{ amopfamily => 'btree/numeric_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '1', + amopopr => '<(numeric,numeric)', amopmethod => 'btree' }, +{ amopfamily => 'btree/numeric_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '2', + amopopr => '<=(numeric,numeric)', amopmethod => 'btree' }, +{ amopfamily => 'btree/numeric_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '3', + amopopr => '=(numeric,numeric)', amopmethod => 'btree' }, +{ amopfamily => 'btree/numeric_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '4', + amopopr => '>=(numeric,numeric)', amopmethod => 'btree' }, +{ amopfamily => 'btree/numeric_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '5', + amopopr => '>(numeric,numeric)', amopmethod => 'btree' }, + +# btree bool + +{ amopfamily => 'btree/bool_ops', amoplefttype => 'bool', + amoprighttype => 'bool', amopstrategy => '1', amopopr => '<(bool,bool)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bool_ops', amoplefttype => 'bool', + amoprighttype => 'bool', amopstrategy => '2', amopopr => '<=(bool,bool)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bool_ops', amoplefttype => 'bool', + amoprighttype => 'bool', amopstrategy => '3', amopopr => '=(bool,bool)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bool_ops', amoplefttype => 'bool', + amoprighttype => 'bool', amopstrategy => '4', amopopr => '>=(bool,bool)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bool_ops', amoplefttype => 'bool', + amoprighttype => 'bool', amopstrategy => '5', amopopr => '>(bool,bool)', + amopmethod => 'btree' }, + +# btree bit + +{ amopfamily => 'btree/bit_ops', amoplefttype => 'bit', amoprighttype => 'bit', + amopstrategy => '1', amopopr => '<(bit,bit)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bit_ops', amoplefttype => 'bit', amoprighttype => 'bit', + amopstrategy => '2', amopopr => '<=(bit,bit)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bit_ops', amoplefttype => 'bit', amoprighttype => 'bit', + amopstrategy => '3', amopopr => '=(bit,bit)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bit_ops', amoplefttype => 'bit', amoprighttype => 'bit', + amopstrategy => '4', amopopr => '>=(bit,bit)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bit_ops', amoplefttype => 'bit', amoprighttype => 'bit', + amopstrategy => '5', amopopr => '>(bit,bit)', amopmethod => 'btree' }, + +# btree varbit + +{ amopfamily => 'btree/varbit_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '1', amopopr => '<(varbit,varbit)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/varbit_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '2', + amopopr => '<=(varbit,varbit)', amopmethod => 'btree' }, +{ amopfamily => 'btree/varbit_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '3', amopopr => '=(varbit,varbit)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/varbit_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '4', + amopopr => '>=(varbit,varbit)', amopmethod => 'btree' }, +{ amopfamily => 'btree/varbit_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '5', amopopr => '>(varbit,varbit)', + amopmethod => 'btree' }, + +# btree text pattern + +{ amopfamily => 'btree/text_pattern_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '1', amopopr => '~<~(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_pattern_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '2', amopopr => '~<=~(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_pattern_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '3', amopopr => '=(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_pattern_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '4', amopopr => '~>=~(text,text)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/text_pattern_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '5', amopopr => '~>~(text,text)', + amopmethod => 'btree' }, + +# btree bpchar pattern + +{ amopfamily => 'btree/bpchar_pattern_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '1', + amopopr => '~<~(bpchar,bpchar)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_pattern_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '2', + amopopr => '~<=~(bpchar,bpchar)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_pattern_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '3', amopopr => '=(bpchar,bpchar)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_pattern_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '4', + amopopr => '~>=~(bpchar,bpchar)', amopmethod => 'btree' }, +{ amopfamily => 'btree/bpchar_pattern_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '5', + amopopr => '~>~(bpchar,bpchar)', amopmethod => 'btree' }, + +# btree money_ops + +{ amopfamily => 'btree/money_ops', amoplefttype => 'money', + amoprighttype => 'money', amopstrategy => '1', amopopr => '<(money,money)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/money_ops', amoplefttype => 'money', + amoprighttype => 'money', amopstrategy => '2', amopopr => '<=(money,money)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/money_ops', amoplefttype => 'money', + amoprighttype => 'money', amopstrategy => '3', amopopr => '=(money,money)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/money_ops', amoplefttype => 'money', + amoprighttype => 'money', amopstrategy => '4', amopopr => '>=(money,money)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/money_ops', amoplefttype => 'money', + amoprighttype => 'money', amopstrategy => '5', amopopr => '>(money,money)', + amopmethod => 'btree' }, + +# btree reltime_ops + +{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '1', + amopopr => '<(reltime,reltime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '2', + amopopr => '<=(reltime,reltime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '3', + amopopr => '=(reltime,reltime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '4', + amopopr => '>=(reltime,reltime)', amopmethod => 'btree' }, +{ amopfamily => 'btree/reltime_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '5', + amopopr => '>(reltime,reltime)', amopmethod => 'btree' }, + +# btree tinterval_ops + +{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval', + amoprighttype => 'tinterval', amopstrategy => '1', + amopopr => '<(tinterval,tinterval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval', + amoprighttype => 'tinterval', amopstrategy => '2', + amopopr => '<=(tinterval,tinterval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval', + amoprighttype => 'tinterval', amopstrategy => '3', + amopopr => '=(tinterval,tinterval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval', + amoprighttype => 'tinterval', amopstrategy => '4', + amopopr => '>=(tinterval,tinterval)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tinterval_ops', amoplefttype => 'tinterval', + amoprighttype => 'tinterval', amopstrategy => '5', + amopopr => '>(tinterval,tinterval)', amopmethod => 'btree' }, + +# btree array_ops + +{ amopfamily => 'btree/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '1', + amopopr => '<(anyarray,anyarray)', amopmethod => 'btree' }, +{ amopfamily => 'btree/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '2', + amopopr => '<=(anyarray,anyarray)', amopmethod => 'btree' }, +{ amopfamily => 'btree/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '3', + amopopr => '=(anyarray,anyarray)', amopmethod => 'btree' }, +{ amopfamily => 'btree/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '4', + amopopr => '>=(anyarray,anyarray)', amopmethod => 'btree' }, +{ amopfamily => 'btree/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '5', + amopopr => '>(anyarray,anyarray)', amopmethod => 'btree' }, + +# btree record_ops + +{ amopfamily => 'btree/record_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '1', amopopr => '<(record,record)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/record_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '2', + amopopr => '<=(record,record)', amopmethod => 'btree' }, +{ amopfamily => 'btree/record_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '3', amopopr => '=(record,record)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/record_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '4', + amopopr => '>=(record,record)', amopmethod => 'btree' }, +{ amopfamily => 'btree/record_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '5', amopopr => '>(record,record)', + amopmethod => 'btree' }, + +# btree record_image_ops + +{ amopfamily => 'btree/record_image_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '1', + amopopr => '*<(record,record)', amopmethod => 'btree' }, +{ amopfamily => 'btree/record_image_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '2', + amopopr => '*<=(record,record)', amopmethod => 'btree' }, +{ amopfamily => 'btree/record_image_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '3', + amopopr => '*=(record,record)', amopmethod => 'btree' }, +{ amopfamily => 'btree/record_image_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '4', + amopopr => '*>=(record,record)', amopmethod => 'btree' }, +{ amopfamily => 'btree/record_image_ops', amoplefttype => 'record', + amoprighttype => 'record', amopstrategy => '5', + amopopr => '*>(record,record)', amopmethod => 'btree' }, + +# btree uuid_ops + +{ amopfamily => 'btree/uuid_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '1', amopopr => '<(uuid,uuid)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/uuid_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '2', amopopr => '<=(uuid,uuid)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/uuid_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '3', amopopr => '=(uuid,uuid)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/uuid_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '4', amopopr => '>=(uuid,uuid)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/uuid_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '5', amopopr => '>(uuid,uuid)', + amopmethod => 'btree' }, + +# btree pg_lsn_ops + +{ amopfamily => 'btree/pg_lsn_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '1', amopopr => '<(pg_lsn,pg_lsn)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/pg_lsn_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '2', + amopopr => '<=(pg_lsn,pg_lsn)', amopmethod => 'btree' }, +{ amopfamily => 'btree/pg_lsn_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '3', amopopr => '=(pg_lsn,pg_lsn)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/pg_lsn_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '4', + amopopr => '>=(pg_lsn,pg_lsn)', amopmethod => 'btree' }, +{ amopfamily => 'btree/pg_lsn_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '5', amopopr => '>(pg_lsn,pg_lsn)', + amopmethod => 'btree' }, + +# hash index_ops + +# bpchar_ops +{ amopfamily => 'hash/bpchar_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '1', amopopr => '=(bpchar,bpchar)', + amopmethod => 'hash' }, + +# char_ops +{ amopfamily => 'hash/char_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '1', amopopr => '=(char,char)', + amopmethod => 'hash' }, + +# date_ops +{ amopfamily => 'hash/date_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '1', amopopr => '=(date,date)', + amopmethod => 'hash' }, + +# float_ops +{ amopfamily => 'hash/float_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '1', amopopr => '=(float4,float4)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/float_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '1', amopopr => '=(float8,float8)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/float_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '1', amopopr => '=(float4,float8)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/float_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '1', amopopr => '=(float8,float4)', + amopmethod => 'hash' }, + +# network_ops +{ amopfamily => 'hash/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '1', amopopr => '=(inet,inet)', + amopmethod => 'hash' }, + +# integer_ops +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '=(int2,int2)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '=(int4,int4)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '=(int8,int8)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '=(int2,int4)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '=(int2,int8)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '=(int4,int2)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '=(int4,int8)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '=(int8,int2)', + amopmethod => 'hash' }, +{ amopfamily => 'hash/integer_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '=(int8,int4)', + amopmethod => 'hash' }, + +# interval_ops +{ amopfamily => 'hash/interval_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '1', + amopopr => '=(interval,interval)', amopmethod => 'hash' }, + +# macaddr_ops +{ amopfamily => 'hash/macaddr_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '1', + amopopr => '=(macaddr,macaddr)', amopmethod => 'hash' }, + +# macaddr8_ops +{ amopfamily => 'hash/macaddr8_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '1', + amopopr => '=(macaddr8,macaddr8)', amopmethod => 'hash' }, + +# name_ops +{ amopfamily => 'hash/name_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '1', amopopr => '=(name,name)', + amopmethod => 'hash' }, + +# oid_ops +{ amopfamily => 'hash/oid_ops', amoplefttype => 'oid', amoprighttype => 'oid', + amopstrategy => '1', amopopr => '=(oid,oid)', amopmethod => 'hash' }, + +# oidvector_ops +{ amopfamily => 'hash/oidvector_ops', amoplefttype => 'oidvector', + amoprighttype => 'oidvector', amopstrategy => '1', + amopopr => '=(oidvector,oidvector)', amopmethod => 'hash' }, + +# text_ops +{ amopfamily => 'hash/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '1', amopopr => '=(text,text)', + amopmethod => 'hash' }, + +# time_ops +{ amopfamily => 'hash/time_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '1', amopopr => '=(time,time)', + amopmethod => 'hash' }, + +# timestamptz_ops +{ amopfamily => 'hash/timestamptz_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '1', + amopopr => '=(timestamptz,timestamptz)', amopmethod => 'hash' }, + +# timetz_ops +{ amopfamily => 'hash/timetz_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '1', amopopr => '=(timetz,timetz)', + amopmethod => 'hash' }, + +# timestamp_ops +{ amopfamily => 'hash/timestamp_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '1', + amopopr => '=(timestamp,timestamp)', amopmethod => 'hash' }, + +# bool_ops +{ amopfamily => 'hash/bool_ops', amoplefttype => 'bool', + amoprighttype => 'bool', amopstrategy => '1', amopopr => '=(bool,bool)', + amopmethod => 'hash' }, + +# bytea_ops +{ amopfamily => 'hash/bytea_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '1', amopopr => '=(bytea,bytea)', + amopmethod => 'hash' }, + +# xid_ops +{ amopfamily => 'hash/xid_ops', amoplefttype => 'xid', amoprighttype => 'xid', + amopstrategy => '1', amopopr => '=(xid,xid)', amopmethod => 'hash' }, + +# cid_ops +{ amopfamily => 'hash/cid_ops', amoplefttype => 'cid', amoprighttype => 'cid', + amopstrategy => '1', amopopr => '=(cid,cid)', amopmethod => 'hash' }, + +# abstime_ops +{ amopfamily => 'hash/abstime_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '1', + amopopr => '=(abstime,abstime)', amopmethod => 'hash' }, + +# reltime_ops +{ amopfamily => 'hash/reltime_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '1', + amopopr => '=(reltime,reltime)', amopmethod => 'hash' }, + +# text_pattern_ops +{ amopfamily => 'hash/text_pattern_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '1', amopopr => '=(text,text)', + amopmethod => 'hash' }, + +# bpchar_pattern_ops +{ amopfamily => 'hash/bpchar_pattern_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '1', amopopr => '=(bpchar,bpchar)', + amopmethod => 'hash' }, + +# aclitem_ops +{ amopfamily => 'hash/aclitem_ops', amoplefttype => 'aclitem', + amoprighttype => 'aclitem', amopstrategy => '1', + amopopr => '=(aclitem,aclitem)', amopmethod => 'hash' }, + +# uuid_ops +{ amopfamily => 'hash/uuid_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '1', amopopr => '=(uuid,uuid)', + amopmethod => 'hash' }, + +# pg_lsn_ops +{ amopfamily => 'hash/pg_lsn_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '1', amopopr => '=(pg_lsn,pg_lsn)', + amopmethod => 'hash' }, + +# numeric_ops +{ amopfamily => 'hash/numeric_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '1', + amopopr => '=(numeric,numeric)', amopmethod => 'hash' }, + +# array_ops +{ amopfamily => 'hash/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '1', + amopopr => '=(anyarray,anyarray)', amopmethod => 'hash' }, + +# gist box_ops +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '1', amopopr => '<<(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '2', amopopr => '&<(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '3', amopopr => '&&(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '4', amopopr => '&>(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '5', amopopr => '>>(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '6', amopopr => '~=(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '7', amopopr => '@>(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '8', amopopr => '<@(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '9', amopopr => '&<|(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '10', amopopr => '<<|(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '11', amopopr => '|>>(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '12', amopopr => '|&>(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '13', amopopr => '~(box,box)', amopmethod => 'gist' }, +{ amopfamily => 'gist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '14', amopopr => '@(box,box)', amopmethod => 'gist' }, + +# gist point_ops +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '15', amoppurpose => 'o', + amopopr => '<->(point,point)', amopmethod => 'gist', + amopsortfamily => 'btree/float_ops' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'box', amopstrategy => '28', amopopr => '<@(point,box)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'polygon', amopstrategy => '48', + amopopr => '<@(point,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/point_ops', amoplefttype => 'point', + amoprighttype => 'circle', amopstrategy => '68', + amopopr => '<@(point,circle)', amopmethod => 'gist' }, + +# gist poly_ops (supports polygons) +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '1', + amopopr => '<<(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '2', + amopopr => '&<(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '3', + amopopr => '&&(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '4', + amopopr => '&>(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '5', + amopopr => '>>(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '6', + amopopr => '~=(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '7', + amopopr => '@>(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '8', + amopopr => '<@(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '9', + amopopr => '&<|(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '10', + amopopr => '<<|(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '11', + amopopr => '|>>(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '12', + amopopr => '|&>(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '13', + amopopr => '~(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '14', + amopopr => '@(polygon,polygon)', amopmethod => 'gist' }, +{ amopfamily => 'gist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'point', amopstrategy => '15', amoppurpose => 'o', + amopopr => '<->(polygon,point)', amopmethod => 'gist', + amopsortfamily => 'btree/float_ops' }, + +# gist circle_ops +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '1', + amopopr => '<<(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '2', + amopopr => '&<(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '3', + amopopr => '&&(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '4', + amopopr => '&>(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '5', + amopopr => '>>(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '6', + amopopr => '~=(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '7', + amopopr => '@>(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '8', + amopopr => '<@(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '9', + amopopr => '&<|(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '10', + amopopr => '<<|(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '11', + amopopr => '|>>(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '12', + amopopr => '|&>(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '13', + amopopr => '~(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'circle', amopstrategy => '14', + amopopr => '@(circle,circle)', amopmethod => 'gist' }, +{ amopfamily => 'gist/circle_ops', amoplefttype => 'circle', + amoprighttype => 'point', amopstrategy => '15', amoppurpose => 'o', + amopopr => '<->(circle,point)', amopmethod => 'gist', + amopsortfamily => 'btree/float_ops' }, + +# gin array_ops +{ amopfamily => 'gin/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '1', + amopopr => '&&(anyarray,anyarray)', amopmethod => 'gin' }, +{ amopfamily => 'gin/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '2', + amopopr => '@>(anyarray,anyarray)', amopmethod => 'gin' }, +{ amopfamily => 'gin/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '3', + amopopr => '<@(anyarray,anyarray)', amopmethod => 'gin' }, +{ amopfamily => 'gin/array_ops', amoplefttype => 'anyarray', + amoprighttype => 'anyarray', amopstrategy => '4', + amopopr => '=(anyarray,anyarray)', amopmethod => 'gin' }, + +# btree enum_ops +{ amopfamily => 'btree/enum_ops', amoplefttype => 'anyenum', + amoprighttype => 'anyenum', amopstrategy => '1', + amopopr => '<(anyenum,anyenum)', amopmethod => 'btree' }, +{ amopfamily => 'btree/enum_ops', amoplefttype => 'anyenum', + amoprighttype => 'anyenum', amopstrategy => '2', + amopopr => '<=(anyenum,anyenum)', amopmethod => 'btree' }, +{ amopfamily => 'btree/enum_ops', amoplefttype => 'anyenum', + amoprighttype => 'anyenum', amopstrategy => '3', + amopopr => '=(anyenum,anyenum)', amopmethod => 'btree' }, +{ amopfamily => 'btree/enum_ops', amoplefttype => 'anyenum', + amoprighttype => 'anyenum', amopstrategy => '4', + amopopr => '>=(anyenum,anyenum)', amopmethod => 'btree' }, +{ amopfamily => 'btree/enum_ops', amoplefttype => 'anyenum', + amoprighttype => 'anyenum', amopstrategy => '5', + amopopr => '>(anyenum,anyenum)', amopmethod => 'btree' }, + +# hash enum_ops +{ amopfamily => 'hash/enum_ops', amoplefttype => 'anyenum', + amoprighttype => 'anyenum', amopstrategy => '1', + amopopr => '=(anyenum,anyenum)', amopmethod => 'hash' }, + +# btree tsvector_ops +{ amopfamily => 'btree/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsvector', amopstrategy => '1', + amopopr => '<(tsvector,tsvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsvector', amopstrategy => '2', + amopopr => '<=(tsvector,tsvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsvector', amopstrategy => '3', + amopopr => '=(tsvector,tsvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsvector', amopstrategy => '4', + amopopr => '>=(tsvector,tsvector)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsvector', amopstrategy => '5', + amopopr => '>(tsvector,tsvector)', amopmethod => 'btree' }, + +# GiST tsvector_ops +{ amopfamily => 'gist/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsquery', amopstrategy => '1', + amopopr => '@@(tsvector,tsquery)', amopmethod => 'gist' }, + +# GIN tsvector_ops +{ amopfamily => 'gin/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsquery', amopstrategy => '1', + amopopr => '@@(tsvector,tsquery)', amopmethod => 'gin' }, +{ amopfamily => 'gin/tsvector_ops', amoplefttype => 'tsvector', + amoprighttype => 'tsquery', amopstrategy => '2', + amopopr => '@@@(tsvector,tsquery)', amopmethod => 'gin' }, + +# btree tsquery_ops +{ amopfamily => 'btree/tsquery_ops', amoplefttype => 'tsquery', + amoprighttype => 'tsquery', amopstrategy => '1', + amopopr => '<(tsquery,tsquery)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsquery_ops', amoplefttype => 'tsquery', + amoprighttype => 'tsquery', amopstrategy => '2', + amopopr => '<=(tsquery,tsquery)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsquery_ops', amoplefttype => 'tsquery', + amoprighttype => 'tsquery', amopstrategy => '3', + amopopr => '=(tsquery,tsquery)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsquery_ops', amoplefttype => 'tsquery', + amoprighttype => 'tsquery', amopstrategy => '4', + amopopr => '>=(tsquery,tsquery)', amopmethod => 'btree' }, +{ amopfamily => 'btree/tsquery_ops', amoplefttype => 'tsquery', + amoprighttype => 'tsquery', amopstrategy => '5', + amopopr => '>(tsquery,tsquery)', amopmethod => 'btree' }, + +# GiST tsquery_ops +{ amopfamily => 'gist/tsquery_ops', amoplefttype => 'tsquery', + amoprighttype => 'tsquery', amopstrategy => '7', + amopopr => '@>(tsquery,tsquery)', amopmethod => 'gist' }, +{ amopfamily => 'gist/tsquery_ops', amoplefttype => 'tsquery', + amoprighttype => 'tsquery', amopstrategy => '8', + amopopr => '<@(tsquery,tsquery)', amopmethod => 'gist' }, + +# btree range_ops +{ amopfamily => 'btree/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '1', + amopopr => '<(anyrange,anyrange)', amopmethod => 'btree' }, +{ amopfamily => 'btree/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '2', + amopopr => '<=(anyrange,anyrange)', amopmethod => 'btree' }, +{ amopfamily => 'btree/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '3', + amopopr => '=(anyrange,anyrange)', amopmethod => 'btree' }, +{ amopfamily => 'btree/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '4', + amopopr => '>=(anyrange,anyrange)', amopmethod => 'btree' }, +{ amopfamily => 'btree/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '5', + amopopr => '>(anyrange,anyrange)', amopmethod => 'btree' }, + +# hash range_ops +{ amopfamily => 'hash/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '1', + amopopr => '=(anyrange,anyrange)', amopmethod => 'hash' }, + +# GiST range_ops +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '1', + amopopr => '<<(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '2', + amopopr => '&<(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '3', + amopopr => '&&(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '4', + amopopr => '&>(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '5', + amopopr => '>>(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '6', + amopopr => '-|-(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '7', + amopopr => '@>(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '8', + amopopr => '<@(anyrange,anyrange)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyelement', amopstrategy => '16', + amopopr => '@>(anyrange,anyelement)', amopmethod => 'gist' }, +{ amopfamily => 'gist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '18', + amopopr => '=(anyrange,anyrange)', amopmethod => 'gist' }, + +# SP-GiST quad_point_ops +{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/quad_point_ops', amoplefttype => 'point', + amoprighttype => 'box', amopstrategy => '8', amopopr => '<@(point,box)', + amopmethod => 'spgist' }, + +# SP-GiST kd_point_ops +{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '11', amopopr => '>^(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '1', amopopr => '<<(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '5', amopopr => '>>(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '10', amopopr => '<^(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', + amoprighttype => 'point', amopstrategy => '6', amopopr => '~=(point,point)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/kd_point_ops', amoplefttype => 'point', + amoprighttype => 'box', amopstrategy => '8', amopopr => '<@(point,box)', + amopmethod => 'spgist' }, + +# SP-GiST text_ops +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '1', amopopr => '~<~(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '2', amopopr => '~<=~(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '3', amopopr => '=(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '4', amopopr => '~>=~(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '5', amopopr => '~>~(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '11', amopopr => '<(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '12', amopopr => '<=(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '14', amopopr => '>=(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '15', amopopr => '>(text,text)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/text_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '28', amopopr => '^@(text,text)', + amopmethod => 'spgist' }, + +# btree jsonb_ops +{ amopfamily => 'btree/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '1', amopopr => '<(jsonb,jsonb)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '2', amopopr => '<=(jsonb,jsonb)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '3', amopopr => '=(jsonb,jsonb)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '4', amopopr => '>=(jsonb,jsonb)', + amopmethod => 'btree' }, +{ amopfamily => 'btree/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '5', amopopr => '>(jsonb,jsonb)', + amopmethod => 'btree' }, + +# hash jsonb_ops +{ amopfamily => 'hash/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '1', amopopr => '=(jsonb,jsonb)', + amopmethod => 'hash' }, + +# GIN jsonb_ops +{ amopfamily => 'gin/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '7', amopopr => '@>(jsonb,jsonb)', + amopmethod => 'gin' }, +{ amopfamily => 'gin/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => 'text', amopstrategy => '9', amopopr => '?(jsonb,text)', + amopmethod => 'gin' }, +{ amopfamily => 'gin/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => '_text', amopstrategy => '10', amopopr => '?|(jsonb,_text)', + amopmethod => 'gin' }, +{ amopfamily => 'gin/jsonb_ops', amoplefttype => 'jsonb', + amoprighttype => '_text', amopstrategy => '11', amopopr => '?&(jsonb,_text)', + amopmethod => 'gin' }, + +# GIN jsonb_path_ops +{ amopfamily => 'gin/jsonb_path_ops', amoplefttype => 'jsonb', + amoprighttype => 'jsonb', amopstrategy => '7', amopopr => '@>(jsonb,jsonb)', + amopmethod => 'gin' }, + +# SP-GiST range_ops +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '1', + amopopr => '<<(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '2', + amopopr => '&<(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '3', + amopopr => '&&(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '4', + amopopr => '&>(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '5', + amopopr => '>>(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '6', + amopopr => '-|-(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '7', + amopopr => '@>(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '8', + amopopr => '<@(anyrange,anyrange)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyelement', amopstrategy => '16', + amopopr => '@>(anyrange,anyelement)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/range_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '18', + amopopr => '=(anyrange,anyrange)', amopmethod => 'spgist' }, + +# SP-GiST box_ops +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '1', amopopr => '<<(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '2', amopopr => '&<(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '3', amopopr => '&&(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '4', amopopr => '&>(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '5', amopopr => '>>(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '6', amopopr => '~=(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '7', amopopr => '@>(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '8', amopopr => '<@(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '9', amopopr => '&<|(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '10', amopopr => '<<|(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '11', amopopr => '|>>(box,box)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/box_ops', amoplefttype => 'box', amoprighttype => 'box', + amopstrategy => '12', amopopr => '|&>(box,box)', amopmethod => 'spgist' }, + +# SP-GiST poly_ops (supports polygons) +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '1', + amopopr => '<<(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '2', + amopopr => '&<(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '3', + amopopr => '&&(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '4', + amopopr => '&>(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '5', + amopopr => '>>(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '6', + amopopr => '~=(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '7', + amopopr => '@>(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '8', + amopopr => '<@(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '9', + amopopr => '&<|(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '10', + amopopr => '<<|(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '11', + amopopr => '|>>(polygon,polygon)', amopmethod => 'spgist' }, +{ amopfamily => 'spgist/poly_ops', amoplefttype => 'polygon', + amoprighttype => 'polygon', amopstrategy => '12', + amopopr => '|&>(polygon,polygon)', amopmethod => 'spgist' }, + +# GiST inet_ops +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '3', amopopr => '&&(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '18', amopopr => '=(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '19', amopopr => '<>(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '20', amopopr => '<(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '21', amopopr => '<=(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '22', amopopr => '>(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '23', amopopr => '>=(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '24', amopopr => '<<(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '25', amopopr => '<<=(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '26', amopopr => '>>(inet,inet)', + amopmethod => 'gist' }, +{ amopfamily => 'gist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '27', amopopr => '>>=(inet,inet)', + amopmethod => 'gist' }, + +# SP-GiST inet_ops +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '3', amopopr => '&&(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '18', amopopr => '=(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '19', amopopr => '<>(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '20', amopopr => '<(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '21', amopopr => '<=(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '22', amopopr => '>(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '23', amopopr => '>=(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '24', amopopr => '<<(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '25', amopopr => '<<=(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '26', amopopr => '>>(inet,inet)', + amopmethod => 'spgist' }, +{ amopfamily => 'spgist/network_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '27', amopopr => '>>=(inet,inet)', + amopmethod => 'spgist' }, + +# BRIN opclasses + +# minmax bytea +{ amopfamily => 'brin/bytea_minmax_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '1', amopopr => '<(bytea,bytea)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bytea_minmax_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '2', amopopr => '<=(bytea,bytea)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bytea_minmax_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '3', amopopr => '=(bytea,bytea)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bytea_minmax_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '4', amopopr => '>=(bytea,bytea)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bytea_minmax_ops', amoplefttype => 'bytea', + amoprighttype => 'bytea', amopstrategy => '5', amopopr => '>(bytea,bytea)', + amopmethod => 'brin' }, + +# minmax "char" +{ amopfamily => 'brin/char_minmax_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '1', amopopr => '<(char,char)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/char_minmax_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '2', amopopr => '<=(char,char)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/char_minmax_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '3', amopopr => '=(char,char)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/char_minmax_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '4', amopopr => '>=(char,char)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/char_minmax_ops', amoplefttype => 'char', + amoprighttype => 'char', amopstrategy => '5', amopopr => '>(char,char)', + amopmethod => 'brin' }, + +# minmax name +{ amopfamily => 'brin/name_minmax_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '1', amopopr => '<(name,name)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/name_minmax_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '2', amopopr => '<=(name,name)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/name_minmax_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '3', amopopr => '=(name,name)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/name_minmax_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '4', amopopr => '>=(name,name)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/name_minmax_ops', amoplefttype => 'name', + amoprighttype => 'name', amopstrategy => '5', amopopr => '>(name,name)', + amopmethod => 'brin' }, + +# minmax integer + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '<(int8,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '2', amopopr => '<=(int8,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '3', amopopr => '=(int8,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '4', amopopr => '>=(int8,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int8', amopstrategy => '5', amopopr => '>(int8,int8)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '<(int8,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '2', amopopr => '<=(int8,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '3', amopopr => '=(int8,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '4', amopopr => '>=(int8,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int2', amopstrategy => '5', amopopr => '>(int8,int2)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '<(int8,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '2', amopopr => '<=(int8,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '3', amopopr => '=(int8,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '4', amopopr => '>=(int8,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int8', + amoprighttype => 'int4', amopstrategy => '5', amopopr => '>(int8,int4)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '<(int2,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '2', amopopr => '<=(int2,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '3', amopopr => '=(int2,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '4', amopopr => '>=(int2,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int2', amopstrategy => '5', amopopr => '>(int2,int2)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '<(int2,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '2', amopopr => '<=(int2,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '3', amopopr => '=(int2,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '4', amopopr => '>=(int2,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int8', amopstrategy => '5', amopopr => '>(int2,int8)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '<(int2,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '2', amopopr => '<=(int2,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '3', amopopr => '=(int2,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '4', amopopr => '>=(int2,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int2', + amoprighttype => 'int4', amopstrategy => '5', amopopr => '>(int2,int4)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '1', amopopr => '<(int4,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '2', amopopr => '<=(int4,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '3', amopopr => '=(int4,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '4', amopopr => '>=(int4,int4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int4', amopstrategy => '5', amopopr => '>(int4,int4)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '1', amopopr => '<(int4,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '2', amopopr => '<=(int4,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '3', amopopr => '=(int4,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '4', amopopr => '>=(int4,int2)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int2', amopstrategy => '5', amopopr => '>(int4,int2)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '1', amopopr => '<(int4,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '2', amopopr => '<=(int4,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '3', amopopr => '=(int4,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '4', amopopr => '>=(int4,int8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/integer_minmax_ops', amoplefttype => 'int4', + amoprighttype => 'int8', amopstrategy => '5', amopopr => '>(int4,int8)', + amopmethod => 'brin' }, + +# minmax text +{ amopfamily => 'brin/text_minmax_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '1', amopopr => '<(text,text)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/text_minmax_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '2', amopopr => '<=(text,text)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/text_minmax_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '3', amopopr => '=(text,text)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/text_minmax_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '4', amopopr => '>=(text,text)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/text_minmax_ops', amoplefttype => 'text', + amoprighttype => 'text', amopstrategy => '5', amopopr => '>(text,text)', + amopmethod => 'brin' }, + +# minmax oid +{ amopfamily => 'brin/oid_minmax_ops', amoplefttype => 'oid', + amoprighttype => 'oid', amopstrategy => '1', amopopr => '<(oid,oid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/oid_minmax_ops', amoplefttype => 'oid', + amoprighttype => 'oid', amopstrategy => '2', amopopr => '<=(oid,oid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/oid_minmax_ops', amoplefttype => 'oid', + amoprighttype => 'oid', amopstrategy => '3', amopopr => '=(oid,oid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/oid_minmax_ops', amoplefttype => 'oid', + amoprighttype => 'oid', amopstrategy => '4', amopopr => '>=(oid,oid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/oid_minmax_ops', amoplefttype => 'oid', + amoprighttype => 'oid', amopstrategy => '5', amopopr => '>(oid,oid)', + amopmethod => 'brin' }, + +# minmax tid +{ amopfamily => 'brin/tid_minmax_ops', amoplefttype => 'tid', + amoprighttype => 'tid', amopstrategy => '1', amopopr => '<(tid,tid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/tid_minmax_ops', amoplefttype => 'tid', + amoprighttype => 'tid', amopstrategy => '2', amopopr => '<=(tid,tid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/tid_minmax_ops', amoplefttype => 'tid', + amoprighttype => 'tid', amopstrategy => '3', amopopr => '=(tid,tid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/tid_minmax_ops', amoplefttype => 'tid', + amoprighttype => 'tid', amopstrategy => '4', amopopr => '>=(tid,tid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/tid_minmax_ops', amoplefttype => 'tid', + amoprighttype => 'tid', amopstrategy => '5', amopopr => '>(tid,tid)', + amopmethod => 'brin' }, + +# minmax float (float4, float8) + +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '1', amopopr => '<(float4,float4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '2', + amopopr => '<=(float4,float4)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '3', amopopr => '=(float4,float4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '4', + amopopr => '>=(float4,float4)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float4', amopstrategy => '5', amopopr => '>(float4,float4)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '1', amopopr => '<(float4,float8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '2', + amopopr => '<=(float4,float8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '3', amopopr => '=(float4,float8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '4', + amopopr => '>=(float4,float8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float4', + amoprighttype => 'float8', amopstrategy => '5', amopopr => '>(float4,float8)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '1', amopopr => '<(float8,float4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '2', + amopopr => '<=(float8,float4)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '3', amopopr => '=(float8,float4)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '4', + amopopr => '>=(float8,float4)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float4', amopstrategy => '5', amopopr => '>(float8,float4)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '1', amopopr => '<(float8,float8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '2', + amopopr => '<=(float8,float8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '3', amopopr => '=(float8,float8)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '4', + amopopr => '>=(float8,float8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/float_minmax_ops', amoplefttype => 'float8', + amoprighttype => 'float8', amopstrategy => '5', amopopr => '>(float8,float8)', + amopmethod => 'brin' }, + +# minmax abstime +{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '1', + amopopr => '<(abstime,abstime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '2', + amopopr => '<=(abstime,abstime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '3', + amopopr => '=(abstime,abstime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '4', + amopopr => '>=(abstime,abstime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/abstime_minmax_ops', amoplefttype => 'abstime', + amoprighttype => 'abstime', amopstrategy => '5', + amopopr => '>(abstime,abstime)', amopmethod => 'brin' }, + +# minmax reltime +{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '1', + amopopr => '<(reltime,reltime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '2', + amopopr => '<=(reltime,reltime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '3', + amopopr => '=(reltime,reltime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '4', + amopopr => '>=(reltime,reltime)', amopmethod => 'brin' }, +{ amopfamily => 'brin/reltime_minmax_ops', amoplefttype => 'reltime', + amoprighttype => 'reltime', amopstrategy => '5', + amopopr => '>(reltime,reltime)', amopmethod => 'brin' }, + +# minmax macaddr +{ amopfamily => 'brin/macaddr_minmax_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '1', + amopopr => '<(macaddr,macaddr)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr_minmax_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '2', + amopopr => '<=(macaddr,macaddr)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr_minmax_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '3', + amopopr => '=(macaddr,macaddr)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr_minmax_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '4', + amopopr => '>=(macaddr,macaddr)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr_minmax_ops', amoplefttype => 'macaddr', + amoprighttype => 'macaddr', amopstrategy => '5', + amopopr => '>(macaddr,macaddr)', amopmethod => 'brin' }, + +# minmax macaddr8 +{ amopfamily => 'brin/macaddr8_minmax_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '1', + amopopr => '<(macaddr8,macaddr8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr8_minmax_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '2', + amopopr => '<=(macaddr8,macaddr8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr8_minmax_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '3', + amopopr => '=(macaddr8,macaddr8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr8_minmax_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '4', + amopopr => '>=(macaddr8,macaddr8)', amopmethod => 'brin' }, +{ amopfamily => 'brin/macaddr8_minmax_ops', amoplefttype => 'macaddr8', + amoprighttype => 'macaddr8', amopstrategy => '5', + amopopr => '>(macaddr8,macaddr8)', amopmethod => 'brin' }, + +# minmax inet +{ amopfamily => 'brin/network_minmax_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '1', amopopr => '<(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_minmax_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '2', amopopr => '<=(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_minmax_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '3', amopopr => '=(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_minmax_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '4', amopopr => '>=(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_minmax_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '5', amopopr => '>(inet,inet)', + amopmethod => 'brin' }, + +# inclusion inet +{ amopfamily => 'brin/network_inclusion_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '3', amopopr => '&&(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_inclusion_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '7', amopopr => '>>=(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_inclusion_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '8', amopopr => '<<=(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_inclusion_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '18', amopopr => '=(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_inclusion_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '24', amopopr => '>>(inet,inet)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/network_inclusion_ops', amoplefttype => 'inet', + amoprighttype => 'inet', amopstrategy => '26', amopopr => '<<(inet,inet)', + amopmethod => 'brin' }, + +# minmax character +{ amopfamily => 'brin/bpchar_minmax_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '1', amopopr => '<(bpchar,bpchar)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bpchar_minmax_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '2', + amopopr => '<=(bpchar,bpchar)', amopmethod => 'brin' }, +{ amopfamily => 'brin/bpchar_minmax_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '3', amopopr => '=(bpchar,bpchar)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bpchar_minmax_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '4', + amopopr => '>=(bpchar,bpchar)', amopmethod => 'brin' }, +{ amopfamily => 'brin/bpchar_minmax_ops', amoplefttype => 'bpchar', + amoprighttype => 'bpchar', amopstrategy => '5', amopopr => '>(bpchar,bpchar)', + amopmethod => 'brin' }, + +# minmax time without time zone +{ amopfamily => 'brin/time_minmax_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '1', amopopr => '<(time,time)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/time_minmax_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '2', amopopr => '<=(time,time)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/time_minmax_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '3', amopopr => '=(time,time)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/time_minmax_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '4', amopopr => '>=(time,time)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/time_minmax_ops', amoplefttype => 'time', + amoprighttype => 'time', amopstrategy => '5', amopopr => '>(time,time)', + amopmethod => 'brin' }, + +# minmax datetime (date, timestamp, timestamptz) + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '1', + amopopr => '<(timestamp,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '2', + amopopr => '<=(timestamp,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '3', + amopopr => '=(timestamp,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '4', + amopopr => '>=(timestamp,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamp', amopstrategy => '5', + amopopr => '>(timestamp,timestamp)', amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '1', amopopr => '<(timestamp,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '2', amopopr => '<=(timestamp,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '3', amopopr => '=(timestamp,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '4', amopopr => '>=(timestamp,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'date', amopstrategy => '5', amopopr => '>(timestamp,date)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '1', + amopopr => '<(timestamp,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '2', + amopopr => '<=(timestamp,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '3', + amopopr => '=(timestamp,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '4', + amopopr => '>=(timestamp,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamp', + amoprighttype => 'timestamptz', amopstrategy => '5', + amopopr => '>(timestamp,timestamptz)', amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '1', amopopr => '<(date,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '2', amopopr => '<=(date,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '3', amopopr => '=(date,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '4', amopopr => '>=(date,date)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'date', amopstrategy => '5', amopopr => '>(date,date)', + amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '1', + amopopr => '<(date,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '2', + amopopr => '<=(date,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '3', + amopopr => '=(date,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '4', + amopopr => '>=(date,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamp', amopstrategy => '5', + amopopr => '>(date,timestamp)', amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '1', + amopopr => '<(date,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '2', + amopopr => '<=(date,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '3', + amopopr => '=(date,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '4', + amopopr => '>=(date,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'date', + amoprighttype => 'timestamptz', amopstrategy => '5', + amopopr => '>(date,timestamptz)', amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '1', + amopopr => '<(timestamptz,date)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '2', + amopopr => '<=(timestamptz,date)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '3', + amopopr => '=(timestamptz,date)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '4', + amopopr => '>=(timestamptz,date)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'date', amopstrategy => '5', + amopopr => '>(timestamptz,date)', amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '1', + amopopr => '<(timestamptz,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '2', + amopopr => '<=(timestamptz,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '3', + amopopr => '=(timestamptz,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '4', + amopopr => '>=(timestamptz,timestamp)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamp', amopstrategy => '5', + amopopr => '>(timestamptz,timestamp)', amopmethod => 'brin' }, + +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '1', + amopopr => '<(timestamptz,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '2', + amopopr => '<=(timestamptz,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '3', + amopopr => '=(timestamptz,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '4', + amopopr => '>=(timestamptz,timestamptz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/datetime_minmax_ops', amoplefttype => 'timestamptz', + amoprighttype => 'timestamptz', amopstrategy => '5', + amopopr => '>(timestamptz,timestamptz)', amopmethod => 'brin' }, + +# minmax interval +{ amopfamily => 'brin/interval_minmax_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '1', + amopopr => '<(interval,interval)', amopmethod => 'brin' }, +{ amopfamily => 'brin/interval_minmax_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '2', + amopopr => '<=(interval,interval)', amopmethod => 'brin' }, +{ amopfamily => 'brin/interval_minmax_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '3', + amopopr => '=(interval,interval)', amopmethod => 'brin' }, +{ amopfamily => 'brin/interval_minmax_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '4', + amopopr => '>=(interval,interval)', amopmethod => 'brin' }, +{ amopfamily => 'brin/interval_minmax_ops', amoplefttype => 'interval', + amoprighttype => 'interval', amopstrategy => '5', + amopopr => '>(interval,interval)', amopmethod => 'brin' }, + +# minmax time with time zone +{ amopfamily => 'brin/timetz_minmax_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '1', amopopr => '<(timetz,timetz)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/timetz_minmax_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '2', + amopopr => '<=(timetz,timetz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/timetz_minmax_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '3', amopopr => '=(timetz,timetz)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/timetz_minmax_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '4', + amopopr => '>=(timetz,timetz)', amopmethod => 'brin' }, +{ amopfamily => 'brin/timetz_minmax_ops', amoplefttype => 'timetz', + amoprighttype => 'timetz', amopstrategy => '5', amopopr => '>(timetz,timetz)', + amopmethod => 'brin' }, + +# minmax bit +{ amopfamily => 'brin/bit_minmax_ops', amoplefttype => 'bit', + amoprighttype => 'bit', amopstrategy => '1', amopopr => '<(bit,bit)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bit_minmax_ops', amoplefttype => 'bit', + amoprighttype => 'bit', amopstrategy => '2', amopopr => '<=(bit,bit)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bit_minmax_ops', amoplefttype => 'bit', + amoprighttype => 'bit', amopstrategy => '3', amopopr => '=(bit,bit)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bit_minmax_ops', amoplefttype => 'bit', + amoprighttype => 'bit', amopstrategy => '4', amopopr => '>=(bit,bit)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/bit_minmax_ops', amoplefttype => 'bit', + amoprighttype => 'bit', amopstrategy => '5', amopopr => '>(bit,bit)', + amopmethod => 'brin' }, + +# minmax bit varying +{ amopfamily => 'brin/varbit_minmax_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '1', amopopr => '<(varbit,varbit)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/varbit_minmax_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '2', + amopopr => '<=(varbit,varbit)', amopmethod => 'brin' }, +{ amopfamily => 'brin/varbit_minmax_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '3', amopopr => '=(varbit,varbit)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/varbit_minmax_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '4', + amopopr => '>=(varbit,varbit)', amopmethod => 'brin' }, +{ amopfamily => 'brin/varbit_minmax_ops', amoplefttype => 'varbit', + amoprighttype => 'varbit', amopstrategy => '5', amopopr => '>(varbit,varbit)', + amopmethod => 'brin' }, + +# minmax numeric +{ amopfamily => 'brin/numeric_minmax_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '1', + amopopr => '<(numeric,numeric)', amopmethod => 'brin' }, +{ amopfamily => 'brin/numeric_minmax_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '2', + amopopr => '<=(numeric,numeric)', amopmethod => 'brin' }, +{ amopfamily => 'brin/numeric_minmax_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '3', + amopopr => '=(numeric,numeric)', amopmethod => 'brin' }, +{ amopfamily => 'brin/numeric_minmax_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '4', + amopopr => '>=(numeric,numeric)', amopmethod => 'brin' }, +{ amopfamily => 'brin/numeric_minmax_ops', amoplefttype => 'numeric', + amoprighttype => 'numeric', amopstrategy => '5', + amopopr => '>(numeric,numeric)', amopmethod => 'brin' }, + +# minmax uuid +{ amopfamily => 'brin/uuid_minmax_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '1', amopopr => '<(uuid,uuid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/uuid_minmax_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '2', amopopr => '<=(uuid,uuid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/uuid_minmax_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '3', amopopr => '=(uuid,uuid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/uuid_minmax_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '4', amopopr => '>=(uuid,uuid)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/uuid_minmax_ops', amoplefttype => 'uuid', + amoprighttype => 'uuid', amopstrategy => '5', amopopr => '>(uuid,uuid)', + amopmethod => 'brin' }, + +# inclusion range types +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '1', + amopopr => '<<(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '2', + amopopr => '&<(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '3', + amopopr => '&&(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '4', + amopopr => '&>(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '5', + amopopr => '>>(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '7', + amopopr => '@>(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '8', + amopopr => '<@(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyelement', amopstrategy => '16', + amopopr => '@>(anyrange,anyelement)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '17', + amopopr => '-|-(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '18', + amopopr => '=(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '20', + amopopr => '<(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '21', + amopopr => '<=(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '22', + amopopr => '>(anyrange,anyrange)', amopmethod => 'brin' }, +{ amopfamily => 'brin/range_inclusion_ops', amoplefttype => 'anyrange', + amoprighttype => 'anyrange', amopstrategy => '23', + amopopr => '>=(anyrange,anyrange)', amopmethod => 'brin' }, + +# minmax pg_lsn +{ amopfamily => 'brin/pg_lsn_minmax_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '1', amopopr => '<(pg_lsn,pg_lsn)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/pg_lsn_minmax_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '2', + amopopr => '<=(pg_lsn,pg_lsn)', amopmethod => 'brin' }, +{ amopfamily => 'brin/pg_lsn_minmax_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '3', amopopr => '=(pg_lsn,pg_lsn)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/pg_lsn_minmax_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '4', + amopopr => '>=(pg_lsn,pg_lsn)', amopmethod => 'brin' }, +{ amopfamily => 'brin/pg_lsn_minmax_ops', amoplefttype => 'pg_lsn', + amoprighttype => 'pg_lsn', amopstrategy => '5', amopopr => '>(pg_lsn,pg_lsn)', + amopmethod => 'brin' }, + +# inclusion box +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '1', amopopr => '<<(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '2', amopopr => '&<(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '3', amopopr => '&&(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '4', amopopr => '&>(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '5', amopopr => '>>(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '6', amopopr => '~=(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '7', amopopr => '@>(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '8', amopopr => '<@(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '9', amopopr => '&<|(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '10', amopopr => '<<|(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '11', amopopr => '|>>(box,box)', + amopmethod => 'brin' }, +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'box', amopstrategy => '12', amopopr => '|&>(box,box)', + amopmethod => 'brin' }, + +# we could, but choose not to, supply entries for strategies 13 and 14 + +{ amopfamily => 'brin/box_inclusion_ops', amoplefttype => 'box', + amoprighttype => 'point', amopstrategy => '7', amopopr => '@>(box,point)', + amopmethod => 'brin' }, + +] diff --git a/src/include/catalog/pg_amop.h b/src/include/catalog/pg_amop.h index 00e77d4c61e..4be325221f0 100644 --- a/src/include/catalog/pg_amop.h +++ b/src/include/catalog/pg_amop.h @@ -2,7 +2,6 @@ * * pg_amop.h * definition of the system "amop" relation (pg_amop) - * along with the relation's initial contents. * * The amop table identifies the operators associated with each index operator * family and operator class (classes are subsets of families). An associated @@ -36,8 +35,8 @@ * src/include/catalog/pg_amop.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -45,1138 +44,53 @@ #define PG_AMOP_H #include "catalog/genbki.h" +#include "catalog/pg_amop_d.h" /* ---------------- * pg_amop definition. cpp turns this into * typedef struct FormData_pg_amop * ---------------- */ -#define AccessMethodOperatorRelationId 2602 - -CATALOG(pg_amop,2602) +CATALOG(pg_amop,2602,AccessMethodOperatorRelationId) { - Oid amopfamily; /* the index opfamily this entry is for */ - Oid amoplefttype; /* operator's left input data type */ - Oid amoprighttype; /* operator's right input data type */ - int16 amopstrategy; /* operator strategy number */ - char amoppurpose; /* is operator for 's'earch or 'o'rdering? */ - Oid amopopr; /* the operator's pg_operator OID */ - Oid amopmethod; /* the index access method this entry is for */ - Oid amopsortfamily; /* ordering opfamily OID, or 0 if search op */ -} FormData_pg_amop; - -/* allowed values of amoppurpose: */ -#define AMOP_SEARCH 's' /* operator is for search */ -#define AMOP_ORDER 'o' /* operator is for ordering */ - -/* ---------------- - * Form_pg_amop corresponds to a pointer to a tuple with - * the format of pg_amop relation. - * ---------------- - */ -typedef FormData_pg_amop *Form_pg_amop; - -/* ---------------- - * compiler constants for pg_amop - * ---------------- - */ -#define Natts_pg_amop 8 -#define Anum_pg_amop_amopfamily 1 -#define Anum_pg_amop_amoplefttype 2 -#define Anum_pg_amop_amoprighttype 3 -#define Anum_pg_amop_amopstrategy 4 -#define Anum_pg_amop_amoppurpose 5 -#define Anum_pg_amop_amopopr 6 -#define Anum_pg_amop_amopmethod 7 -#define Anum_pg_amop_amopsortfamily 8 - -/* ---------------- - * initial contents of pg_amop - * ---------------- - */ - -/* - * btree integer_ops - */ - -/* default operators int2 */ -DATA(insert ( 1976 21 21 1 s 95 403 0 )); -DATA(insert ( 1976 21 21 2 s 522 403 0 )); -DATA(insert ( 1976 21 21 3 s 94 403 0 )); -DATA(insert ( 1976 21 21 4 s 524 403 0 )); -DATA(insert ( 1976 21 21 5 s 520 403 0 )); -/* crosstype operators int24 */ -DATA(insert ( 1976 21 23 1 s 534 403 0 )); -DATA(insert ( 1976 21 23 2 s 540 403 0 )); -DATA(insert ( 1976 21 23 3 s 532 403 0 )); -DATA(insert ( 1976 21 23 4 s 542 403 0 )); -DATA(insert ( 1976 21 23 5 s 536 403 0 )); -/* crosstype operators int28 */ -DATA(insert ( 1976 21 20 1 s 1864 403 0 )); -DATA(insert ( 1976 21 20 2 s 1866 403 0 )); -DATA(insert ( 1976 21 20 3 s 1862 403 0 )); -DATA(insert ( 1976 21 20 4 s 1867 403 0 )); -DATA(insert ( 1976 21 20 5 s 1865 403 0 )); -/* default operators int4 */ -DATA(insert ( 1976 23 23 1 s 97 403 0 )); -DATA(insert ( 1976 23 23 2 s 523 403 0 )); -DATA(insert ( 1976 23 23 3 s 96 403 0 )); -DATA(insert ( 1976 23 23 4 s 525 403 0 )); -DATA(insert ( 1976 23 23 5 s 521 403 0 )); -/* crosstype operators int42 */ -DATA(insert ( 1976 23 21 1 s 535 403 0 )); -DATA(insert ( 1976 23 21 2 s 541 403 0 )); -DATA(insert ( 1976 23 21 3 s 533 403 0 )); -DATA(insert ( 1976 23 21 4 s 543 403 0 )); -DATA(insert ( 1976 23 21 5 s 537 403 0 )); -/* crosstype operators int48 */ -DATA(insert ( 1976 23 20 1 s 37 403 0 )); -DATA(insert ( 1976 23 20 2 s 80 403 0 )); -DATA(insert ( 1976 23 20 3 s 15 403 0 )); -DATA(insert ( 1976 23 20 4 s 82 403 0 )); -DATA(insert ( 1976 23 20 5 s 76 403 0 )); -/* default operators int8 */ -DATA(insert ( 1976 20 20 1 s 412 403 0 )); -DATA(insert ( 1976 20 20 2 s 414 403 0 )); -DATA(insert ( 1976 20 20 3 s 410 403 0 )); -DATA(insert ( 1976 20 20 4 s 415 403 0 )); -DATA(insert ( 1976 20 20 5 s 413 403 0 )); -/* crosstype operators int82 */ -DATA(insert ( 1976 20 21 1 s 1870 403 0 )); -DATA(insert ( 1976 20 21 2 s 1872 403 0 )); -DATA(insert ( 1976 20 21 3 s 1868 403 0 )); -DATA(insert ( 1976 20 21 4 s 1873 403 0 )); -DATA(insert ( 1976 20 21 5 s 1871 403 0 )); -/* crosstype operators int84 */ -DATA(insert ( 1976 20 23 1 s 418 403 0 )); -DATA(insert ( 1976 20 23 2 s 420 403 0 )); -DATA(insert ( 1976 20 23 3 s 416 403 0 )); -DATA(insert ( 1976 20 23 4 s 430 403 0 )); -DATA(insert ( 1976 20 23 5 s 419 403 0 )); - -/* - * btree oid_ops - */ - -DATA(insert ( 1989 26 26 1 s 609 403 0 )); -DATA(insert ( 1989 26 26 2 s 611 403 0 )); -DATA(insert ( 1989 26 26 3 s 607 403 0 )); -DATA(insert ( 1989 26 26 4 s 612 403 0 )); -DATA(insert ( 1989 26 26 5 s 610 403 0 )); - -/* - * btree tid_ops - */ - -DATA(insert ( 2789 27 27 1 s 2799 403 0 )); -DATA(insert ( 2789 27 27 2 s 2801 403 0 )); -DATA(insert ( 2789 27 27 3 s 387 403 0 )); -DATA(insert ( 2789 27 27 4 s 2802 403 0 )); -DATA(insert ( 2789 27 27 5 s 2800 403 0 )); - -/* - * btree oidvector_ops - */ - -DATA(insert ( 1991 30 30 1 s 645 403 0 )); -DATA(insert ( 1991 30 30 2 s 647 403 0 )); -DATA(insert ( 1991 30 30 3 s 649 403 0 )); -DATA(insert ( 1991 30 30 4 s 648 403 0 )); -DATA(insert ( 1991 30 30 5 s 646 403 0 )); - -/* - * btree float_ops - */ - -/* default operators float4 */ -DATA(insert ( 1970 700 700 1 s 622 403 0 )); -DATA(insert ( 1970 700 700 2 s 624 403 0 )); -DATA(insert ( 1970 700 700 3 s 620 403 0 )); -DATA(insert ( 1970 700 700 4 s 625 403 0 )); -DATA(insert ( 1970 700 700 5 s 623 403 0 )); -/* crosstype operators float48 */ -DATA(insert ( 1970 700 701 1 s 1122 403 0 )); -DATA(insert ( 1970 700 701 2 s 1124 403 0 )); -DATA(insert ( 1970 700 701 3 s 1120 403 0 )); -DATA(insert ( 1970 700 701 4 s 1125 403 0 )); -DATA(insert ( 1970 700 701 5 s 1123 403 0 )); -/* default operators float8 */ -DATA(insert ( 1970 701 701 1 s 672 403 0 )); -DATA(insert ( 1970 701 701 2 s 673 403 0 )); -DATA(insert ( 1970 701 701 3 s 670 403 0 )); -DATA(insert ( 1970 701 701 4 s 675 403 0 )); -DATA(insert ( 1970 701 701 5 s 674 403 0 )); -/* crosstype operators float84 */ -DATA(insert ( 1970 701 700 1 s 1132 403 0 )); -DATA(insert ( 1970 701 700 2 s 1134 403 0 )); -DATA(insert ( 1970 701 700 3 s 1130 403 0 )); -DATA(insert ( 1970 701 700 4 s 1135 403 0 )); -DATA(insert ( 1970 701 700 5 s 1133 403 0 )); - -/* - * btree char_ops - */ - -DATA(insert ( 429 18 18 1 s 631 403 0 )); -DATA(insert ( 429 18 18 2 s 632 403 0 )); -DATA(insert ( 429 18 18 3 s 92 403 0 )); -DATA(insert ( 429 18 18 4 s 634 403 0 )); -DATA(insert ( 429 18 18 5 s 633 403 0 )); - -/* - * btree name_ops - */ - -DATA(insert ( 1986 19 19 1 s 660 403 0 )); -DATA(insert ( 1986 19 19 2 s 661 403 0 )); -DATA(insert ( 1986 19 19 3 s 93 403 0 )); -DATA(insert ( 1986 19 19 4 s 663 403 0 )); -DATA(insert ( 1986 19 19 5 s 662 403 0 )); - -/* - * btree text_ops - */ - -DATA(insert ( 1994 25 25 1 s 664 403 0 )); -DATA(insert ( 1994 25 25 2 s 665 403 0 )); -DATA(insert ( 1994 25 25 3 s 98 403 0 )); -DATA(insert ( 1994 25 25 4 s 667 403 0 )); -DATA(insert ( 1994 25 25 5 s 666 403 0 )); - -/* - * btree bpchar_ops - */ - -DATA(insert ( 426 1042 1042 1 s 1058 403 0 )); -DATA(insert ( 426 1042 1042 2 s 1059 403 0 )); -DATA(insert ( 426 1042 1042 3 s 1054 403 0 )); -DATA(insert ( 426 1042 1042 4 s 1061 403 0 )); -DATA(insert ( 426 1042 1042 5 s 1060 403 0 )); - -/* - * btree bytea_ops - */ - -DATA(insert ( 428 17 17 1 s 1957 403 0 )); -DATA(insert ( 428 17 17 2 s 1958 403 0 )); -DATA(insert ( 428 17 17 3 s 1955 403 0 )); -DATA(insert ( 428 17 17 4 s 1960 403 0 )); -DATA(insert ( 428 17 17 5 s 1959 403 0 )); - -/* - * btree abstime_ops - */ - -DATA(insert ( 421 702 702 1 s 562 403 0 )); -DATA(insert ( 421 702 702 2 s 564 403 0 )); -DATA(insert ( 421 702 702 3 s 560 403 0 )); -DATA(insert ( 421 702 702 4 s 565 403 0 )); -DATA(insert ( 421 702 702 5 s 563 403 0 )); - -/* - * btree datetime_ops - */ - -/* default operators date */ -DATA(insert ( 434 1082 1082 1 s 1095 403 0 )); -DATA(insert ( 434 1082 1082 2 s 1096 403 0 )); -DATA(insert ( 434 1082 1082 3 s 1093 403 0 )); -DATA(insert ( 434 1082 1082 4 s 1098 403 0 )); -DATA(insert ( 434 1082 1082 5 s 1097 403 0 )); -/* crosstype operators vs timestamp */ -DATA(insert ( 434 1082 1114 1 s 2345 403 0 )); -DATA(insert ( 434 1082 1114 2 s 2346 403 0 )); -DATA(insert ( 434 1082 1114 3 s 2347 403 0 )); -DATA(insert ( 434 1082 1114 4 s 2348 403 0 )); -DATA(insert ( 434 1082 1114 5 s 2349 403 0 )); -/* crosstype operators vs timestamptz */ -DATA(insert ( 434 1082 1184 1 s 2358 403 0 )); -DATA(insert ( 434 1082 1184 2 s 2359 403 0 )); -DATA(insert ( 434 1082 1184 3 s 2360 403 0 )); -DATA(insert ( 434 1082 1184 4 s 2361 403 0 )); -DATA(insert ( 434 1082 1184 5 s 2362 403 0 )); -/* default operators timestamp */ -DATA(insert ( 434 1114 1114 1 s 2062 403 0 )); -DATA(insert ( 434 1114 1114 2 s 2063 403 0 )); -DATA(insert ( 434 1114 1114 3 s 2060 403 0 )); -DATA(insert ( 434 1114 1114 4 s 2065 403 0 )); -DATA(insert ( 434 1114 1114 5 s 2064 403 0 )); -/* crosstype operators vs date */ -DATA(insert ( 434 1114 1082 1 s 2371 403 0 )); -DATA(insert ( 434 1114 1082 2 s 2372 403 0 )); -DATA(insert ( 434 1114 1082 3 s 2373 403 0 )); -DATA(insert ( 434 1114 1082 4 s 2374 403 0 )); -DATA(insert ( 434 1114 1082 5 s 2375 403 0 )); -/* crosstype operators vs timestamptz */ -DATA(insert ( 434 1114 1184 1 s 2534 403 0 )); -DATA(insert ( 434 1114 1184 2 s 2535 403 0 )); -DATA(insert ( 434 1114 1184 3 s 2536 403 0 )); -DATA(insert ( 434 1114 1184 4 s 2537 403 0 )); -DATA(insert ( 434 1114 1184 5 s 2538 403 0 )); -/* default operators timestamptz */ -DATA(insert ( 434 1184 1184 1 s 1322 403 0 )); -DATA(insert ( 434 1184 1184 2 s 1323 403 0 )); -DATA(insert ( 434 1184 1184 3 s 1320 403 0 )); -DATA(insert ( 434 1184 1184 4 s 1325 403 0 )); -DATA(insert ( 434 1184 1184 5 s 1324 403 0 )); -/* crosstype operators vs date */ -DATA(insert ( 434 1184 1082 1 s 2384 403 0 )); -DATA(insert ( 434 1184 1082 2 s 2385 403 0 )); -DATA(insert ( 434 1184 1082 3 s 2386 403 0 )); -DATA(insert ( 434 1184 1082 4 s 2387 403 0 )); -DATA(insert ( 434 1184 1082 5 s 2388 403 0 )); -/* crosstype operators vs timestamp */ -DATA(insert ( 434 1184 1114 1 s 2540 403 0 )); -DATA(insert ( 434 1184 1114 2 s 2541 403 0 )); -DATA(insert ( 434 1184 1114 3 s 2542 403 0 )); -DATA(insert ( 434 1184 1114 4 s 2543 403 0 )); -DATA(insert ( 434 1184 1114 5 s 2544 403 0 )); - -/* - * btree time_ops - */ - -DATA(insert ( 1996 1083 1083 1 s 1110 403 0 )); -DATA(insert ( 1996 1083 1083 2 s 1111 403 0 )); -DATA(insert ( 1996 1083 1083 3 s 1108 403 0 )); -DATA(insert ( 1996 1083 1083 4 s 1113 403 0 )); -DATA(insert ( 1996 1083 1083 5 s 1112 403 0 )); - -/* - * btree timetz_ops - */ - -DATA(insert ( 2000 1266 1266 1 s 1552 403 0 )); -DATA(insert ( 2000 1266 1266 2 s 1553 403 0 )); -DATA(insert ( 2000 1266 1266 3 s 1550 403 0 )); -DATA(insert ( 2000 1266 1266 4 s 1555 403 0 )); -DATA(insert ( 2000 1266 1266 5 s 1554 403 0 )); - -/* - * btree interval_ops - */ - -DATA(insert ( 1982 1186 1186 1 s 1332 403 0 )); -DATA(insert ( 1982 1186 1186 2 s 1333 403 0 )); -DATA(insert ( 1982 1186 1186 3 s 1330 403 0 )); -DATA(insert ( 1982 1186 1186 4 s 1335 403 0 )); -DATA(insert ( 1982 1186 1186 5 s 1334 403 0 )); - -/* - * btree macaddr - */ - -DATA(insert ( 1984 829 829 1 s 1222 403 0 )); -DATA(insert ( 1984 829 829 2 s 1223 403 0 )); -DATA(insert ( 1984 829 829 3 s 1220 403 0 )); -DATA(insert ( 1984 829 829 4 s 1225 403 0 )); -DATA(insert ( 1984 829 829 5 s 1224 403 0 )); - -/* - * btree macaddr8 - */ - -DATA(insert ( 3371 774 774 1 s 3364 403 0 )); -DATA(insert ( 3371 774 774 2 s 3365 403 0 )); -DATA(insert ( 3371 774 774 3 s 3362 403 0 )); -DATA(insert ( 3371 774 774 4 s 3367 403 0 )); -DATA(insert ( 3371 774 774 5 s 3366 403 0 )); - -/* - * btree network - */ - -DATA(insert ( 1974 869 869 1 s 1203 403 0 )); -DATA(insert ( 1974 869 869 2 s 1204 403 0 )); -DATA(insert ( 1974 869 869 3 s 1201 403 0 )); -DATA(insert ( 1974 869 869 4 s 1206 403 0 )); -DATA(insert ( 1974 869 869 5 s 1205 403 0 )); - -/* - * btree numeric - */ - -DATA(insert ( 1988 1700 1700 1 s 1754 403 0 )); -DATA(insert ( 1988 1700 1700 2 s 1755 403 0 )); -DATA(insert ( 1988 1700 1700 3 s 1752 403 0 )); -DATA(insert ( 1988 1700 1700 4 s 1757 403 0 )); -DATA(insert ( 1988 1700 1700 5 s 1756 403 0 )); - -/* - * btree bool - */ - -DATA(insert ( 424 16 16 1 s 58 403 0 )); -DATA(insert ( 424 16 16 2 s 1694 403 0 )); -DATA(insert ( 424 16 16 3 s 91 403 0 )); -DATA(insert ( 424 16 16 4 s 1695 403 0 )); -DATA(insert ( 424 16 16 5 s 59 403 0 )); - -/* - * btree bit - */ - -DATA(insert ( 423 1560 1560 1 s 1786 403 0 )); -DATA(insert ( 423 1560 1560 2 s 1788 403 0 )); -DATA(insert ( 423 1560 1560 3 s 1784 403 0 )); -DATA(insert ( 423 1560 1560 4 s 1789 403 0 )); -DATA(insert ( 423 1560 1560 5 s 1787 403 0 )); - -/* - * btree varbit - */ - -DATA(insert ( 2002 1562 1562 1 s 1806 403 0 )); -DATA(insert ( 2002 1562 1562 2 s 1808 403 0 )); -DATA(insert ( 2002 1562 1562 3 s 1804 403 0 )); -DATA(insert ( 2002 1562 1562 4 s 1809 403 0 )); -DATA(insert ( 2002 1562 1562 5 s 1807 403 0 )); - -/* - * btree text pattern - */ - -DATA(insert ( 2095 25 25 1 s 2314 403 0 )); -DATA(insert ( 2095 25 25 2 s 2315 403 0 )); -DATA(insert ( 2095 25 25 3 s 98 403 0 )); -DATA(insert ( 2095 25 25 4 s 2317 403 0 )); -DATA(insert ( 2095 25 25 5 s 2318 403 0 )); + /* the index opfamily this entry is for */ + Oid amopfamily BKI_LOOKUP(pg_opfamily); -/* - * btree bpchar pattern - */ - -DATA(insert ( 2097 1042 1042 1 s 2326 403 0 )); -DATA(insert ( 2097 1042 1042 2 s 2327 403 0 )); -DATA(insert ( 2097 1042 1042 3 s 1054 403 0 )); -DATA(insert ( 2097 1042 1042 4 s 2329 403 0 )); -DATA(insert ( 2097 1042 1042 5 s 2330 403 0 )); - -/* - * btree money_ops - */ - -DATA(insert ( 2099 790 790 1 s 902 403 0 )); -DATA(insert ( 2099 790 790 2 s 904 403 0 )); -DATA(insert ( 2099 790 790 3 s 900 403 0 )); -DATA(insert ( 2099 790 790 4 s 905 403 0 )); -DATA(insert ( 2099 790 790 5 s 903 403 0 )); - -/* - * btree reltime_ops - */ - -DATA(insert ( 2233 703 703 1 s 568 403 0 )); -DATA(insert ( 2233 703 703 2 s 570 403 0 )); -DATA(insert ( 2233 703 703 3 s 566 403 0 )); -DATA(insert ( 2233 703 703 4 s 571 403 0 )); -DATA(insert ( 2233 703 703 5 s 569 403 0 )); - -/* - * btree tinterval_ops - */ - -DATA(insert ( 2234 704 704 1 s 813 403 0 )); -DATA(insert ( 2234 704 704 2 s 815 403 0 )); -DATA(insert ( 2234 704 704 3 s 811 403 0 )); -DATA(insert ( 2234 704 704 4 s 816 403 0 )); -DATA(insert ( 2234 704 704 5 s 814 403 0 )); - -/* - * btree array_ops - */ - -DATA(insert ( 397 2277 2277 1 s 1072 403 0 )); -DATA(insert ( 397 2277 2277 2 s 1074 403 0 )); -DATA(insert ( 397 2277 2277 3 s 1070 403 0 )); -DATA(insert ( 397 2277 2277 4 s 1075 403 0 )); -DATA(insert ( 397 2277 2277 5 s 1073 403 0 )); - -/* - * btree record_ops - */ - -DATA(insert ( 2994 2249 2249 1 s 2990 403 0 )); -DATA(insert ( 2994 2249 2249 2 s 2992 403 0 )); -DATA(insert ( 2994 2249 2249 3 s 2988 403 0 )); -DATA(insert ( 2994 2249 2249 4 s 2993 403 0 )); -DATA(insert ( 2994 2249 2249 5 s 2991 403 0 )); - -/* - * btree record_image_ops - */ - -DATA(insert ( 3194 2249 2249 1 s 3190 403 0 )); -DATA(insert ( 3194 2249 2249 2 s 3192 403 0 )); -DATA(insert ( 3194 2249 2249 3 s 3188 403 0 )); -DATA(insert ( 3194 2249 2249 4 s 3193 403 0 )); -DATA(insert ( 3194 2249 2249 5 s 3191 403 0 )); - -/* - * btree uuid_ops - */ - -DATA(insert ( 2968 2950 2950 1 s 2974 403 0 )); -DATA(insert ( 2968 2950 2950 2 s 2976 403 0 )); -DATA(insert ( 2968 2950 2950 3 s 2972 403 0 )); -DATA(insert ( 2968 2950 2950 4 s 2977 403 0 )); -DATA(insert ( 2968 2950 2950 5 s 2975 403 0 )); - -/* - * btree pg_lsn_ops - */ - -DATA(insert ( 3253 3220 3220 1 s 3224 403 0 )); -DATA(insert ( 3253 3220 3220 2 s 3226 403 0 )); -DATA(insert ( 3253 3220 3220 3 s 3222 403 0 )); -DATA(insert ( 3253 3220 3220 4 s 3227 403 0 )); -DATA(insert ( 3253 3220 3220 5 s 3225 403 0 )); - -/* - * hash index _ops - */ - -/* bpchar_ops */ -DATA(insert ( 427 1042 1042 1 s 1054 405 0 )); -/* char_ops */ -DATA(insert ( 431 18 18 1 s 92 405 0 )); -/* date_ops */ -DATA(insert ( 435 1082 1082 1 s 1093 405 0 )); -/* float_ops */ -DATA(insert ( 1971 700 700 1 s 620 405 0 )); -DATA(insert ( 1971 701 701 1 s 670 405 0 )); -DATA(insert ( 1971 700 701 1 s 1120 405 0 )); -DATA(insert ( 1971 701 700 1 s 1130 405 0 )); -/* network_ops */ -DATA(insert ( 1975 869 869 1 s 1201 405 0 )); -/* integer_ops */ -DATA(insert ( 1977 21 21 1 s 94 405 0 )); -DATA(insert ( 1977 23 23 1 s 96 405 0 )); -DATA(insert ( 1977 20 20 1 s 410 405 0 )); -DATA(insert ( 1977 21 23 1 s 532 405 0 )); -DATA(insert ( 1977 21 20 1 s 1862 405 0 )); -DATA(insert ( 1977 23 21 1 s 533 405 0 )); -DATA(insert ( 1977 23 20 1 s 15 405 0 )); -DATA(insert ( 1977 20 21 1 s 1868 405 0 )); -DATA(insert ( 1977 20 23 1 s 416 405 0 )); -/* interval_ops */ -DATA(insert ( 1983 1186 1186 1 s 1330 405 0 )); -/* macaddr_ops */ -DATA(insert ( 1985 829 829 1 s 1220 405 0 )); -/* macaddr8_ops */ -DATA(insert ( 3372 774 774 1 s 3362 405 0 )); -/* name_ops */ -DATA(insert ( 1987 19 19 1 s 93 405 0 )); -/* oid_ops */ -DATA(insert ( 1990 26 26 1 s 607 405 0 )); -/* oidvector_ops */ -DATA(insert ( 1992 30 30 1 s 649 405 0 )); -/* text_ops */ -DATA(insert ( 1995 25 25 1 s 98 405 0 )); -/* time_ops */ -DATA(insert ( 1997 1083 1083 1 s 1108 405 0 )); -/* timestamptz_ops */ -DATA(insert ( 1999 1184 1184 1 s 1320 405 0 )); -/* timetz_ops */ -DATA(insert ( 2001 1266 1266 1 s 1550 405 0 )); -/* timestamp_ops */ -DATA(insert ( 2040 1114 1114 1 s 2060 405 0 )); -/* bool_ops */ -DATA(insert ( 2222 16 16 1 s 91 405 0 )); -/* bytea_ops */ -DATA(insert ( 2223 17 17 1 s 1955 405 0 )); -/* xid_ops */ -DATA(insert ( 2225 28 28 1 s 352 405 0 )); -/* cid_ops */ -DATA(insert ( 2226 29 29 1 s 385 405 0 )); -/* abstime_ops */ -DATA(insert ( 2227 702 702 1 s 560 405 0 )); -/* reltime_ops */ -DATA(insert ( 2228 703 703 1 s 566 405 0 )); -/* text_pattern_ops */ -DATA(insert ( 2229 25 25 1 s 98 405 0 )); -/* bpchar_pattern_ops */ -DATA(insert ( 2231 1042 1042 1 s 1054 405 0 )); -/* aclitem_ops */ -DATA(insert ( 2235 1033 1033 1 s 974 405 0 )); -/* uuid_ops */ -DATA(insert ( 2969 2950 2950 1 s 2972 405 0 )); -/* pg_lsn_ops */ -DATA(insert ( 3254 3220 3220 1 s 3222 405 0 )); -/* numeric_ops */ -DATA(insert ( 1998 1700 1700 1 s 1752 405 0 )); -/* array_ops */ -DATA(insert ( 627 2277 2277 1 s 1070 405 0 )); - - -/* - * gist box_ops - */ - -DATA(insert ( 2593 603 603 1 s 493 783 0 )); -DATA(insert ( 2593 603 603 2 s 494 783 0 )); -DATA(insert ( 2593 603 603 3 s 500 783 0 )); -DATA(insert ( 2593 603 603 4 s 495 783 0 )); -DATA(insert ( 2593 603 603 5 s 496 783 0 )); -DATA(insert ( 2593 603 603 6 s 499 783 0 )); -DATA(insert ( 2593 603 603 7 s 498 783 0 )); -DATA(insert ( 2593 603 603 8 s 497 783 0 )); -DATA(insert ( 2593 603 603 9 s 2571 783 0 )); -DATA(insert ( 2593 603 603 10 s 2570 783 0 )); -DATA(insert ( 2593 603 603 11 s 2573 783 0 )); -DATA(insert ( 2593 603 603 12 s 2572 783 0 )); -DATA(insert ( 2593 603 603 13 s 2863 783 0 )); -DATA(insert ( 2593 603 603 14 s 2862 783 0 )); - -/* - * gist point_ops - */ -DATA(insert ( 1029 600 600 11 s 506 783 0 )); -DATA(insert ( 1029 600 600 1 s 507 783 0 )); -DATA(insert ( 1029 600 600 5 s 508 783 0 )); -DATA(insert ( 1029 600 600 10 s 509 783 0 )); -DATA(insert ( 1029 600 600 6 s 510 783 0 )); -DATA(insert ( 1029 600 600 15 o 517 783 1970 )); -DATA(insert ( 1029 600 603 28 s 511 783 0 )); -DATA(insert ( 1029 600 604 48 s 756 783 0 )); -DATA(insert ( 1029 600 718 68 s 758 783 0 )); - - -/* - * gist poly_ops (supports polygons) - */ - -DATA(insert ( 2594 604 604 1 s 485 783 0 )); -DATA(insert ( 2594 604 604 2 s 486 783 0 )); -DATA(insert ( 2594 604 604 3 s 492 783 0 )); -DATA(insert ( 2594 604 604 4 s 487 783 0 )); -DATA(insert ( 2594 604 604 5 s 488 783 0 )); -DATA(insert ( 2594 604 604 6 s 491 783 0 )); -DATA(insert ( 2594 604 604 7 s 490 783 0 )); -DATA(insert ( 2594 604 604 8 s 489 783 0 )); -DATA(insert ( 2594 604 604 9 s 2575 783 0 )); -DATA(insert ( 2594 604 604 10 s 2574 783 0 )); -DATA(insert ( 2594 604 604 11 s 2577 783 0 )); -DATA(insert ( 2594 604 604 12 s 2576 783 0 )); -DATA(insert ( 2594 604 604 13 s 2861 783 0 )); -DATA(insert ( 2594 604 604 14 s 2860 783 0 )); -DATA(insert ( 2594 604 600 15 o 3289 783 1970 )); - -/* - * gist circle_ops - */ - -DATA(insert ( 2595 718 718 1 s 1506 783 0 )); -DATA(insert ( 2595 718 718 2 s 1507 783 0 )); -DATA(insert ( 2595 718 718 3 s 1513 783 0 )); -DATA(insert ( 2595 718 718 4 s 1508 783 0 )); -DATA(insert ( 2595 718 718 5 s 1509 783 0 )); -DATA(insert ( 2595 718 718 6 s 1512 783 0 )); -DATA(insert ( 2595 718 718 7 s 1511 783 0 )); -DATA(insert ( 2595 718 718 8 s 1510 783 0 )); -DATA(insert ( 2595 718 718 9 s 2589 783 0 )); -DATA(insert ( 2595 718 718 10 s 1515 783 0 )); -DATA(insert ( 2595 718 718 11 s 1514 783 0 )); -DATA(insert ( 2595 718 718 12 s 2590 783 0 )); -DATA(insert ( 2595 718 718 13 s 2865 783 0 )); -DATA(insert ( 2595 718 718 14 s 2864 783 0 )); -DATA(insert ( 2595 718 600 15 o 3291 783 1970 )); - -/* - * gin array_ops - */ -DATA(insert ( 2745 2277 2277 1 s 2750 2742 0 )); -DATA(insert ( 2745 2277 2277 2 s 2751 2742 0 )); -DATA(insert ( 2745 2277 2277 3 s 2752 2742 0 )); -DATA(insert ( 2745 2277 2277 4 s 1070 2742 0 )); - -/* - * btree enum_ops - */ -DATA(insert ( 3522 3500 3500 1 s 3518 403 0 )); -DATA(insert ( 3522 3500 3500 2 s 3520 403 0 )); -DATA(insert ( 3522 3500 3500 3 s 3516 403 0 )); -DATA(insert ( 3522 3500 3500 4 s 3521 403 0 )); -DATA(insert ( 3522 3500 3500 5 s 3519 403 0 )); - -/* - * hash enum_ops - */ -DATA(insert ( 3523 3500 3500 1 s 3516 405 0 )); - -/* - * btree tsvector_ops - */ -DATA(insert ( 3626 3614 3614 1 s 3627 403 0 )); -DATA(insert ( 3626 3614 3614 2 s 3628 403 0 )); -DATA(insert ( 3626 3614 3614 3 s 3629 403 0 )); -DATA(insert ( 3626 3614 3614 4 s 3631 403 0 )); -DATA(insert ( 3626 3614 3614 5 s 3632 403 0 )); - -/* - * GiST tsvector_ops - */ -DATA(insert ( 3655 3614 3615 1 s 3636 783 0 )); + /* operator's left input data type */ + Oid amoplefttype BKI_LOOKUP(pg_type); -/* - * GIN tsvector_ops - */ -DATA(insert ( 3659 3614 3615 1 s 3636 2742 0 )); -DATA(insert ( 3659 3614 3615 2 s 3660 2742 0 )); + /* operator's right input data type */ + Oid amoprighttype BKI_LOOKUP(pg_type); -/* - * btree tsquery_ops - */ -DATA(insert ( 3683 3615 3615 1 s 3674 403 0 )); -DATA(insert ( 3683 3615 3615 2 s 3675 403 0 )); -DATA(insert ( 3683 3615 3615 3 s 3676 403 0 )); -DATA(insert ( 3683 3615 3615 4 s 3678 403 0 )); -DATA(insert ( 3683 3615 3615 5 s 3679 403 0 )); + /* operator strategy number */ + int16 amopstrategy; -/* - * GiST tsquery_ops - */ -DATA(insert ( 3702 3615 3615 7 s 3693 783 0 )); -DATA(insert ( 3702 3615 3615 8 s 3694 783 0 )); + /* is operator for 's'earch or 'o'rdering? */ + char amoppurpose BKI_DEFAULT(s); -/* - * btree range_ops - */ -DATA(insert ( 3901 3831 3831 1 s 3884 403 0 )); -DATA(insert ( 3901 3831 3831 2 s 3885 403 0 )); -DATA(insert ( 3901 3831 3831 3 s 3882 403 0 )); -DATA(insert ( 3901 3831 3831 4 s 3886 403 0 )); -DATA(insert ( 3901 3831 3831 5 s 3887 403 0 )); + /* the operator's pg_operator OID */ + Oid amopopr BKI_LOOKUP(pg_operator); -/* - * hash range_ops - */ -DATA(insert ( 3903 3831 3831 1 s 3882 405 0 )); + /* the index access method this entry is for */ + Oid amopmethod BKI_LOOKUP(pg_am); -/* - * GiST range_ops - */ -DATA(insert ( 3919 3831 3831 1 s 3893 783 0 )); -DATA(insert ( 3919 3831 3831 2 s 3895 783 0 )); -DATA(insert ( 3919 3831 3831 3 s 3888 783 0 )); -DATA(insert ( 3919 3831 3831 4 s 3896 783 0 )); -DATA(insert ( 3919 3831 3831 5 s 3894 783 0 )); -DATA(insert ( 3919 3831 3831 6 s 3897 783 0 )); -DATA(insert ( 3919 3831 3831 7 s 3890 783 0 )); -DATA(insert ( 3919 3831 3831 8 s 3892 783 0 )); -DATA(insert ( 3919 3831 2283 16 s 3889 783 0 )); -DATA(insert ( 3919 3831 3831 18 s 3882 783 0 )); - -/* - * SP-GiST quad_point_ops - */ -DATA(insert ( 4015 600 600 11 s 506 4000 0 )); -DATA(insert ( 4015 600 600 1 s 507 4000 0 )); -DATA(insert ( 4015 600 600 5 s 508 4000 0 )); -DATA(insert ( 4015 600 600 10 s 509 4000 0 )); -DATA(insert ( 4015 600 600 6 s 510 4000 0 )); -DATA(insert ( 4015 600 603 8 s 511 4000 0 )); - -/* - * SP-GiST kd_point_ops - */ -DATA(insert ( 4016 600 600 11 s 506 4000 0 )); -DATA(insert ( 4016 600 600 1 s 507 4000 0 )); -DATA(insert ( 4016 600 600 5 s 508 4000 0 )); -DATA(insert ( 4016 600 600 10 s 509 4000 0 )); -DATA(insert ( 4016 600 600 6 s 510 4000 0 )); -DATA(insert ( 4016 600 603 8 s 511 4000 0 )); - -/* - * SP-GiST text_ops - */ -DATA(insert ( 4017 25 25 1 s 2314 4000 0 )); -DATA(insert ( 4017 25 25 2 s 2315 4000 0 )); -DATA(insert ( 4017 25 25 3 s 98 4000 0 )); -DATA(insert ( 4017 25 25 4 s 2317 4000 0 )); -DATA(insert ( 4017 25 25 5 s 2318 4000 0 )); -DATA(insert ( 4017 25 25 11 s 664 4000 0 )); -DATA(insert ( 4017 25 25 12 s 665 4000 0 )); -DATA(insert ( 4017 25 25 14 s 667 4000 0 )); -DATA(insert ( 4017 25 25 15 s 666 4000 0 )); -DATA(insert ( 4017 25 25 28 s 3877 4000 0 )); - -/* - * btree jsonb_ops - */ -DATA(insert ( 4033 3802 3802 1 s 3242 403 0 )); -DATA(insert ( 4033 3802 3802 2 s 3244 403 0 )); -DATA(insert ( 4033 3802 3802 3 s 3240 403 0 )); -DATA(insert ( 4033 3802 3802 4 s 3245 403 0 )); -DATA(insert ( 4033 3802 3802 5 s 3243 403 0 )); - -/* - * hash jsonb_ops - */ -DATA(insert ( 4034 3802 3802 1 s 3240 405 0 )); - -/* - * GIN jsonb_ops - */ -DATA(insert ( 4036 3802 3802 7 s 3246 2742 0 )); -DATA(insert ( 4036 3802 25 9 s 3247 2742 0 )); -DATA(insert ( 4036 3802 1009 10 s 3248 2742 0 )); -DATA(insert ( 4036 3802 1009 11 s 3249 2742 0 )); - -/* - * GIN jsonb_path_ops - */ -DATA(insert ( 4037 3802 3802 7 s 3246 2742 0 )); - -/* - * SP-GiST range_ops - */ -DATA(insert ( 3474 3831 3831 1 s 3893 4000 0 )); -DATA(insert ( 3474 3831 3831 2 s 3895 4000 0 )); -DATA(insert ( 3474 3831 3831 3 s 3888 4000 0 )); -DATA(insert ( 3474 3831 3831 4 s 3896 4000 0 )); -DATA(insert ( 3474 3831 3831 5 s 3894 4000 0 )); -DATA(insert ( 3474 3831 3831 6 s 3897 4000 0 )); -DATA(insert ( 3474 3831 3831 7 s 3890 4000 0 )); -DATA(insert ( 3474 3831 3831 8 s 3892 4000 0 )); -DATA(insert ( 3474 3831 2283 16 s 3889 4000 0 )); -DATA(insert ( 3474 3831 3831 18 s 3882 4000 0 )); - -/* - * SP-GiST box_ops - */ -DATA(insert ( 5000 603 603 1 s 493 4000 0 )); -DATA(insert ( 5000 603 603 2 s 494 4000 0 )); -DATA(insert ( 5000 603 603 3 s 500 4000 0 )); -DATA(insert ( 5000 603 603 4 s 495 4000 0 )); -DATA(insert ( 5000 603 603 5 s 496 4000 0 )); -DATA(insert ( 5000 603 603 6 s 499 4000 0 )); -DATA(insert ( 5000 603 603 7 s 498 4000 0 )); -DATA(insert ( 5000 603 603 8 s 497 4000 0 )); -DATA(insert ( 5000 603 603 9 s 2571 4000 0 )); -DATA(insert ( 5000 603 603 10 s 2570 4000 0 )); -DATA(insert ( 5000 603 603 11 s 2573 4000 0 )); -DATA(insert ( 5000 603 603 12 s 2572 4000 0 )); - -/* - * SP-GiST poly_ops (supports polygons) - */ -DATA(insert ( 5008 604 604 1 s 485 4000 0 )); -DATA(insert ( 5008 604 604 2 s 486 4000 0 )); -DATA(insert ( 5008 604 604 3 s 492 4000 0 )); -DATA(insert ( 5008 604 604 4 s 487 4000 0 )); -DATA(insert ( 5008 604 604 5 s 488 4000 0 )); -DATA(insert ( 5008 604 604 6 s 491 4000 0 )); -DATA(insert ( 5008 604 604 7 s 490 4000 0 )); -DATA(insert ( 5008 604 604 8 s 489 4000 0 )); -DATA(insert ( 5008 604 604 9 s 2575 4000 0 )); -DATA(insert ( 5008 604 604 10 s 2574 4000 0 )); -DATA(insert ( 5008 604 604 11 s 2577 4000 0 )); -DATA(insert ( 5008 604 604 12 s 2576 4000 0 )); - -/* - * GiST inet_ops - */ -DATA(insert ( 3550 869 869 3 s 3552 783 0 )); -DATA(insert ( 3550 869 869 18 s 1201 783 0 )); -DATA(insert ( 3550 869 869 19 s 1202 783 0 )); -DATA(insert ( 3550 869 869 20 s 1203 783 0 )); -DATA(insert ( 3550 869 869 21 s 1204 783 0 )); -DATA(insert ( 3550 869 869 22 s 1205 783 0 )); -DATA(insert ( 3550 869 869 23 s 1206 783 0 )); -DATA(insert ( 3550 869 869 24 s 931 783 0 )); -DATA(insert ( 3550 869 869 25 s 932 783 0 )); -DATA(insert ( 3550 869 869 26 s 933 783 0 )); -DATA(insert ( 3550 869 869 27 s 934 783 0 )); + /* ordering opfamily OID, or 0 if search op */ + Oid amopsortfamily BKI_DEFAULT(0) BKI_LOOKUP(pg_opfamily); +} FormData_pg_amop; -/* - * SP-GiST inet_ops +/* ---------------- + * Form_pg_amop corresponds to a pointer to a tuple with + * the format of pg_amop relation. + * ---------------- */ -DATA(insert ( 3794 869 869 3 s 3552 4000 0 )); -DATA(insert ( 3794 869 869 18 s 1201 4000 0 )); -DATA(insert ( 3794 869 869 19 s 1202 4000 0 )); -DATA(insert ( 3794 869 869 20 s 1203 4000 0 )); -DATA(insert ( 3794 869 869 21 s 1204 4000 0 )); -DATA(insert ( 3794 869 869 22 s 1205 4000 0 )); -DATA(insert ( 3794 869 869 23 s 1206 4000 0 )); -DATA(insert ( 3794 869 869 24 s 931 4000 0 )); -DATA(insert ( 3794 869 869 25 s 932 4000 0 )); -DATA(insert ( 3794 869 869 26 s 933 4000 0 )); -DATA(insert ( 3794 869 869 27 s 934 4000 0 )); - -/* BRIN opclasses */ -/* minmax bytea */ -DATA(insert ( 4064 17 17 1 s 1957 3580 0 )); -DATA(insert ( 4064 17 17 2 s 1958 3580 0 )); -DATA(insert ( 4064 17 17 3 s 1955 3580 0 )); -DATA(insert ( 4064 17 17 4 s 1960 3580 0 )); -DATA(insert ( 4064 17 17 5 s 1959 3580 0 )); -/* minmax "char" */ -DATA(insert ( 4062 18 18 1 s 631 3580 0 )); -DATA(insert ( 4062 18 18 2 s 632 3580 0 )); -DATA(insert ( 4062 18 18 3 s 92 3580 0 )); -DATA(insert ( 4062 18 18 4 s 634 3580 0 )); -DATA(insert ( 4062 18 18 5 s 633 3580 0 )); -/* minmax name */ -DATA(insert ( 4065 19 19 1 s 660 3580 0 )); -DATA(insert ( 4065 19 19 2 s 661 3580 0 )); -DATA(insert ( 4065 19 19 3 s 93 3580 0 )); -DATA(insert ( 4065 19 19 4 s 663 3580 0 )); -DATA(insert ( 4065 19 19 5 s 662 3580 0 )); -/* minmax integer */ -DATA(insert ( 4054 20 20 1 s 412 3580 0 )); -DATA(insert ( 4054 20 20 2 s 414 3580 0 )); -DATA(insert ( 4054 20 20 3 s 410 3580 0 )); -DATA(insert ( 4054 20 20 4 s 415 3580 0 )); -DATA(insert ( 4054 20 20 5 s 413 3580 0 )); -DATA(insert ( 4054 20 21 1 s 1870 3580 0 )); -DATA(insert ( 4054 20 21 2 s 1872 3580 0 )); -DATA(insert ( 4054 20 21 3 s 1868 3580 0 )); -DATA(insert ( 4054 20 21 4 s 1873 3580 0 )); -DATA(insert ( 4054 20 21 5 s 1871 3580 0 )); -DATA(insert ( 4054 20 23 1 s 418 3580 0 )); -DATA(insert ( 4054 20 23 2 s 420 3580 0 )); -DATA(insert ( 4054 20 23 3 s 416 3580 0 )); -DATA(insert ( 4054 20 23 4 s 430 3580 0 )); -DATA(insert ( 4054 20 23 5 s 419 3580 0 )); -DATA(insert ( 4054 21 21 1 s 95 3580 0 )); -DATA(insert ( 4054 21 21 2 s 522 3580 0 )); -DATA(insert ( 4054 21 21 3 s 94 3580 0 )); -DATA(insert ( 4054 21 21 4 s 524 3580 0 )); -DATA(insert ( 4054 21 21 5 s 520 3580 0 )); -DATA(insert ( 4054 21 20 1 s 1864 3580 0 )); -DATA(insert ( 4054 21 20 2 s 1866 3580 0 )); -DATA(insert ( 4054 21 20 3 s 1862 3580 0 )); -DATA(insert ( 4054 21 20 4 s 1867 3580 0 )); -DATA(insert ( 4054 21 20 5 s 1865 3580 0 )); -DATA(insert ( 4054 21 23 1 s 534 3580 0 )); -DATA(insert ( 4054 21 23 2 s 540 3580 0 )); -DATA(insert ( 4054 21 23 3 s 532 3580 0 )); -DATA(insert ( 4054 21 23 4 s 542 3580 0 )); -DATA(insert ( 4054 21 23 5 s 536 3580 0 )); -DATA(insert ( 4054 23 23 1 s 97 3580 0 )); -DATA(insert ( 4054 23 23 2 s 523 3580 0 )); -DATA(insert ( 4054 23 23 3 s 96 3580 0 )); -DATA(insert ( 4054 23 23 4 s 525 3580 0 )); -DATA(insert ( 4054 23 23 5 s 521 3580 0 )); -DATA(insert ( 4054 23 21 1 s 535 3580 0 )); -DATA(insert ( 4054 23 21 2 s 541 3580 0 )); -DATA(insert ( 4054 23 21 3 s 533 3580 0 )); -DATA(insert ( 4054 23 21 4 s 543 3580 0 )); -DATA(insert ( 4054 23 21 5 s 537 3580 0 )); -DATA(insert ( 4054 23 20 1 s 37 3580 0 )); -DATA(insert ( 4054 23 20 2 s 80 3580 0 )); -DATA(insert ( 4054 23 20 3 s 15 3580 0 )); -DATA(insert ( 4054 23 20 4 s 82 3580 0 )); -DATA(insert ( 4054 23 20 5 s 76 3580 0 )); +typedef FormData_pg_amop *Form_pg_amop; -/* minmax text */ -DATA(insert ( 4056 25 25 1 s 664 3580 0 )); -DATA(insert ( 4056 25 25 2 s 665 3580 0 )); -DATA(insert ( 4056 25 25 3 s 98 3580 0 )); -DATA(insert ( 4056 25 25 4 s 667 3580 0 )); -DATA(insert ( 4056 25 25 5 s 666 3580 0 )); -/* minmax oid */ -DATA(insert ( 4068 26 26 1 s 609 3580 0 )); -DATA(insert ( 4068 26 26 2 s 611 3580 0 )); -DATA(insert ( 4068 26 26 3 s 607 3580 0 )); -DATA(insert ( 4068 26 26 4 s 612 3580 0 )); -DATA(insert ( 4068 26 26 5 s 610 3580 0 )); -/* minmax tid */ -DATA(insert ( 4069 27 27 1 s 2799 3580 0 )); -DATA(insert ( 4069 27 27 2 s 2801 3580 0 )); -DATA(insert ( 4069 27 27 3 s 387 3580 0 )); -DATA(insert ( 4069 27 27 4 s 2802 3580 0 )); -DATA(insert ( 4069 27 27 5 s 2800 3580 0 )); -/* minmax float (float4, float8) */ -DATA(insert ( 4070 700 700 1 s 622 3580 0 )); -DATA(insert ( 4070 700 700 2 s 624 3580 0 )); -DATA(insert ( 4070 700 700 3 s 620 3580 0 )); -DATA(insert ( 4070 700 700 4 s 625 3580 0 )); -DATA(insert ( 4070 700 700 5 s 623 3580 0 )); -DATA(insert ( 4070 700 701 1 s 1122 3580 0 )); -DATA(insert ( 4070 700 701 2 s 1124 3580 0 )); -DATA(insert ( 4070 700 701 3 s 1120 3580 0 )); -DATA(insert ( 4070 700 701 4 s 1125 3580 0 )); -DATA(insert ( 4070 700 701 5 s 1123 3580 0 )); -DATA(insert ( 4070 701 700 1 s 1132 3580 0 )); -DATA(insert ( 4070 701 700 2 s 1134 3580 0 )); -DATA(insert ( 4070 701 700 3 s 1130 3580 0 )); -DATA(insert ( 4070 701 700 4 s 1135 3580 0 )); -DATA(insert ( 4070 701 700 5 s 1133 3580 0 )); -DATA(insert ( 4070 701 701 1 s 672 3580 0 )); -DATA(insert ( 4070 701 701 2 s 673 3580 0 )); -DATA(insert ( 4070 701 701 3 s 670 3580 0 )); -DATA(insert ( 4070 701 701 4 s 675 3580 0 )); -DATA(insert ( 4070 701 701 5 s 674 3580 0 )); +#ifdef EXPOSE_TO_CLIENT_CODE -/* minmax abstime */ -DATA(insert ( 4072 702 702 1 s 562 3580 0 )); -DATA(insert ( 4072 702 702 2 s 564 3580 0 )); -DATA(insert ( 4072 702 702 3 s 560 3580 0 )); -DATA(insert ( 4072 702 702 4 s 565 3580 0 )); -DATA(insert ( 4072 702 702 5 s 563 3580 0 )); -/* minmax reltime */ -DATA(insert ( 4073 703 703 1 s 568 3580 0 )); -DATA(insert ( 4073 703 703 2 s 570 3580 0 )); -DATA(insert ( 4073 703 703 3 s 566 3580 0 )); -DATA(insert ( 4073 703 703 4 s 571 3580 0 )); -DATA(insert ( 4073 703 703 5 s 569 3580 0 )); -/* minmax macaddr */ -DATA(insert ( 4074 829 829 1 s 1222 3580 0 )); -DATA(insert ( 4074 829 829 2 s 1223 3580 0 )); -DATA(insert ( 4074 829 829 3 s 1220 3580 0 )); -DATA(insert ( 4074 829 829 4 s 1225 3580 0 )); -DATA(insert ( 4074 829 829 5 s 1224 3580 0 )); -/* minmax macaddr8 */ -DATA(insert ( 4109 774 774 1 s 3364 3580 0 )); -DATA(insert ( 4109 774 774 2 s 3365 3580 0 )); -DATA(insert ( 4109 774 774 3 s 3362 3580 0 )); -DATA(insert ( 4109 774 774 4 s 3367 3580 0 )); -DATA(insert ( 4109 774 774 5 s 3366 3580 0 )); -/* minmax inet */ -DATA(insert ( 4075 869 869 1 s 1203 3580 0 )); -DATA(insert ( 4075 869 869 2 s 1204 3580 0 )); -DATA(insert ( 4075 869 869 3 s 1201 3580 0 )); -DATA(insert ( 4075 869 869 4 s 1206 3580 0 )); -DATA(insert ( 4075 869 869 5 s 1205 3580 0 )); -/* inclusion inet */ -DATA(insert ( 4102 869 869 3 s 3552 3580 0 )); -DATA(insert ( 4102 869 869 7 s 934 3580 0 )); -DATA(insert ( 4102 869 869 8 s 932 3580 0 )); -DATA(insert ( 4102 869 869 18 s 1201 3580 0 )); -DATA(insert ( 4102 869 869 24 s 933 3580 0 )); -DATA(insert ( 4102 869 869 26 s 931 3580 0 )); -/* minmax character */ -DATA(insert ( 4076 1042 1042 1 s 1058 3580 0 )); -DATA(insert ( 4076 1042 1042 2 s 1059 3580 0 )); -DATA(insert ( 4076 1042 1042 3 s 1054 3580 0 )); -DATA(insert ( 4076 1042 1042 4 s 1061 3580 0 )); -DATA(insert ( 4076 1042 1042 5 s 1060 3580 0 )); -/* minmax time without time zone */ -DATA(insert ( 4077 1083 1083 1 s 1110 3580 0 )); -DATA(insert ( 4077 1083 1083 2 s 1111 3580 0 )); -DATA(insert ( 4077 1083 1083 3 s 1108 3580 0 )); -DATA(insert ( 4077 1083 1083 4 s 1113 3580 0 )); -DATA(insert ( 4077 1083 1083 5 s 1112 3580 0 )); -/* minmax datetime (date, timestamp, timestamptz) */ -DATA(insert ( 4059 1114 1114 1 s 2062 3580 0 )); -DATA(insert ( 4059 1114 1114 2 s 2063 3580 0 )); -DATA(insert ( 4059 1114 1114 3 s 2060 3580 0 )); -DATA(insert ( 4059 1114 1114 4 s 2065 3580 0 )); -DATA(insert ( 4059 1114 1114 5 s 2064 3580 0 )); -DATA(insert ( 4059 1114 1082 1 s 2371 3580 0 )); -DATA(insert ( 4059 1114 1082 2 s 2372 3580 0 )); -DATA(insert ( 4059 1114 1082 3 s 2373 3580 0 )); -DATA(insert ( 4059 1114 1082 4 s 2374 3580 0 )); -DATA(insert ( 4059 1114 1082 5 s 2375 3580 0 )); -DATA(insert ( 4059 1114 1184 1 s 2534 3580 0 )); -DATA(insert ( 4059 1114 1184 2 s 2535 3580 0 )); -DATA(insert ( 4059 1114 1184 3 s 2536 3580 0 )); -DATA(insert ( 4059 1114 1184 4 s 2537 3580 0 )); -DATA(insert ( 4059 1114 1184 5 s 2538 3580 0 )); -DATA(insert ( 4059 1082 1082 1 s 1095 3580 0 )); -DATA(insert ( 4059 1082 1082 2 s 1096 3580 0 )); -DATA(insert ( 4059 1082 1082 3 s 1093 3580 0 )); -DATA(insert ( 4059 1082 1082 4 s 1098 3580 0 )); -DATA(insert ( 4059 1082 1082 5 s 1097 3580 0 )); -DATA(insert ( 4059 1082 1114 1 s 2345 3580 0 )); -DATA(insert ( 4059 1082 1114 2 s 2346 3580 0 )); -DATA(insert ( 4059 1082 1114 3 s 2347 3580 0 )); -DATA(insert ( 4059 1082 1114 4 s 2348 3580 0 )); -DATA(insert ( 4059 1082 1114 5 s 2349 3580 0 )); -DATA(insert ( 4059 1082 1184 1 s 2358 3580 0 )); -DATA(insert ( 4059 1082 1184 2 s 2359 3580 0 )); -DATA(insert ( 4059 1082 1184 3 s 2360 3580 0 )); -DATA(insert ( 4059 1082 1184 4 s 2361 3580 0 )); -DATA(insert ( 4059 1082 1184 5 s 2362 3580 0 )); -DATA(insert ( 4059 1184 1082 1 s 2384 3580 0 )); -DATA(insert ( 4059 1184 1082 2 s 2385 3580 0 )); -DATA(insert ( 4059 1184 1082 3 s 2386 3580 0 )); -DATA(insert ( 4059 1184 1082 4 s 2387 3580 0 )); -DATA(insert ( 4059 1184 1082 5 s 2388 3580 0 )); -DATA(insert ( 4059 1184 1114 1 s 2540 3580 0 )); -DATA(insert ( 4059 1184 1114 2 s 2541 3580 0 )); -DATA(insert ( 4059 1184 1114 3 s 2542 3580 0 )); -DATA(insert ( 4059 1184 1114 4 s 2543 3580 0 )); -DATA(insert ( 4059 1184 1114 5 s 2544 3580 0 )); -DATA(insert ( 4059 1184 1184 1 s 1322 3580 0 )); -DATA(insert ( 4059 1184 1184 2 s 1323 3580 0 )); -DATA(insert ( 4059 1184 1184 3 s 1320 3580 0 )); -DATA(insert ( 4059 1184 1184 4 s 1325 3580 0 )); -DATA(insert ( 4059 1184 1184 5 s 1324 3580 0 )); +/* allowed values of amoppurpose: */ +#define AMOP_SEARCH 's' /* operator is for search */ +#define AMOP_ORDER 'o' /* operator is for ordering */ -/* minmax interval */ -DATA(insert ( 4078 1186 1186 1 s 1332 3580 0 )); -DATA(insert ( 4078 1186 1186 2 s 1333 3580 0 )); -DATA(insert ( 4078 1186 1186 3 s 1330 3580 0 )); -DATA(insert ( 4078 1186 1186 4 s 1335 3580 0 )); -DATA(insert ( 4078 1186 1186 5 s 1334 3580 0 )); -/* minmax time with time zone */ -DATA(insert ( 4058 1266 1266 1 s 1552 3580 0 )); -DATA(insert ( 4058 1266 1266 2 s 1553 3580 0 )); -DATA(insert ( 4058 1266 1266 3 s 1550 3580 0 )); -DATA(insert ( 4058 1266 1266 4 s 1555 3580 0 )); -DATA(insert ( 4058 1266 1266 5 s 1554 3580 0 )); -/* minmax bit */ -DATA(insert ( 4079 1560 1560 1 s 1786 3580 0 )); -DATA(insert ( 4079 1560 1560 2 s 1788 3580 0 )); -DATA(insert ( 4079 1560 1560 3 s 1784 3580 0 )); -DATA(insert ( 4079 1560 1560 4 s 1789 3580 0 )); -DATA(insert ( 4079 1560 1560 5 s 1787 3580 0 )); -/* minmax bit varying */ -DATA(insert ( 4080 1562 1562 1 s 1806 3580 0 )); -DATA(insert ( 4080 1562 1562 2 s 1808 3580 0 )); -DATA(insert ( 4080 1562 1562 3 s 1804 3580 0 )); -DATA(insert ( 4080 1562 1562 4 s 1809 3580 0 )); -DATA(insert ( 4080 1562 1562 5 s 1807 3580 0 )); -/* minmax numeric */ -DATA(insert ( 4055 1700 1700 1 s 1754 3580 0 )); -DATA(insert ( 4055 1700 1700 2 s 1755 3580 0 )); -DATA(insert ( 4055 1700 1700 3 s 1752 3580 0 )); -DATA(insert ( 4055 1700 1700 4 s 1757 3580 0 )); -DATA(insert ( 4055 1700 1700 5 s 1756 3580 0 )); -/* minmax uuid */ -DATA(insert ( 4081 2950 2950 1 s 2974 3580 0 )); -DATA(insert ( 4081 2950 2950 2 s 2976 3580 0 )); -DATA(insert ( 4081 2950 2950 3 s 2972 3580 0 )); -DATA(insert ( 4081 2950 2950 4 s 2977 3580 0 )); -DATA(insert ( 4081 2950 2950 5 s 2975 3580 0 )); -/* inclusion range types */ -DATA(insert ( 4103 3831 3831 1 s 3893 3580 0 )); -DATA(insert ( 4103 3831 3831 2 s 3895 3580 0 )); -DATA(insert ( 4103 3831 3831 3 s 3888 3580 0 )); -DATA(insert ( 4103 3831 3831 4 s 3896 3580 0 )); -DATA(insert ( 4103 3831 3831 5 s 3894 3580 0 )); -DATA(insert ( 4103 3831 3831 7 s 3890 3580 0 )); -DATA(insert ( 4103 3831 3831 8 s 3892 3580 0 )); -DATA(insert ( 4103 3831 2283 16 s 3889 3580 0 )); -DATA(insert ( 4103 3831 3831 17 s 3897 3580 0 )); -DATA(insert ( 4103 3831 3831 18 s 3882 3580 0 )); -DATA(insert ( 4103 3831 3831 20 s 3884 3580 0 )); -DATA(insert ( 4103 3831 3831 21 s 3885 3580 0 )); -DATA(insert ( 4103 3831 3831 22 s 3887 3580 0 )); -DATA(insert ( 4103 3831 3831 23 s 3886 3580 0 )); -/* minmax pg_lsn */ -DATA(insert ( 4082 3220 3220 1 s 3224 3580 0 )); -DATA(insert ( 4082 3220 3220 2 s 3226 3580 0 )); -DATA(insert ( 4082 3220 3220 3 s 3222 3580 0 )); -DATA(insert ( 4082 3220 3220 4 s 3227 3580 0 )); -DATA(insert ( 4082 3220 3220 5 s 3225 3580 0 )); -/* inclusion box */ -DATA(insert ( 4104 603 603 1 s 493 3580 0 )); -DATA(insert ( 4104 603 603 2 s 494 3580 0 )); -DATA(insert ( 4104 603 603 3 s 500 3580 0 )); -DATA(insert ( 4104 603 603 4 s 495 3580 0 )); -DATA(insert ( 4104 603 603 5 s 496 3580 0 )); -DATA(insert ( 4104 603 603 6 s 499 3580 0 )); -DATA(insert ( 4104 603 603 7 s 498 3580 0 )); -DATA(insert ( 4104 603 603 8 s 497 3580 0 )); -DATA(insert ( 4104 603 603 9 s 2571 3580 0 )); -DATA(insert ( 4104 603 603 10 s 2570 3580 0 )); -DATA(insert ( 4104 603 603 11 s 2573 3580 0 )); -DATA(insert ( 4104 603 603 12 s 2572 3580 0 )); -/* we could, but choose not to, supply entries for strategies 13 and 14 */ -DATA(insert ( 4104 603 600 7 s 433 3580 0 )); +#endif /* EXPOSE_TO_CLIENT_CODE */ #endif /* PG_AMOP_H */ diff --git a/src/include/catalog/pg_amproc.dat b/src/include/catalog/pg_amproc.dat new file mode 100644 index 00000000000..6b6c807f90e --- /dev/null +++ b/src/include/catalog/pg_amproc.dat @@ -0,0 +1,1277 @@ +#---------------------------------------------------------------------- +# +# pg_amproc.dat +# Initial contents of the pg_amproc system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_amproc.dat +# +#---------------------------------------------------------------------- + +[ + +# btree +{ amprocfamily => 'btree/array_ops', amproclefttype => 'anyarray', + amprocrighttype => 'anyarray', amprocnum => '1', amproc => 'btarraycmp' }, +{ amprocfamily => 'btree/abstime_ops', amproclefttype => 'abstime', + amprocrighttype => 'abstime', amprocnum => '1', amproc => 'btabstimecmp' }, +{ amprocfamily => 'btree/bit_ops', amproclefttype => 'bit', + amprocrighttype => 'bit', amprocnum => '1', amproc => 'bitcmp' }, +{ amprocfamily => 'btree/bool_ops', amproclefttype => 'bool', + amprocrighttype => 'bool', amprocnum => '1', amproc => 'btboolcmp' }, +{ amprocfamily => 'btree/bpchar_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '1', amproc => 'bpcharcmp' }, +{ amprocfamily => 'btree/bpchar_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '2', + amproc => 'bpchar_sortsupport' }, +{ amprocfamily => 'btree/bytea_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '1', amproc => 'byteacmp' }, +{ amprocfamily => 'btree/bytea_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '2', amproc => 'bytea_sortsupport' }, +{ amprocfamily => 'btree/char_ops', amproclefttype => 'char', + amprocrighttype => 'char', amprocnum => '1', amproc => 'btcharcmp' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '1', amproc => 'date_cmp' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '2', amproc => 'date_sortsupport' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'date', + amprocrighttype => 'timestamp', amprocnum => '1', + amproc => 'date_cmp_timestamp' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'date', + amprocrighttype => 'timestamptz', amprocnum => '1', + amproc => 'date_cmp_timestamptz' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '1', amproc => 'timestamp_cmp' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '2', + amproc => 'timestamp_sortsupport' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamp', + amprocrighttype => 'date', amprocnum => '1', amproc => 'timestamp_cmp_date' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamptz', amprocnum => '1', + amproc => 'timestamp_cmp_timestamptz' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '1', + amproc => 'timestamptz_cmp' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '2', + amproc => 'timestamp_sortsupport' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'date', amprocnum => '1', + amproc => 'timestamptz_cmp_date' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamp', amprocnum => '1', + amproc => 'timestamptz_cmp_timestamp' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'date', + amprocrighttype => 'interval', amprocnum => '3', + amproc => 'in_range(date,date,interval,bool,bool)' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamp', + amprocrighttype => 'interval', amprocnum => '3', + amproc => 'in_range(timestamp,timestamp,interval,bool,bool)' }, +{ amprocfamily => 'btree/datetime_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'interval', amprocnum => '3', + amproc => 'in_range(timestamptz,timestamptz,interval,bool,bool)' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '1', amproc => 'btfloat4cmp' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '2', + amproc => 'btfloat4sortsupport' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float4', + amprocrighttype => 'float8', amprocnum => '1', amproc => 'btfloat48cmp' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '1', amproc => 'btfloat8cmp' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '2', + amproc => 'btfloat8sortsupport' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float8', + amprocrighttype => 'float4', amprocnum => '1', amproc => 'btfloat84cmp' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '3', + amproc => 'in_range(float8,float8,float8,bool,bool)' }, +{ amprocfamily => 'btree/float_ops', amproclefttype => 'float4', + amprocrighttype => 'float8', amprocnum => '3', + amproc => 'in_range(float4,float4,float8,bool,bool)' }, +{ amprocfamily => 'btree/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '1', amproc => 'network_cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '1', amproc => 'btint2cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '2', amproc => 'btint2sortsupport' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int4', amprocnum => '1', amproc => 'btint24cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int8', amprocnum => '1', amproc => 'btint28cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int8', amprocnum => '3', + amproc => 'in_range(int2,int2,int8,bool,bool)' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int4', amprocnum => '3', + amproc => 'in_range(int2,int2,int4,bool,bool)' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '3', + amproc => 'in_range(int2,int2,int2,bool,bool)' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '1', amproc => 'btint4cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '2', amproc => 'btint4sortsupport' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int8', amprocnum => '1', amproc => 'btint48cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int2', amprocnum => '1', amproc => 'btint42cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int8', amprocnum => '3', + amproc => 'in_range(int4,int4,int8,bool,bool)' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '3', + amproc => 'in_range(int4,int4,int4,bool,bool)' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int2', amprocnum => '3', + amproc => 'in_range(int4,int4,int2,bool,bool)' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '1', amproc => 'btint8cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '2', amproc => 'btint8sortsupport' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int8', + amprocrighttype => 'int4', amprocnum => '1', amproc => 'btint84cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int8', + amprocrighttype => 'int2', amprocnum => '1', amproc => 'btint82cmp' }, +{ amprocfamily => 'btree/integer_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '3', + amproc => 'in_range(int8,int8,int8,bool,bool)' }, +{ amprocfamily => 'btree/interval_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '1', amproc => 'interval_cmp' }, +{ amprocfamily => 'btree/interval_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '3', + amproc => 'in_range(interval,interval,interval,bool,bool)' }, +{ amprocfamily => 'btree/macaddr_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '1', amproc => 'macaddr_cmp' }, +{ amprocfamily => 'btree/macaddr_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '2', + amproc => 'macaddr_sortsupport' }, +{ amprocfamily => 'btree/name_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '1', amproc => 'btnamecmp' }, +{ amprocfamily => 'btree/name_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '2', amproc => 'btnamesortsupport' }, +{ amprocfamily => 'btree/numeric_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '1', amproc => 'numeric_cmp' }, +{ amprocfamily => 'btree/numeric_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '2', + amproc => 'numeric_sortsupport' }, +{ amprocfamily => 'btree/numeric_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '3', + amproc => 'in_range(numeric,numeric,numeric,bool,bool)' }, +{ amprocfamily => 'btree/oid_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '1', amproc => 'btoidcmp' }, +{ amprocfamily => 'btree/oid_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '2', amproc => 'btoidsortsupport' }, +{ amprocfamily => 'btree/oidvector_ops', amproclefttype => 'oidvector', + amprocrighttype => 'oidvector', amprocnum => '1', + amproc => 'btoidvectorcmp' }, +{ amprocfamily => 'btree/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '1', amproc => 'bttextcmp' }, +{ amprocfamily => 'btree/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '2', amproc => 'bttextsortsupport' }, +{ amprocfamily => 'btree/time_ops', amproclefttype => 'time', + amprocrighttype => 'time', amprocnum => '1', amproc => 'time_cmp' }, +{ amprocfamily => 'btree/time_ops', amproclefttype => 'time', + amprocrighttype => 'interval', amprocnum => '3', + amproc => 'in_range(time,time,interval,bool,bool)' }, +{ amprocfamily => 'btree/timetz_ops', amproclefttype => 'timetz', + amprocrighttype => 'timetz', amprocnum => '1', amproc => 'timetz_cmp' }, +{ amprocfamily => 'btree/timetz_ops', amproclefttype => 'timetz', + amprocrighttype => 'interval', amprocnum => '3', + amproc => 'in_range(timetz,timetz,interval,bool,bool)' }, +{ amprocfamily => 'btree/varbit_ops', amproclefttype => 'varbit', + amprocrighttype => 'varbit', amprocnum => '1', amproc => 'varbitcmp' }, +{ amprocfamily => 'btree/text_pattern_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '1', amproc => 'bttext_pattern_cmp' }, +{ amprocfamily => 'btree/text_pattern_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '2', + amproc => 'bttext_pattern_sortsupport' }, +{ amprocfamily => 'btree/bpchar_pattern_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '1', + amproc => 'btbpchar_pattern_cmp' }, +{ amprocfamily => 'btree/bpchar_pattern_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '2', + amproc => 'btbpchar_pattern_sortsupport' }, +{ amprocfamily => 'btree/money_ops', amproclefttype => 'money', + amprocrighttype => 'money', amprocnum => '1', amproc => 'cash_cmp' }, +{ amprocfamily => 'btree/reltime_ops', amproclefttype => 'reltime', + amprocrighttype => 'reltime', amprocnum => '1', amproc => 'btreltimecmp' }, +{ amprocfamily => 'btree/tinterval_ops', amproclefttype => 'tinterval', + amprocrighttype => 'tinterval', amprocnum => '1', + amproc => 'bttintervalcmp' }, +{ amprocfamily => 'btree/tid_ops', amproclefttype => 'tid', + amprocrighttype => 'tid', amprocnum => '1', amproc => 'bttidcmp' }, +{ amprocfamily => 'btree/uuid_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '1', amproc => 'uuid_cmp' }, +{ amprocfamily => 'btree/uuid_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '2', amproc => 'uuid_sortsupport' }, +{ amprocfamily => 'btree/record_ops', amproclefttype => 'record', + amprocrighttype => 'record', amprocnum => '1', amproc => 'btrecordcmp' }, +{ amprocfamily => 'btree/record_image_ops', amproclefttype => 'record', + amprocrighttype => 'record', amprocnum => '1', amproc => 'btrecordimagecmp' }, +{ amprocfamily => 'btree/pg_lsn_ops', amproclefttype => 'pg_lsn', + amprocrighttype => 'pg_lsn', amprocnum => '1', amproc => 'pg_lsn_cmp' }, +{ amprocfamily => 'btree/macaddr8_ops', amproclefttype => 'macaddr8', + amprocrighttype => 'macaddr8', amprocnum => '1', amproc => 'macaddr8_cmp' }, +{ amprocfamily => 'btree/enum_ops', amproclefttype => 'anyenum', + amprocrighttype => 'anyenum', amprocnum => '1', amproc => 'enum_cmp' }, +{ amprocfamily => 'btree/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '1', amproc => 'tsvector_cmp' }, +{ amprocfamily => 'btree/tsquery_ops', amproclefttype => 'tsquery', + amprocrighttype => 'tsquery', amprocnum => '1', amproc => 'tsquery_cmp' }, +{ amprocfamily => 'btree/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '1', amproc => 'range_cmp' }, +{ amprocfamily => 'btree/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '1', amproc => 'jsonb_cmp' }, + +# hash +{ amprocfamily => 'hash/bpchar_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '1', amproc => 'hashbpchar' }, +{ amprocfamily => 'hash/bpchar_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '2', + amproc => 'hashbpcharextended' }, +{ amprocfamily => 'hash/char_ops', amproclefttype => 'char', + amprocrighttype => 'char', amprocnum => '1', amproc => 'hashchar' }, +{ amprocfamily => 'hash/char_ops', amproclefttype => 'char', + amprocrighttype => 'char', amprocnum => '2', amproc => 'hashcharextended' }, +{ amprocfamily => 'hash/date_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '1', amproc => 'hashint4' }, +{ amprocfamily => 'hash/date_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '2', amproc => 'hashint4extended' }, +{ amprocfamily => 'hash/array_ops', amproclefttype => 'anyarray', + amprocrighttype => 'anyarray', amprocnum => '1', amproc => 'hash_array' }, +{ amprocfamily => 'hash/array_ops', amproclefttype => 'anyarray', + amprocrighttype => 'anyarray', amprocnum => '2', + amproc => 'hash_array_extended' }, +{ amprocfamily => 'hash/float_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '1', amproc => 'hashfloat4' }, +{ amprocfamily => 'hash/float_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '2', + amproc => 'hashfloat4extended' }, +{ amprocfamily => 'hash/float_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '1', amproc => 'hashfloat8' }, +{ amprocfamily => 'hash/float_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '2', + amproc => 'hashfloat8extended' }, +{ amprocfamily => 'hash/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '1', amproc => 'hashinet' }, +{ amprocfamily => 'hash/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '2', amproc => 'hashinetextended' }, +{ amprocfamily => 'hash/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '1', amproc => 'hashint2' }, +{ amprocfamily => 'hash/integer_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '2', amproc => 'hashint2extended' }, +{ amprocfamily => 'hash/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '1', amproc => 'hashint4' }, +{ amprocfamily => 'hash/integer_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '2', amproc => 'hashint4extended' }, +{ amprocfamily => 'hash/integer_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '1', amproc => 'hashint8' }, +{ amprocfamily => 'hash/integer_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '2', amproc => 'hashint8extended' }, +{ amprocfamily => 'hash/interval_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '1', amproc => 'interval_hash' }, +{ amprocfamily => 'hash/interval_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '2', + amproc => 'interval_hash_extended' }, +{ amprocfamily => 'hash/macaddr_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '1', amproc => 'hashmacaddr' }, +{ amprocfamily => 'hash/macaddr_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '2', + amproc => 'hashmacaddrextended' }, +{ amprocfamily => 'hash/name_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '1', amproc => 'hashname' }, +{ amprocfamily => 'hash/name_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '2', amproc => 'hashnameextended' }, +{ amprocfamily => 'hash/oid_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '1', amproc => 'hashoid' }, +{ amprocfamily => 'hash/oid_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '2', amproc => 'hashoidextended' }, +{ amprocfamily => 'hash/oidvector_ops', amproclefttype => 'oidvector', + amprocrighttype => 'oidvector', amprocnum => '1', amproc => 'hashoidvector' }, +{ amprocfamily => 'hash/oidvector_ops', amproclefttype => 'oidvector', + amprocrighttype => 'oidvector', amprocnum => '2', + amproc => 'hashoidvectorextended' }, +{ amprocfamily => 'hash/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '1', amproc => 'hashtext' }, +{ amprocfamily => 'hash/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '2', amproc => 'hashtextextended' }, +{ amprocfamily => 'hash/time_ops', amproclefttype => 'time', + amprocrighttype => 'time', amprocnum => '1', amproc => 'time_hash' }, +{ amprocfamily => 'hash/time_ops', amproclefttype => 'time', + amprocrighttype => 'time', amprocnum => '2', amproc => 'time_hash_extended' }, +{ amprocfamily => 'hash/numeric_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '1', amproc => 'hash_numeric' }, +{ amprocfamily => 'hash/numeric_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '2', + amproc => 'hash_numeric_extended' }, +{ amprocfamily => 'hash/timestamptz_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '1', + amproc => 'timestamp_hash' }, +{ amprocfamily => 'hash/timestamptz_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '2', + amproc => 'timestamp_hash_extended' }, +{ amprocfamily => 'hash/timetz_ops', amproclefttype => 'timetz', + amprocrighttype => 'timetz', amprocnum => '1', amproc => 'timetz_hash' }, +{ amprocfamily => 'hash/timetz_ops', amproclefttype => 'timetz', + amprocrighttype => 'timetz', amprocnum => '2', + amproc => 'timetz_hash_extended' }, +{ amprocfamily => 'hash/timestamp_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '1', + amproc => 'timestamp_hash' }, +{ amprocfamily => 'hash/timestamp_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '2', + amproc => 'timestamp_hash_extended' }, +{ amprocfamily => 'hash/bool_ops', amproclefttype => 'bool', + amprocrighttype => 'bool', amprocnum => '1', amproc => 'hashchar' }, +{ amprocfamily => 'hash/bool_ops', amproclefttype => 'bool', + amprocrighttype => 'bool', amprocnum => '2', amproc => 'hashcharextended' }, +{ amprocfamily => 'hash/bytea_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '1', amproc => 'hashvarlena' }, +{ amprocfamily => 'hash/bytea_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '2', + amproc => 'hashvarlenaextended' }, +{ amprocfamily => 'hash/xid_ops', amproclefttype => 'xid', + amprocrighttype => 'xid', amprocnum => '1', amproc => 'hashint4' }, +{ amprocfamily => 'hash/xid_ops', amproclefttype => 'xid', + amprocrighttype => 'xid', amprocnum => '2', amproc => 'hashint4extended' }, +{ amprocfamily => 'hash/cid_ops', amproclefttype => 'cid', + amprocrighttype => 'cid', amprocnum => '1', amproc => 'hashint4' }, +{ amprocfamily => 'hash/cid_ops', amproclefttype => 'cid', + amprocrighttype => 'cid', amprocnum => '2', amproc => 'hashint4extended' }, +{ amprocfamily => 'hash/abstime_ops', amproclefttype => 'abstime', + amprocrighttype => 'abstime', amprocnum => '1', amproc => 'hashint4' }, +{ amprocfamily => 'hash/abstime_ops', amproclefttype => 'abstime', + amprocrighttype => 'abstime', amprocnum => '2', + amproc => 'hashint4extended' }, +{ amprocfamily => 'hash/reltime_ops', amproclefttype => 'reltime', + amprocrighttype => 'reltime', amprocnum => '1', amproc => 'hashint4' }, +{ amprocfamily => 'hash/reltime_ops', amproclefttype => 'reltime', + amprocrighttype => 'reltime', amprocnum => '2', + amproc => 'hashint4extended' }, +{ amprocfamily => 'hash/text_pattern_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '1', amproc => 'hashtext' }, +{ amprocfamily => 'hash/text_pattern_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '2', amproc => 'hashtextextended' }, +{ amprocfamily => 'hash/bpchar_pattern_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '1', amproc => 'hashbpchar' }, +{ amprocfamily => 'hash/bpchar_pattern_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '2', + amproc => 'hashbpcharextended' }, +{ amprocfamily => 'hash/aclitem_ops', amproclefttype => 'aclitem', + amprocrighttype => 'aclitem', amprocnum => '1', amproc => 'hash_aclitem' }, +{ amprocfamily => 'hash/aclitem_ops', amproclefttype => 'aclitem', + amprocrighttype => 'aclitem', amprocnum => '2', + amproc => 'hash_aclitem_extended' }, +{ amprocfamily => 'hash/uuid_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '1', amproc => 'uuid_hash' }, +{ amprocfamily => 'hash/uuid_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '2', amproc => 'uuid_hash_extended' }, +{ amprocfamily => 'hash/pg_lsn_ops', amproclefttype => 'pg_lsn', + amprocrighttype => 'pg_lsn', amprocnum => '1', amproc => 'pg_lsn_hash' }, +{ amprocfamily => 'hash/pg_lsn_ops', amproclefttype => 'pg_lsn', + amprocrighttype => 'pg_lsn', amprocnum => '2', + amproc => 'pg_lsn_hash_extended' }, +{ amprocfamily => 'hash/macaddr8_ops', amproclefttype => 'macaddr8', + amprocrighttype => 'macaddr8', amprocnum => '1', amproc => 'hashmacaddr8' }, +{ amprocfamily => 'hash/macaddr8_ops', amproclefttype => 'macaddr8', + amprocrighttype => 'macaddr8', amprocnum => '2', + amproc => 'hashmacaddr8extended' }, +{ amprocfamily => 'hash/enum_ops', amproclefttype => 'anyenum', + amprocrighttype => 'anyenum', amprocnum => '1', amproc => 'hashenum' }, +{ amprocfamily => 'hash/enum_ops', amproclefttype => 'anyenum', + amprocrighttype => 'anyenum', amprocnum => '2', + amproc => 'hashenumextended' }, +{ amprocfamily => 'hash/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '1', amproc => 'hash_range' }, +{ amprocfamily => 'hash/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '2', + amproc => 'hash_range_extended' }, +{ amprocfamily => 'hash/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '1', amproc => 'jsonb_hash' }, +{ amprocfamily => 'hash/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '2', + amproc => 'jsonb_hash_extended' }, + +# gist +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '1', + amproc => 'gist_point_consistent' }, +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '2', amproc => 'gist_box_union' }, +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '3', + amproc => 'gist_point_compress' }, +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '5', amproc => 'gist_box_penalty' }, +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '6', + amproc => 'gist_box_picksplit' }, +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '7', amproc => 'gist_box_same' }, +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '8', + amproc => 'gist_point_distance' }, +{ amprocfamily => 'gist/point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '9', amproc => 'gist_point_fetch' }, +{ amprocfamily => 'gist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '1', amproc => 'gist_box_consistent' }, +{ amprocfamily => 'gist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '2', amproc => 'gist_box_union' }, +{ amprocfamily => 'gist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '5', amproc => 'gist_box_penalty' }, +{ amprocfamily => 'gist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '6', amproc => 'gist_box_picksplit' }, +{ amprocfamily => 'gist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '7', amproc => 'gist_box_same' }, +{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '1', + amproc => 'gist_poly_consistent' }, +{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '2', amproc => 'gist_box_union' }, +{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '3', + amproc => 'gist_poly_compress' }, +{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '5', + amproc => 'gist_box_penalty' }, +{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '6', + amproc => 'gist_box_picksplit' }, +{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '7', amproc => 'gist_box_same' }, +{ amprocfamily => 'gist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '8', + amproc => 'gist_poly_distance' }, +{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle', + amprocrighttype => 'circle', amprocnum => '1', + amproc => 'gist_circle_consistent' }, +{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle', + amprocrighttype => 'circle', amprocnum => '2', amproc => 'gist_box_union' }, +{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle', + amprocrighttype => 'circle', amprocnum => '3', + amproc => 'gist_circle_compress' }, +{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle', + amprocrighttype => 'circle', amprocnum => '5', amproc => 'gist_box_penalty' }, +{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle', + amprocrighttype => 'circle', amprocnum => '6', + amproc => 'gist_box_picksplit' }, +{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle', + amprocrighttype => 'circle', amprocnum => '7', amproc => 'gist_box_same' }, +{ amprocfamily => 'gist/circle_ops', amproclefttype => 'circle', + amprocrighttype => 'circle', amprocnum => '8', + amproc => 'gist_circle_distance' }, +{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '1', + amproc => 'gtsvector_consistent(internal,tsvector,int2,oid,internal)' }, +{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '2', + amproc => 'gtsvector_union' }, +{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '3', + amproc => 'gtsvector_compress' }, +{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '4', + amproc => 'gtsvector_decompress' }, +{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '5', + amproc => 'gtsvector_penalty' }, +{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '6', + amproc => 'gtsvector_picksplit' }, +{ amprocfamily => 'gist/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '7', amproc => 'gtsvector_same' }, +{ amprocfamily => 'gist/tsquery_ops', amproclefttype => 'tsquery', + amprocrighttype => 'tsquery', amprocnum => '1', + amproc => 'gtsquery_consistent(internal,tsquery,int2,oid,internal)' }, +{ amprocfamily => 'gist/tsquery_ops', amproclefttype => 'tsquery', + amprocrighttype => 'tsquery', amprocnum => '2', amproc => 'gtsquery_union' }, +{ amprocfamily => 'gist/tsquery_ops', amproclefttype => 'tsquery', + amprocrighttype => 'tsquery', amprocnum => '3', + amproc => 'gtsquery_compress' }, +{ amprocfamily => 'gist/tsquery_ops', amproclefttype => 'tsquery', + amprocrighttype => 'tsquery', amprocnum => '5', + amproc => 'gtsquery_penalty' }, +{ amprocfamily => 'gist/tsquery_ops', amproclefttype => 'tsquery', + amprocrighttype => 'tsquery', amprocnum => '6', + amproc => 'gtsquery_picksplit' }, +{ amprocfamily => 'gist/tsquery_ops', amproclefttype => 'tsquery', + amprocrighttype => 'tsquery', amprocnum => '7', amproc => 'gtsquery_same' }, +{ amprocfamily => 'gist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '1', + amproc => 'range_gist_consistent' }, +{ amprocfamily => 'gist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '2', + amproc => 'range_gist_union' }, +{ amprocfamily => 'gist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '5', + amproc => 'range_gist_penalty' }, +{ amprocfamily => 'gist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '6', + amproc => 'range_gist_picksplit' }, +{ amprocfamily => 'gist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '7', + amproc => 'range_gist_same' }, +{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '1', + amproc => 'inet_gist_consistent' }, +{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '2', amproc => 'inet_gist_union' }, +{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '3', amproc => 'inet_gist_compress' }, +{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '5', amproc => 'inet_gist_penalty' }, +{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '6', + amproc => 'inet_gist_picksplit' }, +{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '7', amproc => 'inet_gist_same' }, +{ amprocfamily => 'gist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '9', amproc => 'inet_gist_fetch' }, + +# gin +{ amprocfamily => 'gin/array_ops', amproclefttype => 'anyarray', + amprocrighttype => 'anyarray', amprocnum => '2', + amproc => 'ginarrayextract(anyarray,internal,internal)' }, +{ amprocfamily => 'gin/array_ops', amproclefttype => 'anyarray', + amprocrighttype => 'anyarray', amprocnum => '3', + amproc => 'ginqueryarrayextract' }, +{ amprocfamily => 'gin/array_ops', amproclefttype => 'anyarray', + amprocrighttype => 'anyarray', amprocnum => '4', + amproc => 'ginarrayconsistent' }, +{ amprocfamily => 'gin/array_ops', amproclefttype => 'anyarray', + amprocrighttype => 'anyarray', amprocnum => '6', + amproc => 'ginarraytriconsistent' }, +{ amprocfamily => 'gin/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '1', + amproc => 'gin_cmp_tslexeme' }, +{ amprocfamily => 'gin/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '2', + amproc => 'gin_extract_tsvector(tsvector,internal,internal)' }, +{ amprocfamily => 'gin/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '3', + amproc => 'gin_extract_tsquery(tsvector,internal,int2,internal,internal,internal,internal)' }, +{ amprocfamily => 'gin/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '4', + amproc => 'gin_tsquery_consistent(internal,int2,tsvector,int4,internal,internal,internal,internal)' }, +{ amprocfamily => 'gin/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '5', amproc => 'gin_cmp_prefix' }, +{ amprocfamily => 'gin/tsvector_ops', amproclefttype => 'tsvector', + amprocrighttype => 'tsvector', amprocnum => '6', + amproc => 'gin_tsquery_triconsistent' }, +{ amprocfamily => 'gin/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '1', amproc => 'gin_compare_jsonb' }, +{ amprocfamily => 'gin/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '2', amproc => 'gin_extract_jsonb' }, +{ amprocfamily => 'gin/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '3', + amproc => 'gin_extract_jsonb_query' }, +{ amprocfamily => 'gin/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '4', + amproc => 'gin_consistent_jsonb' }, +{ amprocfamily => 'gin/jsonb_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '6', + amproc => 'gin_triconsistent_jsonb' }, +{ amprocfamily => 'gin/jsonb_path_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '1', amproc => 'btint4cmp' }, +{ amprocfamily => 'gin/jsonb_path_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '2', + amproc => 'gin_extract_jsonb_path' }, +{ amprocfamily => 'gin/jsonb_path_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '3', + amproc => 'gin_extract_jsonb_query_path' }, +{ amprocfamily => 'gin/jsonb_path_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '4', + amproc => 'gin_consistent_jsonb_path' }, +{ amprocfamily => 'gin/jsonb_path_ops', amproclefttype => 'jsonb', + amprocrighttype => 'jsonb', amprocnum => '6', + amproc => 'gin_triconsistent_jsonb_path' }, + +# sp-gist +{ amprocfamily => 'spgist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '1', + amproc => 'spg_range_quad_config' }, +{ amprocfamily => 'spgist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '2', + amproc => 'spg_range_quad_choose' }, +{ amprocfamily => 'spgist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '3', + amproc => 'spg_range_quad_picksplit' }, +{ amprocfamily => 'spgist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '4', + amproc => 'spg_range_quad_inner_consistent' }, +{ amprocfamily => 'spgist/range_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '5', + amproc => 'spg_range_quad_leaf_consistent' }, +{ amprocfamily => 'spgist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '1', amproc => 'inet_spg_config' }, +{ amprocfamily => 'spgist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '2', amproc => 'inet_spg_choose' }, +{ amprocfamily => 'spgist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '3', amproc => 'inet_spg_picksplit' }, +{ amprocfamily => 'spgist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '4', + amproc => 'inet_spg_inner_consistent' }, +{ amprocfamily => 'spgist/network_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '5', + amproc => 'inet_spg_leaf_consistent' }, +{ amprocfamily => 'spgist/quad_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '1', amproc => 'spg_quad_config' }, +{ amprocfamily => 'spgist/quad_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '2', amproc => 'spg_quad_choose' }, +{ amprocfamily => 'spgist/quad_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '3', + amproc => 'spg_quad_picksplit' }, +{ amprocfamily => 'spgist/quad_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '4', + amproc => 'spg_quad_inner_consistent' }, +{ amprocfamily => 'spgist/quad_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '5', + amproc => 'spg_quad_leaf_consistent' }, +{ amprocfamily => 'spgist/kd_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '1', amproc => 'spg_kd_config' }, +{ amprocfamily => 'spgist/kd_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '2', amproc => 'spg_kd_choose' }, +{ amprocfamily => 'spgist/kd_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '3', amproc => 'spg_kd_picksplit' }, +{ amprocfamily => 'spgist/kd_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '4', + amproc => 'spg_kd_inner_consistent' }, +{ amprocfamily => 'spgist/kd_point_ops', amproclefttype => 'point', + amprocrighttype => 'point', amprocnum => '5', + amproc => 'spg_quad_leaf_consistent' }, +{ amprocfamily => 'spgist/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '1', amproc => 'spg_text_config' }, +{ amprocfamily => 'spgist/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '2', amproc => 'spg_text_choose' }, +{ amprocfamily => 'spgist/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '3', amproc => 'spg_text_picksplit' }, +{ amprocfamily => 'spgist/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '4', + amproc => 'spg_text_inner_consistent' }, +{ amprocfamily => 'spgist/text_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '5', + amproc => 'spg_text_leaf_consistent' }, +{ amprocfamily => 'spgist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '1', amproc => 'spg_box_quad_config' }, +{ amprocfamily => 'spgist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '2', amproc => 'spg_box_quad_choose' }, +{ amprocfamily => 'spgist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '3', + amproc => 'spg_box_quad_picksplit' }, +{ amprocfamily => 'spgist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '4', + amproc => 'spg_box_quad_inner_consistent' }, +{ amprocfamily => 'spgist/box_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '5', + amproc => 'spg_box_quad_leaf_consistent' }, +{ amprocfamily => 'spgist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '1', + amproc => 'spg_bbox_quad_config' }, +{ amprocfamily => 'spgist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '2', + amproc => 'spg_box_quad_choose' }, +{ amprocfamily => 'spgist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '3', + amproc => 'spg_box_quad_picksplit' }, +{ amprocfamily => 'spgist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '4', + amproc => 'spg_box_quad_inner_consistent' }, +{ amprocfamily => 'spgist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '5', + amproc => 'spg_box_quad_leaf_consistent' }, +{ amprocfamily => 'spgist/poly_ops', amproclefttype => 'polygon', + amprocrighttype => 'polygon', amprocnum => '6', + amproc => 'spg_poly_quad_compress' }, + +# BRIN opclasses + +# minmax bytea +{ amprocfamily => 'brin/bytea_minmax_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/bytea_minmax_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/bytea_minmax_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/bytea_minmax_ops', amproclefttype => 'bytea', + amprocrighttype => 'bytea', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax "char" +{ amprocfamily => 'brin/char_minmax_ops', amproclefttype => 'char', + amprocrighttype => 'char', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/char_minmax_ops', amproclefttype => 'char', + amprocrighttype => 'char', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/char_minmax_ops', amproclefttype => 'char', + amprocrighttype => 'char', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/char_minmax_ops', amproclefttype => 'char', + amprocrighttype => 'char', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax name +{ amprocfamily => 'brin/name_minmax_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/name_minmax_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/name_minmax_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/name_minmax_ops', amproclefttype => 'name', + amprocrighttype => 'name', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax integer: int2, int4, int8 +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int8', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int2', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int2', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int2', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int2', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int4', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int4', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int4', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int8', + amprocrighttype => 'int4', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int2', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int8', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int8', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int8', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int8', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int4', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int4', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int4', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int2', + amprocrighttype => 'int4', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int4', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int8', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int8', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int8', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int8', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int2', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int2', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int2', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/integer_minmax_ops', amproclefttype => 'int4', + amprocrighttype => 'int2', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax text +{ amprocfamily => 'brin/text_minmax_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/text_minmax_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/text_minmax_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/text_minmax_ops', amproclefttype => 'text', + amprocrighttype => 'text', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax oid +{ amprocfamily => 'brin/oid_minmax_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '1', amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/oid_minmax_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/oid_minmax_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/oid_minmax_ops', amproclefttype => 'oid', + amprocrighttype => 'oid', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax tid +{ amprocfamily => 'brin/tid_minmax_ops', amproclefttype => 'tid', + amprocrighttype => 'tid', amprocnum => '1', amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/tid_minmax_ops', amproclefttype => 'tid', + amprocrighttype => 'tid', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/tid_minmax_ops', amproclefttype => 'tid', + amprocrighttype => 'tid', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/tid_minmax_ops', amproclefttype => 'tid', + amprocrighttype => 'tid', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax float +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float4', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float8', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float8', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float8', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float4', + amprocrighttype => 'float8', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float8', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float4', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float4', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float4', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/float_minmax_ops', amproclefttype => 'float8', + amprocrighttype => 'float4', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax abstime +{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime', + amprocrighttype => 'abstime', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime', + amprocrighttype => 'abstime', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime', + amprocrighttype => 'abstime', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/abstime_minmax_ops', amproclefttype => 'abstime', + amprocrighttype => 'abstime', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax reltime +{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime', + amprocrighttype => 'reltime', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime', + amprocrighttype => 'reltime', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime', + amprocrighttype => 'reltime', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/reltime_minmax_ops', amproclefttype => 'reltime', + amprocrighttype => 'reltime', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax macaddr +{ amprocfamily => 'brin/macaddr_minmax_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/macaddr_minmax_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/macaddr_minmax_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/macaddr_minmax_ops', amproclefttype => 'macaddr', + amprocrighttype => 'macaddr', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax macaddr8 +{ amprocfamily => 'brin/macaddr8_minmax_ops', amproclefttype => 'macaddr8', + amprocrighttype => 'macaddr8', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/macaddr8_minmax_ops', amproclefttype => 'macaddr8', + amprocrighttype => 'macaddr8', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/macaddr8_minmax_ops', amproclefttype => 'macaddr8', + amprocrighttype => 'macaddr8', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/macaddr8_minmax_ops', amproclefttype => 'macaddr8', + amprocrighttype => 'macaddr8', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax inet +{ amprocfamily => 'brin/network_minmax_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/network_minmax_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/network_minmax_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/network_minmax_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# inclusion inet +{ amprocfamily => 'brin/network_inclusion_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '1', + amproc => 'brin_inclusion_opcinfo' }, +{ amprocfamily => 'brin/network_inclusion_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '2', + amproc => 'brin_inclusion_add_value' }, +{ amprocfamily => 'brin/network_inclusion_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '3', + amproc => 'brin_inclusion_consistent' }, +{ amprocfamily => 'brin/network_inclusion_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '4', + amproc => 'brin_inclusion_union' }, +{ amprocfamily => 'brin/network_inclusion_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '11', amproc => 'inet_merge' }, +{ amprocfamily => 'brin/network_inclusion_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '12', amproc => 'inet_same_family' }, +{ amprocfamily => 'brin/network_inclusion_ops', amproclefttype => 'inet', + amprocrighttype => 'inet', amprocnum => '13', amproc => 'network_supeq' }, + +# minmax character +{ amprocfamily => 'brin/bpchar_minmax_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/bpchar_minmax_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/bpchar_minmax_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/bpchar_minmax_ops', amproclefttype => 'bpchar', + amprocrighttype => 'bpchar', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax time without time zone +{ amprocfamily => 'brin/time_minmax_ops', amproclefttype => 'time', + amprocrighttype => 'time', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/time_minmax_ops', amproclefttype => 'time', + amprocrighttype => 'time', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/time_minmax_ops', amproclefttype => 'time', + amprocrighttype => 'time', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/time_minmax_ops', amproclefttype => 'time', + amprocrighttype => 'time', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax datetime (date, timestamp, timestamptz) +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamp', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamptz', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamptz', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamptz', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'timestamptz', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'date', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'date', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'date', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamp', + amprocrighttype => 'date', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamptz', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamp', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamp', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamp', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'timestamp', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'date', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'date', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'date', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'timestamptz', + amprocrighttype => 'date', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'date', amprocnum => '4', amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamp', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamp', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamp', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamp', amprocnum => '4', + amproc => 'brin_minmax_union' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamptz', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamptz', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamptz', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/datetime_minmax_ops', amproclefttype => 'date', + amprocrighttype => 'timestamptz', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax interval +{ amprocfamily => 'brin/interval_minmax_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/interval_minmax_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/interval_minmax_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/interval_minmax_ops', amproclefttype => 'interval', + amprocrighttype => 'interval', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax time with time zone +{ amprocfamily => 'brin/timetz_minmax_ops', amproclefttype => 'timetz', + amprocrighttype => 'timetz', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/timetz_minmax_ops', amproclefttype => 'timetz', + amprocrighttype => 'timetz', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/timetz_minmax_ops', amproclefttype => 'timetz', + amprocrighttype => 'timetz', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/timetz_minmax_ops', amproclefttype => 'timetz', + amprocrighttype => 'timetz', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax bit +{ amprocfamily => 'brin/bit_minmax_ops', amproclefttype => 'bit', + amprocrighttype => 'bit', amprocnum => '1', amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/bit_minmax_ops', amproclefttype => 'bit', + amprocrighttype => 'bit', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/bit_minmax_ops', amproclefttype => 'bit', + amprocrighttype => 'bit', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/bit_minmax_ops', amproclefttype => 'bit', + amprocrighttype => 'bit', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# minmax bit varying +{ amprocfamily => 'brin/varbit_minmax_ops', amproclefttype => 'varbit', + amprocrighttype => 'varbit', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/varbit_minmax_ops', amproclefttype => 'varbit', + amprocrighttype => 'varbit', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/varbit_minmax_ops', amproclefttype => 'varbit', + amprocrighttype => 'varbit', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/varbit_minmax_ops', amproclefttype => 'varbit', + amprocrighttype => 'varbit', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax numeric +{ amprocfamily => 'brin/numeric_minmax_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/numeric_minmax_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/numeric_minmax_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/numeric_minmax_ops', amproclefttype => 'numeric', + amprocrighttype => 'numeric', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# minmax uuid +{ amprocfamily => 'brin/uuid_minmax_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/uuid_minmax_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/uuid_minmax_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/uuid_minmax_ops', amproclefttype => 'uuid', + amprocrighttype => 'uuid', amprocnum => '4', amproc => 'brin_minmax_union' }, + +# inclusion range types +{ amprocfamily => 'brin/range_inclusion_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '1', + amproc => 'brin_inclusion_opcinfo' }, +{ amprocfamily => 'brin/range_inclusion_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '2', + amproc => 'brin_inclusion_add_value' }, +{ amprocfamily => 'brin/range_inclusion_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '3', + amproc => 'brin_inclusion_consistent' }, +{ amprocfamily => 'brin/range_inclusion_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '4', + amproc => 'brin_inclusion_union' }, +{ amprocfamily => 'brin/range_inclusion_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '11', amproc => 'range_merge' }, +{ amprocfamily => 'brin/range_inclusion_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '13', + amproc => 'range_contains' }, +{ amprocfamily => 'brin/range_inclusion_ops', amproclefttype => 'anyrange', + amprocrighttype => 'anyrange', amprocnum => '14', amproc => 'isempty' }, + +# minmax pg_lsn +{ amprocfamily => 'brin/pg_lsn_minmax_ops', amproclefttype => 'pg_lsn', + amprocrighttype => 'pg_lsn', amprocnum => '1', + amproc => 'brin_minmax_opcinfo' }, +{ amprocfamily => 'brin/pg_lsn_minmax_ops', amproclefttype => 'pg_lsn', + amprocrighttype => 'pg_lsn', amprocnum => '2', + amproc => 'brin_minmax_add_value' }, +{ amprocfamily => 'brin/pg_lsn_minmax_ops', amproclefttype => 'pg_lsn', + amprocrighttype => 'pg_lsn', amprocnum => '3', + amproc => 'brin_minmax_consistent' }, +{ amprocfamily => 'brin/pg_lsn_minmax_ops', amproclefttype => 'pg_lsn', + amprocrighttype => 'pg_lsn', amprocnum => '4', + amproc => 'brin_minmax_union' }, + +# inclusion box +{ amprocfamily => 'brin/box_inclusion_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '1', + amproc => 'brin_inclusion_opcinfo' }, +{ amprocfamily => 'brin/box_inclusion_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '2', + amproc => 'brin_inclusion_add_value' }, +{ amprocfamily => 'brin/box_inclusion_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '3', + amproc => 'brin_inclusion_consistent' }, +{ amprocfamily => 'brin/box_inclusion_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '4', + amproc => 'brin_inclusion_union' }, +{ amprocfamily => 'brin/box_inclusion_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '11', amproc => 'bound_box' }, +{ amprocfamily => 'brin/box_inclusion_ops', amproclefttype => 'box', + amprocrighttype => 'box', amprocnum => '13', amproc => 'box_contain' }, + +] diff --git a/src/include/catalog/pg_amproc.h b/src/include/catalog/pg_amproc.h index eb595e81dbf..d638e0cbfe0 100644 --- a/src/include/catalog/pg_amproc.h +++ b/src/include/catalog/pg_amproc.h @@ -2,7 +2,6 @@ * * pg_amproc.h * definition of the system "amproc" relation (pg_amproc) - * along with the relation's initial contents. * * The amproc table identifies support procedures associated with index * operator families and classes. These procedures can't be listed in pg_amop @@ -25,8 +24,8 @@ * src/include/catalog/pg_amproc.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -34,21 +33,29 @@ #define PG_AMPROC_H #include "catalog/genbki.h" +#include "catalog/pg_amproc_d.h" /* ---------------- * pg_amproc definition. cpp turns this into * typedef struct FormData_pg_amproc * ---------------- */ -#define AccessMethodProcedureRelationId 2603 - -CATALOG(pg_amproc,2603) +CATALOG(pg_amproc,2603,AccessMethodProcedureRelationId) { - Oid amprocfamily; /* the index opfamily this entry is for */ - Oid amproclefttype; /* procedure's left input data type */ - Oid amprocrighttype; /* procedure's right input data type */ - int16 amprocnum; /* support procedure index */ - regproc amproc; /* OID of the proc */ + /* the index opfamily this entry is for */ + Oid amprocfamily BKI_LOOKUP(pg_opfamily); + + /* procedure's left input data type */ + Oid amproclefttype BKI_LOOKUP(pg_type); + + /* procedure's right input data type */ + Oid amprocrighttype BKI_LOOKUP(pg_type); + + /* support procedure index */ + int16 amprocnum; + + /* OID of the proc */ + regproc amproc BKI_LOOKUP(pg_proc); } FormData_pg_amproc; /* ---------------- @@ -58,529 +65,4 @@ CATALOG(pg_amproc,2603) */ typedef FormData_pg_amproc *Form_pg_amproc; -/* ---------------- - * compiler constants for pg_amproc - * ---------------- - */ -#define Natts_pg_amproc 5 -#define Anum_pg_amproc_amprocfamily 1 -#define Anum_pg_amproc_amproclefttype 2 -#define Anum_pg_amproc_amprocrighttype 3 -#define Anum_pg_amproc_amprocnum 4 -#define Anum_pg_amproc_amproc 5 - -/* ---------------- - * initial contents of pg_amproc - * ---------------- - */ - -/* btree */ -DATA(insert ( 397 2277 2277 1 382 )); -DATA(insert ( 421 702 702 1 357 )); -DATA(insert ( 423 1560 1560 1 1596 )); -DATA(insert ( 424 16 16 1 1693 )); -DATA(insert ( 426 1042 1042 1 1078 )); -DATA(insert ( 426 1042 1042 2 3328 )); -DATA(insert ( 428 17 17 1 1954 )); -DATA(insert ( 428 17 17 2 3331 )); -DATA(insert ( 429 18 18 1 358 )); -DATA(insert ( 434 1082 1082 1 1092 )); -DATA(insert ( 434 1082 1082 2 3136 )); -DATA(insert ( 434 1082 1114 1 2344 )); -DATA(insert ( 434 1082 1184 1 2357 )); -DATA(insert ( 434 1114 1114 1 2045 )); -DATA(insert ( 434 1114 1114 2 3137 )); -DATA(insert ( 434 1114 1082 1 2370 )); -DATA(insert ( 434 1114 1184 1 2526 )); -DATA(insert ( 434 1184 1184 1 1314 )); -DATA(insert ( 434 1184 1184 2 3137 )); -DATA(insert ( 434 1184 1082 1 2383 )); -DATA(insert ( 434 1184 1114 1 2533 )); -DATA(insert ( 434 1082 1186 3 4133 )); -DATA(insert ( 434 1114 1186 3 4134 )); -DATA(insert ( 434 1184 1186 3 4135 )); -DATA(insert ( 1970 700 700 1 354 )); -DATA(insert ( 1970 700 700 2 3132 )); -DATA(insert ( 1970 700 701 1 2194 )); -DATA(insert ( 1970 701 701 1 355 )); -DATA(insert ( 1970 701 701 2 3133 )); -DATA(insert ( 1970 701 700 1 2195 )); -DATA(insert ( 1970 701 701 3 4139 )); -DATA(insert ( 1970 700 701 3 4140 )); -DATA(insert ( 1974 869 869 1 926 )); -DATA(insert ( 1976 21 21 1 350 )); -DATA(insert ( 1976 21 21 2 3129 )); -DATA(insert ( 1976 21 23 1 2190 )); -DATA(insert ( 1976 21 20 1 2192 )); -DATA(insert ( 1976 21 20 3 4130 )); -DATA(insert ( 1976 21 23 3 4131 )); -DATA(insert ( 1976 21 21 3 4132 )); -DATA(insert ( 1976 23 23 1 351 )); -DATA(insert ( 1976 23 23 2 3130 )); -DATA(insert ( 1976 23 20 1 2188 )); -DATA(insert ( 1976 23 21 1 2191 )); -DATA(insert ( 1976 23 20 3 4127 )); -DATA(insert ( 1976 23 23 3 4128 )); -DATA(insert ( 1976 23 21 3 4129 )); -DATA(insert ( 1976 20 20 1 842 )); -DATA(insert ( 1976 20 20 2 3131 )); -DATA(insert ( 1976 20 23 1 2189 )); -DATA(insert ( 1976 20 21 1 2193 )); -DATA(insert ( 1976 20 20 3 4126 )); -DATA(insert ( 1982 1186 1186 1 1315 )); -DATA(insert ( 1982 1186 1186 3 4136 )); -DATA(insert ( 1984 829 829 1 836 )); -DATA(insert ( 1984 829 829 2 3359 )); -DATA(insert ( 1986 19 19 1 359 )); -DATA(insert ( 1986 19 19 2 3135 )); -DATA(insert ( 1988 1700 1700 1 1769 )); -DATA(insert ( 1988 1700 1700 2 3283 )); -DATA(insert ( 1988 1700 1700 3 4141 )); -DATA(insert ( 1989 26 26 1 356 )); -DATA(insert ( 1989 26 26 2 3134 )); -DATA(insert ( 1991 30 30 1 404 )); -DATA(insert ( 1994 25 25 1 360 )); -DATA(insert ( 1994 25 25 2 3255 )); -DATA(insert ( 1996 1083 1083 1 1107 )); -DATA(insert ( 1996 1083 1186 3 4137 )); -DATA(insert ( 2000 1266 1266 1 1358 )); -DATA(insert ( 2000 1266 1186 3 4138 )); -DATA(insert ( 2002 1562 1562 1 1672 )); -DATA(insert ( 2095 25 25 1 2166 )); -DATA(insert ( 2095 25 25 2 3332 )); -DATA(insert ( 2097 1042 1042 1 2180 )); -DATA(insert ( 2097 1042 1042 2 3333 )); -DATA(insert ( 2099 790 790 1 377 )); -DATA(insert ( 2233 703 703 1 380 )); -DATA(insert ( 2234 704 704 1 381 )); -DATA(insert ( 2789 27 27 1 2794 )); -DATA(insert ( 2968 2950 2950 1 2960 )); -DATA(insert ( 2968 2950 2950 2 3300 )); -DATA(insert ( 2994 2249 2249 1 2987 )); -DATA(insert ( 3194 2249 2249 1 3187 )); -DATA(insert ( 3253 3220 3220 1 3251 )); -DATA(insert ( 3371 774 774 1 4119 )); -DATA(insert ( 3522 3500 3500 1 3514 )); -DATA(insert ( 3626 3614 3614 1 3622 )); -DATA(insert ( 3683 3615 3615 1 3668 )); -DATA(insert ( 3901 3831 3831 1 3870 )); -DATA(insert ( 4033 3802 3802 1 4044 )); - - -/* hash */ -DATA(insert ( 427 1042 1042 1 1080 )); -DATA(insert ( 427 1042 1042 2 972 )); -DATA(insert ( 431 18 18 1 454 )); -DATA(insert ( 431 18 18 2 446 )); -DATA(insert ( 435 1082 1082 1 450 )); -DATA(insert ( 435 1082 1082 2 425 )); -DATA(insert ( 627 2277 2277 1 626 )); -DATA(insert ( 627 2277 2277 2 782 )); -DATA(insert ( 1971 700 700 1 451 )); -DATA(insert ( 1971 700 700 2 443 )); -DATA(insert ( 1971 701 701 1 452 )); -DATA(insert ( 1971 701 701 2 444 )); -DATA(insert ( 1975 869 869 1 422 )); -DATA(insert ( 1975 869 869 2 779 )); -DATA(insert ( 1977 21 21 1 449 )); -DATA(insert ( 1977 21 21 2 441 )); -DATA(insert ( 1977 23 23 1 450 )); -DATA(insert ( 1977 23 23 2 425 )); -DATA(insert ( 1977 20 20 1 949 )); -DATA(insert ( 1977 20 20 2 442 )); -DATA(insert ( 1983 1186 1186 1 1697 )); -DATA(insert ( 1983 1186 1186 2 3418 )); -DATA(insert ( 1985 829 829 1 399 )); -DATA(insert ( 1985 829 829 2 778 )); -DATA(insert ( 1987 19 19 1 455 )); -DATA(insert ( 1987 19 19 2 447 )); -DATA(insert ( 1990 26 26 1 453 )); -DATA(insert ( 1990 26 26 2 445 )); -DATA(insert ( 1992 30 30 1 457 )); -DATA(insert ( 1992 30 30 2 776 )); -DATA(insert ( 1995 25 25 1 400 )); -DATA(insert ( 1995 25 25 2 448)); -DATA(insert ( 1997 1083 1083 1 1688 )); -DATA(insert ( 1997 1083 1083 2 3409 )); -DATA(insert ( 1998 1700 1700 1 432 )); -DATA(insert ( 1998 1700 1700 2 780 )); -DATA(insert ( 1999 1184 1184 1 2039 )); -DATA(insert ( 1999 1184 1184 2 3411 )); -DATA(insert ( 2001 1266 1266 1 1696 )); -DATA(insert ( 2001 1266 1266 2 3410 )); -DATA(insert ( 2040 1114 1114 1 2039 )); -DATA(insert ( 2040 1114 1114 2 3411 )); -DATA(insert ( 2222 16 16 1 454 )); -DATA(insert ( 2222 16 16 2 446 )); -DATA(insert ( 2223 17 17 1 456 )); -DATA(insert ( 2223 17 17 2 772 )); -DATA(insert ( 2225 28 28 1 450 )); -DATA(insert ( 2225 28 28 2 425)); -DATA(insert ( 2226 29 29 1 450 )); -DATA(insert ( 2226 29 29 2 425 )); -DATA(insert ( 2227 702 702 1 450 )); -DATA(insert ( 2227 702 702 2 425 )); -DATA(insert ( 2228 703 703 1 450 )); -DATA(insert ( 2228 703 703 2 425 )); -DATA(insert ( 2229 25 25 1 400 )); -DATA(insert ( 2229 25 25 2 448 )); -DATA(insert ( 2231 1042 1042 1 1080 )); -DATA(insert ( 2231 1042 1042 2 972 )); -DATA(insert ( 2235 1033 1033 1 329 )); -DATA(insert ( 2235 1033 1033 2 777 )); -DATA(insert ( 2969 2950 2950 1 2963 )); -DATA(insert ( 2969 2950 2950 2 3412 )); -DATA(insert ( 3254 3220 3220 1 3252 )); -DATA(insert ( 3254 3220 3220 2 3413 )); -DATA(insert ( 3372 774 774 1 328 )); -DATA(insert ( 3372 774 774 2 781 )); -DATA(insert ( 3523 3500 3500 1 3515 )); -DATA(insert ( 3523 3500 3500 2 3414 )); -DATA(insert ( 3903 3831 3831 1 3902 )); -DATA(insert ( 3903 3831 3831 2 3417 )); -DATA(insert ( 4034 3802 3802 1 4045 )); -DATA(insert ( 4034 3802 3802 2 3416)); - - -/* gist */ -DATA(insert ( 1029 600 600 1 2179 )); -DATA(insert ( 1029 600 600 2 2583 )); -DATA(insert ( 1029 600 600 3 1030 )); -DATA(insert ( 1029 600 600 5 2581 )); -DATA(insert ( 1029 600 600 6 2582 )); -DATA(insert ( 1029 600 600 7 2584 )); -DATA(insert ( 1029 600 600 8 3064 )); -DATA(insert ( 1029 600 600 9 3282 )); -DATA(insert ( 2593 603 603 1 2578 )); -DATA(insert ( 2593 603 603 2 2583 )); -DATA(insert ( 2593 603 603 5 2581 )); -DATA(insert ( 2593 603 603 6 2582 )); -DATA(insert ( 2593 603 603 7 2584 )); -DATA(insert ( 2594 604 604 1 2585 )); -DATA(insert ( 2594 604 604 2 2583 )); -DATA(insert ( 2594 604 604 3 2586 )); -DATA(insert ( 2594 604 604 5 2581 )); -DATA(insert ( 2594 604 604 6 2582 )); -DATA(insert ( 2594 604 604 7 2584 )); -DATA(insert ( 2594 604 604 8 3288 )); -DATA(insert ( 2595 718 718 1 2591 )); -DATA(insert ( 2595 718 718 2 2583 )); -DATA(insert ( 2595 718 718 3 2592 )); -DATA(insert ( 2595 718 718 5 2581 )); -DATA(insert ( 2595 718 718 6 2582 )); -DATA(insert ( 2595 718 718 7 2584 )); -DATA(insert ( 2595 718 718 8 3280 )); -DATA(insert ( 3655 3614 3614 1 3654 )); -DATA(insert ( 3655 3614 3614 2 3651 )); -DATA(insert ( 3655 3614 3614 3 3648 )); -DATA(insert ( 3655 3614 3614 4 3649 )); -DATA(insert ( 3655 3614 3614 5 3653 )); -DATA(insert ( 3655 3614 3614 6 3650 )); -DATA(insert ( 3655 3614 3614 7 3652 )); -DATA(insert ( 3702 3615 3615 1 3701 )); -DATA(insert ( 3702 3615 3615 2 3698 )); -DATA(insert ( 3702 3615 3615 3 3695 )); -DATA(insert ( 3702 3615 3615 5 3700 )); -DATA(insert ( 3702 3615 3615 6 3697 )); -DATA(insert ( 3702 3615 3615 7 3699 )); -DATA(insert ( 3919 3831 3831 1 3875 )); -DATA(insert ( 3919 3831 3831 2 3876 )); -DATA(insert ( 3919 3831 3831 5 3879 )); -DATA(insert ( 3919 3831 3831 6 3880 )); -DATA(insert ( 3919 3831 3831 7 3881 )); -DATA(insert ( 3550 869 869 1 3553 )); -DATA(insert ( 3550 869 869 2 3554 )); -DATA(insert ( 3550 869 869 3 3555 )); -DATA(insert ( 3550 869 869 5 3557 )); -DATA(insert ( 3550 869 869 6 3558 )); -DATA(insert ( 3550 869 869 7 3559 )); -DATA(insert ( 3550 869 869 9 3573 )); - - -/* gin */ -DATA(insert ( 2745 2277 2277 2 2743 )); -DATA(insert ( 2745 2277 2277 3 2774 )); -DATA(insert ( 2745 2277 2277 4 2744 )); -DATA(insert ( 2745 2277 2277 6 3920 )); -DATA(insert ( 3659 3614 3614 1 3724 )); -DATA(insert ( 3659 3614 3614 2 3656 )); -DATA(insert ( 3659 3614 3614 3 3657 )); -DATA(insert ( 3659 3614 3614 4 3658 )); -DATA(insert ( 3659 3614 3614 5 2700 )); -DATA(insert ( 3659 3614 3614 6 3921 )); -DATA(insert ( 4036 3802 3802 1 3480 )); -DATA(insert ( 4036 3802 3802 2 3482 )); -DATA(insert ( 4036 3802 3802 3 3483 )); -DATA(insert ( 4036 3802 3802 4 3484 )); -DATA(insert ( 4036 3802 3802 6 3488 )); -DATA(insert ( 4037 3802 3802 1 351 )); -DATA(insert ( 4037 3802 3802 2 3485 )); -DATA(insert ( 4037 3802 3802 3 3486 )); -DATA(insert ( 4037 3802 3802 4 3487 )); -DATA(insert ( 4037 3802 3802 6 3489 )); - -/* sp-gist */ -DATA(insert ( 3474 3831 3831 1 3469 )); -DATA(insert ( 3474 3831 3831 2 3470 )); -DATA(insert ( 3474 3831 3831 3 3471 )); -DATA(insert ( 3474 3831 3831 4 3472 )); -DATA(insert ( 3474 3831 3831 5 3473 )); -DATA(insert ( 3794 869 869 1 3795 )); -DATA(insert ( 3794 869 869 2 3796 )); -DATA(insert ( 3794 869 869 3 3797 )); -DATA(insert ( 3794 869 869 4 3798 )); -DATA(insert ( 3794 869 869 5 3799 )); -DATA(insert ( 4015 600 600 1 4018 )); -DATA(insert ( 4015 600 600 2 4019 )); -DATA(insert ( 4015 600 600 3 4020 )); -DATA(insert ( 4015 600 600 4 4021 )); -DATA(insert ( 4015 600 600 5 4022 )); -DATA(insert ( 4016 600 600 1 4023 )); -DATA(insert ( 4016 600 600 2 4024 )); -DATA(insert ( 4016 600 600 3 4025 )); -DATA(insert ( 4016 600 600 4 4026 )); -DATA(insert ( 4016 600 600 5 4022 )); -DATA(insert ( 4017 25 25 1 4027 )); -DATA(insert ( 4017 25 25 2 4028 )); -DATA(insert ( 4017 25 25 3 4029 )); -DATA(insert ( 4017 25 25 4 4030 )); -DATA(insert ( 4017 25 25 5 4031 )); -DATA(insert ( 5000 603 603 1 5012 )); -DATA(insert ( 5000 603 603 2 5013 )); -DATA(insert ( 5000 603 603 3 5014 )); -DATA(insert ( 5000 603 603 4 5015 )); -DATA(insert ( 5000 603 603 5 5016 )); -DATA(insert ( 5008 604 604 1 5010 )); -DATA(insert ( 5008 604 604 2 5013 )); -DATA(insert ( 5008 604 604 3 5014 )); -DATA(insert ( 5008 604 604 4 5015 )); -DATA(insert ( 5008 604 604 5 5016 )); -DATA(insert ( 5008 604 604 6 5011 )); - -/* BRIN opclasses */ -/* minmax bytea */ -DATA(insert ( 4064 17 17 1 3383 )); -DATA(insert ( 4064 17 17 2 3384 )); -DATA(insert ( 4064 17 17 3 3385 )); -DATA(insert ( 4064 17 17 4 3386 )); -/* minmax "char" */ -DATA(insert ( 4062 18 18 1 3383 )); -DATA(insert ( 4062 18 18 2 3384 )); -DATA(insert ( 4062 18 18 3 3385 )); -DATA(insert ( 4062 18 18 4 3386 )); -/* minmax name */ -DATA(insert ( 4065 19 19 1 3383 )); -DATA(insert ( 4065 19 19 2 3384 )); -DATA(insert ( 4065 19 19 3 3385 )); -DATA(insert ( 4065 19 19 4 3386 )); -/* minmax integer: int2, int4, int8 */ -DATA(insert ( 4054 20 20 1 3383 )); -DATA(insert ( 4054 20 20 2 3384 )); -DATA(insert ( 4054 20 20 3 3385 )); -DATA(insert ( 4054 20 20 4 3386 )); -DATA(insert ( 4054 20 21 1 3383 )); -DATA(insert ( 4054 20 21 2 3384 )); -DATA(insert ( 4054 20 21 3 3385 )); -DATA(insert ( 4054 20 21 4 3386 )); -DATA(insert ( 4054 20 23 1 3383 )); -DATA(insert ( 4054 20 23 2 3384 )); -DATA(insert ( 4054 20 23 3 3385 )); -DATA(insert ( 4054 20 23 4 3386 )); - -DATA(insert ( 4054 21 21 1 3383 )); -DATA(insert ( 4054 21 21 2 3384 )); -DATA(insert ( 4054 21 21 3 3385 )); -DATA(insert ( 4054 21 21 4 3386 )); -DATA(insert ( 4054 21 20 1 3383 )); -DATA(insert ( 4054 21 20 2 3384 )); -DATA(insert ( 4054 21 20 3 3385 )); -DATA(insert ( 4054 21 20 4 3386 )); -DATA(insert ( 4054 21 23 1 3383 )); -DATA(insert ( 4054 21 23 2 3384 )); -DATA(insert ( 4054 21 23 3 3385 )); -DATA(insert ( 4054 21 23 4 3386 )); - -DATA(insert ( 4054 23 23 1 3383 )); -DATA(insert ( 4054 23 23 2 3384 )); -DATA(insert ( 4054 23 23 3 3385 )); -DATA(insert ( 4054 23 23 4 3386 )); -DATA(insert ( 4054 23 20 1 3383 )); -DATA(insert ( 4054 23 20 2 3384 )); -DATA(insert ( 4054 23 20 3 3385 )); -DATA(insert ( 4054 23 20 4 3386 )); -DATA(insert ( 4054 23 21 1 3383 )); -DATA(insert ( 4054 23 21 2 3384 )); -DATA(insert ( 4054 23 21 3 3385 )); -DATA(insert ( 4054 23 21 4 3386 )); - -/* minmax text */ -DATA(insert ( 4056 25 25 1 3383 )); -DATA(insert ( 4056 25 25 2 3384 )); -DATA(insert ( 4056 25 25 3 3385 )); -DATA(insert ( 4056 25 25 4 3386 )); -/* minmax oid */ -DATA(insert ( 4068 26 26 1 3383 )); -DATA(insert ( 4068 26 26 2 3384 )); -DATA(insert ( 4068 26 26 3 3385 )); -DATA(insert ( 4068 26 26 4 3386 )); -/* minmax tid */ -DATA(insert ( 4069 27 27 1 3383 )); -DATA(insert ( 4069 27 27 2 3384 )); -DATA(insert ( 4069 27 27 3 3385 )); -DATA(insert ( 4069 27 27 4 3386 )); -/* minmax float */ -DATA(insert ( 4070 700 700 1 3383 )); -DATA(insert ( 4070 700 700 2 3384 )); -DATA(insert ( 4070 700 700 3 3385 )); -DATA(insert ( 4070 700 700 4 3386 )); - -DATA(insert ( 4070 700 701 1 3383 )); -DATA(insert ( 4070 700 701 2 3384 )); -DATA(insert ( 4070 700 701 3 3385 )); -DATA(insert ( 4070 700 701 4 3386 )); - -DATA(insert ( 4070 701 701 1 3383 )); -DATA(insert ( 4070 701 701 2 3384 )); -DATA(insert ( 4070 701 701 3 3385 )); -DATA(insert ( 4070 701 701 4 3386 )); - -DATA(insert ( 4070 701 700 1 3383 )); -DATA(insert ( 4070 701 700 2 3384 )); -DATA(insert ( 4070 701 700 3 3385 )); -DATA(insert ( 4070 701 700 4 3386 )); - -/* minmax abstime */ -DATA(insert ( 4072 702 702 1 3383 )); -DATA(insert ( 4072 702 702 2 3384 )); -DATA(insert ( 4072 702 702 3 3385 )); -DATA(insert ( 4072 702 702 4 3386 )); -/* minmax reltime */ -DATA(insert ( 4073 703 703 1 3383 )); -DATA(insert ( 4073 703 703 2 3384 )); -DATA(insert ( 4073 703 703 3 3385 )); -DATA(insert ( 4073 703 703 4 3386 )); -/* minmax macaddr */ -DATA(insert ( 4074 829 829 1 3383 )); -DATA(insert ( 4074 829 829 2 3384 )); -DATA(insert ( 4074 829 829 3 3385 )); -DATA(insert ( 4074 829 829 4 3386 )); -/* minmax macaddr8 */ -DATA(insert ( 4109 774 774 1 3383 )); -DATA(insert ( 4109 774 774 2 3384 )); -DATA(insert ( 4109 774 774 3 3385 )); -DATA(insert ( 4109 774 774 4 3386 )); -/* minmax inet */ -DATA(insert ( 4075 869 869 1 3383 )); -DATA(insert ( 4075 869 869 2 3384 )); -DATA(insert ( 4075 869 869 3 3385 )); -DATA(insert ( 4075 869 869 4 3386 )); -/* inclusion inet */ -DATA(insert ( 4102 869 869 1 4105 )); -DATA(insert ( 4102 869 869 2 4106 )); -DATA(insert ( 4102 869 869 3 4107 )); -DATA(insert ( 4102 869 869 4 4108 )); -DATA(insert ( 4102 869 869 11 4063 )); -DATA(insert ( 4102 869 869 12 4071 )); -DATA(insert ( 4102 869 869 13 930 )); -/* minmax character */ -DATA(insert ( 4076 1042 1042 1 3383 )); -DATA(insert ( 4076 1042 1042 2 3384 )); -DATA(insert ( 4076 1042 1042 3 3385 )); -DATA(insert ( 4076 1042 1042 4 3386 )); -/* minmax time without time zone */ -DATA(insert ( 4077 1083 1083 1 3383 )); -DATA(insert ( 4077 1083 1083 2 3384 )); -DATA(insert ( 4077 1083 1083 3 3385 )); -DATA(insert ( 4077 1083 1083 4 3386 )); -/* minmax datetime (date, timestamp, timestamptz) */ -DATA(insert ( 4059 1114 1114 1 3383 )); -DATA(insert ( 4059 1114 1114 2 3384 )); -DATA(insert ( 4059 1114 1114 3 3385 )); -DATA(insert ( 4059 1114 1114 4 3386 )); -DATA(insert ( 4059 1114 1184 1 3383 )); -DATA(insert ( 4059 1114 1184 2 3384 )); -DATA(insert ( 4059 1114 1184 3 3385 )); -DATA(insert ( 4059 1114 1184 4 3386 )); -DATA(insert ( 4059 1114 1082 1 3383 )); -DATA(insert ( 4059 1114 1082 2 3384 )); -DATA(insert ( 4059 1114 1082 3 3385 )); -DATA(insert ( 4059 1114 1082 4 3386 )); - -DATA(insert ( 4059 1184 1184 1 3383 )); -DATA(insert ( 4059 1184 1184 2 3384 )); -DATA(insert ( 4059 1184 1184 3 3385 )); -DATA(insert ( 4059 1184 1184 4 3386 )); -DATA(insert ( 4059 1184 1114 1 3383 )); -DATA(insert ( 4059 1184 1114 2 3384 )); -DATA(insert ( 4059 1184 1114 3 3385 )); -DATA(insert ( 4059 1184 1114 4 3386 )); -DATA(insert ( 4059 1184 1082 1 3383 )); -DATA(insert ( 4059 1184 1082 2 3384 )); -DATA(insert ( 4059 1184 1082 3 3385 )); -DATA(insert ( 4059 1184 1082 4 3386 )); - -DATA(insert ( 4059 1082 1082 1 3383 )); -DATA(insert ( 4059 1082 1082 2 3384 )); -DATA(insert ( 4059 1082 1082 3 3385 )); -DATA(insert ( 4059 1082 1082 4 3386 )); -DATA(insert ( 4059 1082 1114 1 3383 )); -DATA(insert ( 4059 1082 1114 2 3384 )); -DATA(insert ( 4059 1082 1114 3 3385 )); -DATA(insert ( 4059 1082 1114 4 3386 )); -DATA(insert ( 4059 1082 1184 1 3383 )); -DATA(insert ( 4059 1082 1184 2 3384 )); -DATA(insert ( 4059 1082 1184 3 3385 )); -DATA(insert ( 4059 1082 1184 4 3386 )); - -/* minmax interval */ -DATA(insert ( 4078 1186 1186 1 3383 )); -DATA(insert ( 4078 1186 1186 2 3384 )); -DATA(insert ( 4078 1186 1186 3 3385 )); -DATA(insert ( 4078 1186 1186 4 3386 )); -/* minmax time with time zone */ -DATA(insert ( 4058 1266 1266 1 3383 )); -DATA(insert ( 4058 1266 1266 2 3384 )); -DATA(insert ( 4058 1266 1266 3 3385 )); -DATA(insert ( 4058 1266 1266 4 3386 )); -/* minmax bit */ -DATA(insert ( 4079 1560 1560 1 3383 )); -DATA(insert ( 4079 1560 1560 2 3384 )); -DATA(insert ( 4079 1560 1560 3 3385 )); -DATA(insert ( 4079 1560 1560 4 3386 )); -/* minmax bit varying */ -DATA(insert ( 4080 1562 1562 1 3383 )); -DATA(insert ( 4080 1562 1562 2 3384 )); -DATA(insert ( 4080 1562 1562 3 3385 )); -DATA(insert ( 4080 1562 1562 4 3386 )); -/* minmax numeric */ -DATA(insert ( 4055 1700 1700 1 3383 )); -DATA(insert ( 4055 1700 1700 2 3384 )); -DATA(insert ( 4055 1700 1700 3 3385 )); -DATA(insert ( 4055 1700 1700 4 3386 )); -/* minmax uuid */ -DATA(insert ( 4081 2950 2950 1 3383 )); -DATA(insert ( 4081 2950 2950 2 3384 )); -DATA(insert ( 4081 2950 2950 3 3385 )); -DATA(insert ( 4081 2950 2950 4 3386 )); -/* inclusion range types */ -DATA(insert ( 4103 3831 3831 1 4105 )); -DATA(insert ( 4103 3831 3831 2 4106 )); -DATA(insert ( 4103 3831 3831 3 4107 )); -DATA(insert ( 4103 3831 3831 4 4108 )); -DATA(insert ( 4103 3831 3831 11 4057 )); -DATA(insert ( 4103 3831 3831 13 3859 )); -DATA(insert ( 4103 3831 3831 14 3850 )); -/* minmax pg_lsn */ -DATA(insert ( 4082 3220 3220 1 3383 )); -DATA(insert ( 4082 3220 3220 2 3384 )); -DATA(insert ( 4082 3220 3220 3 3385 )); -DATA(insert ( 4082 3220 3220 4 3386 )); -/* inclusion box */ -DATA(insert ( 4104 603 603 1 4105 )); -DATA(insert ( 4104 603 603 2 4106 )); -DATA(insert ( 4104 603 603 3 4107 )); -DATA(insert ( 4104 603 603 4 4108 )); -DATA(insert ( 4104 603 603 11 4067 )); -DATA(insert ( 4104 603 603 13 187 )); - #endif /* PG_AMPROC_H */ diff --git a/src/include/catalog/pg_attrdef.h b/src/include/catalog/pg_attrdef.h index 8a8b8cac52d..16b106d9add 100644 --- a/src/include/catalog/pg_attrdef.h +++ b/src/include/catalog/pg_attrdef.h @@ -2,7 +2,6 @@ * * pg_attrdef.h * definition of the system "attribute defaults" relation (pg_attrdef) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_attrdef.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_ATTRDEF_H #include "catalog/genbki.h" +#include "catalog/pg_attrdef_d.h" /* ---------------- * pg_attrdef definition. cpp turns this into * typedef struct FormData_pg_attrdef * ---------------- */ -#define AttrDefaultRelationId 2604 - -CATALOG(pg_attrdef,2604) +CATALOG(pg_attrdef,2604,AttrDefaultRelationId) { Oid adrelid; /* OID of table containing attribute */ int16 adnum; /* attnum of attribute */ @@ -46,14 +44,4 @@ CATALOG(pg_attrdef,2604) */ typedef FormData_pg_attrdef *Form_pg_attrdef; -/* ---------------- - * compiler constants for pg_attrdef - * ---------------- - */ -#define Natts_pg_attrdef 4 -#define Anum_pg_attrdef_adrelid 1 -#define Anum_pg_attrdef_adnum 2 -#define Anum_pg_attrdef_adbin 3 -#define Anum_pg_attrdef_adsrc 4 - #endif /* PG_ATTRDEF_H */ diff --git a/src/include/catalog/pg_attribute.h b/src/include/catalog/pg_attribute.h index 5bb64f7c31d..8eef7d2fedc 100644 --- a/src/include/catalog/pg_attribute.h +++ b/src/include/catalog/pg_attribute.h @@ -2,7 +2,10 @@ * * pg_attribute.h * definition of the system "attribute" relation (pg_attribute) - * along with the relation's initial contents. + * + * The initial contents of pg_attribute are generated at compile time by + * genbki.pl, so there is no pg_attribute.dat file. Only "bootstrapped" + * relations need be included. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +14,8 @@ * src/include/catalog/pg_attribute.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,6 +23,7 @@ #define PG_ATTRIBUTE_H #include "catalog/genbki.h" +#include "catalog/pg_attribute_d.h" /* ---------------- * pg_attribute definition. cpp turns this into @@ -30,10 +34,7 @@ * You may need to change catalog/genbki.pl as well. * ---------------- */ -#define AttributeRelationId 1249 -#define AttributeRelation_Rowtype_Id 75 - -CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BKI_SCHEMA_MACRO +CATALOG(pg_attribute,1249,AttributeRelationId) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75,AttributeRelation_Rowtype_Id) BKI_SCHEMA_MACRO { Oid attrelid; /* OID of relation containing this attribute */ NameData attname; /* name of attribute */ @@ -137,7 +138,7 @@ CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BK bool atthasmissing BKI_DEFAULT(f); /* One of the ATTRIBUTE_IDENTITY_* constants below, or '\0' */ - char attidentity BKI_DEFAULT(""); + char attidentity BKI_DEFAULT('\0'); /* Is dropped (ie, logically invisible) or not */ bool attisdropped BKI_DEFAULT(f); @@ -195,47 +196,11 @@ CATALOG(pg_attribute,1249) BKI_BOOTSTRAP BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(75) BK */ typedef FormData_pg_attribute *Form_pg_attribute; -/* ---------------- - * compiler constants for pg_attribute - * ---------------- - */ - -#define Natts_pg_attribute 24 -#define Anum_pg_attribute_attrelid 1 -#define Anum_pg_attribute_attname 2 -#define Anum_pg_attribute_atttypid 3 -#define Anum_pg_attribute_attstattarget 4 -#define Anum_pg_attribute_attlen 5 -#define Anum_pg_attribute_attnum 6 -#define Anum_pg_attribute_attndims 7 -#define Anum_pg_attribute_attcacheoff 8 -#define Anum_pg_attribute_atttypmod 9 -#define Anum_pg_attribute_attbyval 10 -#define Anum_pg_attribute_attstorage 11 -#define Anum_pg_attribute_attalign 12 -#define Anum_pg_attribute_attnotnull 13 -#define Anum_pg_attribute_atthasdef 14 -#define Anum_pg_attribute_atthasmissing 15 -#define Anum_pg_attribute_attidentity 16 -#define Anum_pg_attribute_attisdropped 17 -#define Anum_pg_attribute_attislocal 18 -#define Anum_pg_attribute_attinhcount 19 -#define Anum_pg_attribute_attcollation 20 -#define Anum_pg_attribute_attacl 21 -#define Anum_pg_attribute_attoptions 22 -#define Anum_pg_attribute_attfdwoptions 23 -#define Anum_pg_attribute_attmissingval 24 - -/* ---------------- - * initial contents of pg_attribute - * - * The initial contents of pg_attribute are generated at compile time by - * genbki.pl. Only "bootstrapped" relations need be included. - * ---------------- - */ - +#ifdef EXPOSE_TO_CLIENT_CODE #define ATTRIBUTE_IDENTITY_ALWAYS 'a' #define ATTRIBUTE_IDENTITY_BY_DEFAULT 'd' +#endif /* EXPOSE_TO_CLIENT_CODE */ + #endif /* PG_ATTRIBUTE_H */ diff --git a/src/include/catalog/pg_auth_members.h b/src/include/catalog/pg_auth_members.h index ae3c14aa7a1..75bc2baa14c 100644 --- a/src/include/catalog/pg_auth_members.h +++ b/src/include/catalog/pg_auth_members.h @@ -2,7 +2,7 @@ * * pg_auth_members.h * definition of the system "authorization identifier members" relation - * (pg_auth_members) along with the relation's initial contents. + * (pg_auth_members). * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +11,8 @@ * src/include/catalog/pg_auth_members.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,16 +20,14 @@ #define PG_AUTH_MEMBERS_H #include "catalog/genbki.h" +#include "catalog/pg_auth_members_d.h" /* ---------------- * pg_auth_members definition. cpp turns this into * typedef struct FormData_pg_auth_members * ---------------- */ -#define AuthMemRelationId 1261 -#define AuthMemRelation_Rowtype_Id 2843 - -CATALOG(pg_auth_members,1261) BKI_SHARED_RELATION BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(2843) BKI_SCHEMA_MACRO +CATALOG(pg_auth_members,1261,AuthMemRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS BKI_ROWTYPE_OID(2843,AuthMemRelation_Rowtype_Id) BKI_SCHEMA_MACRO { Oid roleid; /* ID of a role */ Oid member; /* ID of a member of that role */ @@ -44,14 +42,4 @@ CATALOG(pg_auth_members,1261) BKI_SHARED_RELATION BKI_WITHOUT_OIDS BKI_ROWTYPE_O */ typedef FormData_pg_auth_members *Form_pg_auth_members; -/* ---------------- - * compiler constants for pg_auth_members - * ---------------- - */ -#define Natts_pg_auth_members 4 -#define Anum_pg_auth_members_roleid 1 -#define Anum_pg_auth_members_member 2 -#define Anum_pg_auth_members_grantor 3 -#define Anum_pg_auth_members_admin_option 4 - #endif /* PG_AUTH_MEMBERS_H */ diff --git a/src/include/catalog/pg_authid.dat b/src/include/catalog/pg_authid.dat new file mode 100644 index 00000000000..52f42595600 --- /dev/null +++ b/src/include/catalog/pg_authid.dat @@ -0,0 +1,67 @@ +#---------------------------------------------------------------------- +# +# pg_authid.dat +# Initial contents of the pg_authid system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_authid.dat +# +#---------------------------------------------------------------------- + +[ + +# POSTGRES will be replaced at initdb time with a user choice that might +# contain non-word characters, so we must double-quote it. + +# The C code typically refers to these roles using the #define symbols, +# so make sure every entry has an oid_symbol value. + +{ oid => '10', oid_symbol => 'BOOTSTRAP_SUPERUSERID', + rolname => '"POSTGRES"', rolsuper => 't', rolinherit => 't', + rolcreaterole => 't', rolcreatedb => 't', rolcanlogin => 't', + rolreplication => 't', rolbypassrls => 't', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '3373', oid_symbol => 'DEFAULT_ROLE_MONITOR', + rolname => 'pg_monitor', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '3374', oid_symbol => 'DEFAULT_ROLE_READ_ALL_SETTINGS', + rolname => 'pg_read_all_settings', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '3375', oid_symbol => 'DEFAULT_ROLE_READ_ALL_STATS', + rolname => 'pg_read_all_stats', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '3377', oid_symbol => 'DEFAULT_ROLE_STAT_SCAN_TABLES', + rolname => 'pg_stat_scan_tables', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '4569', oid_symbol => 'DEFAULT_ROLE_READ_SERVER_FILES', + rolname => 'pg_read_server_files', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '4570', oid_symbol => 'DEFAULT_ROLE_WRITE_SERVER_FILES', + rolname => 'pg_write_server_files', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '4571', oid_symbol => 'DEFAULT_ROLE_EXECUTE_SERVER_PROGRAM', + rolname => 'pg_execute_server_program', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, +{ oid => '4200', oid_symbol => 'DEFAULT_ROLE_SIGNAL_BACKENDID', + rolname => 'pg_signal_backend', rolsuper => 'f', rolinherit => 't', + rolcreaterole => 'f', rolcreatedb => 'f', rolcanlogin => 'f', + rolreplication => 'f', rolbypassrls => 'f', rolconnlimit => '-1', + rolpassword => '_null_', rolvaliduntil => '_null_' }, + +] diff --git a/src/include/catalog/pg_authid.h b/src/include/catalog/pg_authid.h index 8e98513530b..863ef65ebfa 100644 --- a/src/include/catalog/pg_authid.h +++ b/src/include/catalog/pg_authid.h @@ -2,7 +2,6 @@ * * pg_authid.h * definition of the system "authorization identifier" relation (pg_authid) - * along with the relation's initial contents. * * pg_shadow and pg_group are now publicly accessible views on pg_authid. * @@ -13,8 +12,8 @@ * src/include/catalog/pg_authid.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -22,27 +21,14 @@ #define PG_AUTHID_H #include "catalog/genbki.h" - -/* - * The CATALOG definition has to refer to the type of rolvaliduntil as - * "timestamptz" (lower case) so that bootstrap mode recognizes it. But - * the C header files define this type as TimestampTz. Since the field is - * potentially-null and therefore can't be accessed directly from C code, - * there is no particular need for the C struct definition to show the - * field type as TimestampTz --- instead we just make it int. - */ -#define timestamptz int - +#include "catalog/pg_authid_d.h" /* ---------------- * pg_authid definition. cpp turns this into * typedef struct FormData_pg_authid * ---------------- */ -#define AuthIdRelationId 1260 -#define AuthIdRelation_Rowtype_Id 2842 - -CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MACRO +CATALOG(pg_authid,1260,AuthIdRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842,AuthIdRelation_Rowtype_Id) BKI_SCHEMA_MACRO { NameData rolname; /* name of role */ bool rolsuper; /* read this field via superuser() only! */ @@ -61,9 +47,6 @@ CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MAC #endif } FormData_pg_authid; -#undef timestamptz - - /* ---------------- * Form_pg_authid corresponds to a pointer to a tuple with * the format of pg_authid relation. @@ -71,50 +54,4 @@ CATALOG(pg_authid,1260) BKI_SHARED_RELATION BKI_ROWTYPE_OID(2842) BKI_SCHEMA_MAC */ typedef FormData_pg_authid *Form_pg_authid; -/* ---------------- - * compiler constants for pg_authid - * ---------------- - */ -#define Natts_pg_authid 11 -#define Anum_pg_authid_rolname 1 -#define Anum_pg_authid_rolsuper 2 -#define Anum_pg_authid_rolinherit 3 -#define Anum_pg_authid_rolcreaterole 4 -#define Anum_pg_authid_rolcreatedb 5 -#define Anum_pg_authid_rolcanlogin 6 -#define Anum_pg_authid_rolreplication 7 -#define Anum_pg_authid_rolbypassrls 8 -#define Anum_pg_authid_rolconnlimit 9 -#define Anum_pg_authid_rolpassword 10 -#define Anum_pg_authid_rolvaliduntil 11 - -/* ---------------- - * initial contents of pg_authid - * - * The uppercase quantities will be replaced at initdb time with - * user choices. - * - * The C code typically refers to these roles using the #define symbols, - * so be sure to keep those in sync with the DATA lines. - * ---------------- - */ -DATA(insert OID = 10 ( "POSTGRES" t t t t t t t -1 _null_ _null_)); -#define BOOTSTRAP_SUPERUSERID 10 -DATA(insert OID = 3373 ( pg_monitor f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_MONITOR 3373 -DATA(insert OID = 3374 ( pg_read_all_settings f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_READ_ALL_SETTINGS 3374 -DATA(insert OID = 3375 ( pg_read_all_stats f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_READ_ALL_STATS 3375 -DATA(insert OID = 3377 ( pg_stat_scan_tables f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_STAT_SCAN_TABLES 3377 -DATA(insert OID = 4569 ( pg_read_server_files f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_READ_SERVER_FILES 4569 -DATA(insert OID = 4570 ( pg_write_server_files f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_WRITE_SERVER_FILES 4570 -DATA(insert OID = 4571 ( pg_execute_server_program f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_EXECUTE_SERVER_PROGRAM 4571 -DATA(insert OID = 4200 ( pg_signal_backend f t f f f f f -1 _null_ _null_)); -#define DEFAULT_ROLE_SIGNAL_BACKENDID 4200 - #endif /* PG_AUTHID_H */ diff --git a/src/include/catalog/pg_cast.dat b/src/include/catalog/pg_cast.dat new file mode 100644 index 00000000000..c335a7686d5 --- /dev/null +++ b/src/include/catalog/pg_cast.dat @@ -0,0 +1,535 @@ +#---------------------------------------------------------------------- +# +# pg_cast.dat +# Initial contents of the pg_cast system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_cast.dat +# +#---------------------------------------------------------------------- + +[ + +# Note: this table has OIDs, but we don't bother to assign them manually, +# since nothing needs to know the specific OID of any built-in cast. + +# Numeric category: implicit casts are allowed in the direction +# int2->int4->int8->numeric->float4->float8, while casts in the +# reverse direction are assignment-only. +{ castsource => 'int8', casttarget => 'int2', castfunc => 'int2(int8)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'int8', casttarget => 'int4', castfunc => 'int4(int8)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'int8', casttarget => 'float4', castfunc => 'float4(int8)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int8', casttarget => 'float8', castfunc => 'float8(int8)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int8', casttarget => 'numeric', castfunc => 'numeric(int8)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'int8', castfunc => 'int8(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'int4', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'float4', castfunc => 'float4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'float8', castfunc => 'float8(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'numeric', castfunc => 'numeric(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'int8', castfunc => 'int8(int4)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'int2', castfunc => 'int2(int4)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'float4', castfunc => 'float4(int4)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'float8', castfunc => 'float8(int4)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'numeric', castfunc => 'numeric(int4)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'float4', casttarget => 'int8', castfunc => 'int8(float4)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float4', casttarget => 'int2', castfunc => 'int2(float4)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float4', casttarget => 'int4', castfunc => 'int4(float4)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float4', casttarget => 'float8', castfunc => 'float8(float4)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'float4', casttarget => 'numeric', + castfunc => 'numeric(float4)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float8', casttarget => 'int8', castfunc => 'int8(float8)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float8', casttarget => 'int2', castfunc => 'int2(float8)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float8', casttarget => 'int4', castfunc => 'int4(float8)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float8', casttarget => 'float4', castfunc => 'float4(float8)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'float8', casttarget => 'numeric', + castfunc => 'numeric(float8)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'numeric', casttarget => 'int8', castfunc => 'int8(numeric)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'numeric', casttarget => 'int2', castfunc => 'int2(numeric)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'numeric', casttarget => 'int4', castfunc => 'int4(numeric)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'numeric', casttarget => 'float4', + castfunc => 'float4(numeric)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'numeric', casttarget => 'float8', + castfunc => 'float8(numeric)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'money', casttarget => 'numeric', castfunc => 'numeric(money)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'numeric', casttarget => 'money', castfunc => 'money(numeric)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'money', castfunc => 'money(int4)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'int8', casttarget => 'money', castfunc => 'money(int8)', + castcontext => 'a', castmethod => 'f' }, + +# Allow explicit coercions between int4 and bool +{ castsource => 'int4', casttarget => 'bool', castfunc => 'bool(int4)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'bool', casttarget => 'int4', castfunc => 'int4(bool)', + castcontext => 'e', castmethod => 'f' }, + +# OID category: allow implicit conversion from any integral type (including +# int8, to support OID literals > 2G) to OID, as well as assignment coercion +# from OID to int4 or int8. Similarly for each OID-alias type. Also allow +# implicit coercions between OID and each OID-alias type, as well as +# regproc<->regprocedure and regoper<->regoperator. (Other coercions +# between alias types must pass through OID.) Lastly, there are implicit +# casts from text and varchar to regclass, which exist mainly to support +# legacy forms of nextval() and related functions. +{ castsource => 'int8', casttarget => 'oid', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'oid', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'oid', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regproc', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regproc', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regproc', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regproc', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regproc', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regproc', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regproc', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'regproc', casttarget => 'regprocedure', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regprocedure', casttarget => 'regproc', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regprocedure', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regprocedure', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regprocedure', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regprocedure', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regprocedure', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regprocedure', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regprocedure', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regoper', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regoper', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regoper', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regoper', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regoper', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regoper', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regoper', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'regoper', casttarget => 'regoperator', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regoperator', casttarget => 'regoper', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regoperator', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regoperator', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regoperator', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regoperator', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regoperator', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regoperator', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regoperator', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regclass', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regclass', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regclass', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regclass', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regclass', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regclass', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regclass', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regtype', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regtype', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regtype', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regtype', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regtype', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regtype', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regtype', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regconfig', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regconfig', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regconfig', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regconfig', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regconfig', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regconfig', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regconfig', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regdictionary', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regdictionary', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regdictionary', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regdictionary', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regdictionary', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regdictionary', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regdictionary', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'text', casttarget => 'regclass', castfunc => 'regclass', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'varchar', casttarget => 'regclass', castfunc => 'regclass', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'oid', casttarget => 'regrole', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regrole', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regrole', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regrole', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regrole', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regrole', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regrole', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'oid', casttarget => 'regnamespace', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regnamespace', casttarget => 'oid', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'int8', casttarget => 'regnamespace', castfunc => 'oid', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int2', casttarget => 'regnamespace', castfunc => 'int4(int2)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'regnamespace', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'regnamespace', casttarget => 'int8', castfunc => 'int8(oid)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'regnamespace', casttarget => 'int4', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, + +# String category +{ castsource => 'text', casttarget => 'bpchar', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'text', casttarget => 'varchar', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'bpchar', casttarget => 'text', castfunc => 'text(bpchar)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'bpchar', casttarget => 'varchar', castfunc => 'text(bpchar)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'varchar', casttarget => 'text', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'varchar', casttarget => 'bpchar', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'char', casttarget => 'text', castfunc => 'text(char)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'char', casttarget => 'bpchar', castfunc => 'bpchar(char)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'char', casttarget => 'varchar', castfunc => 'text(char)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'name', casttarget => 'text', castfunc => 'text(name)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'name', casttarget => 'bpchar', castfunc => 'bpchar(name)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'name', casttarget => 'varchar', castfunc => 'varchar(name)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'text', casttarget => 'char', castfunc => 'char(text)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'bpchar', casttarget => 'char', castfunc => 'char(text)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'varchar', casttarget => 'char', castfunc => 'char(text)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'text', casttarget => 'name', castfunc => 'name(text)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'bpchar', casttarget => 'name', castfunc => 'name(bpchar)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'varchar', casttarget => 'name', castfunc => 'name(varchar)', + castcontext => 'i', castmethod => 'f' }, + +# Allow explicit coercions between int4 and "char" +{ castsource => 'char', casttarget => 'int4', castfunc => 'int4(char)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'char', castfunc => 'char(int4)', + castcontext => 'e', castmethod => 'f' }, + +# pg_node_tree can be coerced to, but not from, text +{ castsource => 'pg_node_tree', casttarget => 'text', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, + +# pg_ndistinct can be coerced to, but not from, bytea and text +{ castsource => 'pg_ndistinct', casttarget => 'bytea', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'pg_ndistinct', casttarget => 'text', castfunc => '0', + castcontext => 'i', castmethod => 'i' }, + +# pg_dependencies can be coerced to, but not from, bytea and text +{ castsource => 'pg_dependencies', casttarget => 'bytea', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'pg_dependencies', casttarget => 'text', castfunc => '0', + castcontext => 'i', castmethod => 'i' }, + +# Datetime category +{ castsource => 'abstime', casttarget => 'date', castfunc => 'date(abstime)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'abstime', casttarget => 'time', castfunc => 'time(abstime)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'abstime', casttarget => 'timestamp', + castfunc => 'timestamp(abstime)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'abstime', casttarget => 'timestamptz', + castfunc => 'timestamptz(abstime)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'reltime', casttarget => 'interval', + castfunc => 'interval(reltime)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'date', casttarget => 'timestamp', + castfunc => 'timestamp(date)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'date', casttarget => 'timestamptz', + castfunc => 'timestamptz(date)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'time', casttarget => 'interval', castfunc => 'interval(time)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'time', casttarget => 'timetz', castfunc => 'timetz(time)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'timestamp', casttarget => 'abstime', + castfunc => 'abstime(timestamp)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timestamp', casttarget => 'date', + castfunc => 'date(timestamp)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timestamp', casttarget => 'time', + castfunc => 'time(timestamp)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timestamp', casttarget => 'timestamptz', + castfunc => 'timestamptz(timestamp)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'timestamptz', casttarget => 'abstime', + castfunc => 'abstime(timestamptz)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timestamptz', casttarget => 'date', + castfunc => 'date(timestamptz)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timestamptz', casttarget => 'time', + castfunc => 'time(timestamptz)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timestamptz', casttarget => 'timestamp', + castfunc => 'timestamp(timestamptz)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timestamptz', casttarget => 'timetz', + castfunc => 'timetz(timestamptz)', castcontext => 'a', castmethod => 'f' }, +{ castsource => 'interval', casttarget => 'reltime', castfunc => 'reltime', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'interval', casttarget => 'time', castfunc => 'time(interval)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'timetz', casttarget => 'time', castfunc => 'time(timetz)', + castcontext => 'a', castmethod => 'f' }, + +# Cross-category casts between int4 and abstime, reltime +{ castsource => 'int4', casttarget => 'abstime', castfunc => '0', + castcontext => 'e', castmethod => 'b' }, +{ castsource => 'abstime', casttarget => 'int4', castfunc => '0', + castcontext => 'e', castmethod => 'b' }, +{ castsource => 'int4', casttarget => 'reltime', castfunc => '0', + castcontext => 'e', castmethod => 'b' }, +{ castsource => 'reltime', casttarget => 'int4', castfunc => '0', + castcontext => 'e', castmethod => 'b' }, + +# Geometric category +{ castsource => 'point', casttarget => 'box', castfunc => 'box(point)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'lseg', casttarget => 'point', castfunc => 'point(lseg)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'path', casttarget => 'point', castfunc => 'point(path)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'path', casttarget => 'polygon', castfunc => 'polygon(path)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'box', casttarget => 'point', castfunc => 'point(box)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'box', casttarget => 'lseg', castfunc => 'lseg(box)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'box', casttarget => 'polygon', castfunc => 'polygon(box)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'box', casttarget => 'circle', castfunc => 'circle(box)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'polygon', casttarget => 'point', castfunc => 'point(polygon)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'polygon', casttarget => 'path', castfunc => 'path', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'polygon', casttarget => 'box', castfunc => 'box(polygon)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'polygon', casttarget => 'circle', + castfunc => 'circle(polygon)', castcontext => 'e', castmethod => 'f' }, +{ castsource => 'circle', casttarget => 'point', castfunc => 'point(circle)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'circle', casttarget => 'box', castfunc => 'box(circle)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'circle', casttarget => 'polygon', + castfunc => 'polygon(circle)', castcontext => 'e', castmethod => 'f' }, + +# MAC address category +{ castsource => 'macaddr', casttarget => 'macaddr8', castfunc => 'macaddr8', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'macaddr8', casttarget => 'macaddr', castfunc => 'macaddr', + castcontext => 'i', castmethod => 'f' }, + +# INET category +{ castsource => 'cidr', casttarget => 'inet', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'inet', casttarget => 'cidr', castfunc => 'cidr', + castcontext => 'a', castmethod => 'f' }, + +# BitString category +{ castsource => 'bit', casttarget => 'varbit', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, +{ castsource => 'varbit', casttarget => 'bit', castfunc => '0', + castcontext => 'i', castmethod => 'b' }, + +# Cross-category casts between bit and int4, int8 +{ castsource => 'int8', casttarget => 'bit', castfunc => 'bit(int8,int4)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'int4', casttarget => 'bit', castfunc => 'bit(int4,int4)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'bit', casttarget => 'int8', castfunc => 'int8(bit)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'bit', casttarget => 'int4', castfunc => 'int4(bit)', + castcontext => 'e', castmethod => 'f' }, + +# Cross-category casts to and from TEXT +# We need entries here only for a few specialized cases where the behavior +# of the cast function differs from the datatype's I/O functions. Otherwise, +# parse_coerce.c will generate CoerceViaIO operations without any prompting. +# Note that the castcontext values specified here should be no stronger than +# parse_coerce.c's automatic casts ('a' to text, 'e' from text) else odd +# behavior will ensue when the automatic cast is applied instead of the +# pg_cast entry! +{ castsource => 'cidr', casttarget => 'text', castfunc => 'text(inet)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'inet', casttarget => 'text', castfunc => 'text(inet)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'bool', casttarget => 'text', castfunc => 'text(bool)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'xml', casttarget => 'text', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'text', casttarget => 'xml', castfunc => 'xml', + castcontext => 'e', castmethod => 'f' }, + +# Cross-category casts to and from VARCHAR +# We support all the same casts as for TEXT. +{ castsource => 'cidr', casttarget => 'varchar', castfunc => 'text(inet)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'inet', casttarget => 'varchar', castfunc => 'text(inet)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'bool', casttarget => 'varchar', castfunc => 'text(bool)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'xml', casttarget => 'varchar', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'varchar', casttarget => 'xml', castfunc => 'xml', + castcontext => 'e', castmethod => 'f' }, + +# Cross-category casts to and from BPCHAR +# We support all the same casts as for TEXT. +{ castsource => 'cidr', casttarget => 'bpchar', castfunc => 'text(inet)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'inet', casttarget => 'bpchar', castfunc => 'text(inet)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'bool', casttarget => 'bpchar', castfunc => 'text(bool)', + castcontext => 'a', castmethod => 'f' }, +{ castsource => 'xml', casttarget => 'bpchar', castfunc => '0', + castcontext => 'a', castmethod => 'b' }, +{ castsource => 'bpchar', casttarget => 'xml', castfunc => 'xml', + castcontext => 'e', castmethod => 'f' }, + +# Length-coercion functions +{ castsource => 'bpchar', casttarget => 'bpchar', + castfunc => 'bpchar(bpchar,int4,bool)', castcontext => 'i', + castmethod => 'f' }, +{ castsource => 'varchar', casttarget => 'varchar', + castfunc => 'varchar(varchar,int4,bool)', castcontext => 'i', + castmethod => 'f' }, +{ castsource => 'time', casttarget => 'time', castfunc => 'time(time,int4)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'timestamp', casttarget => 'timestamp', + castfunc => 'timestamp(timestamp,int4)', castcontext => 'i', + castmethod => 'f' }, +{ castsource => 'timestamptz', casttarget => 'timestamptz', + castfunc => 'timestamptz(timestamptz,int4)', castcontext => 'i', + castmethod => 'f' }, +{ castsource => 'interval', casttarget => 'interval', + castfunc => 'interval(interval,int4)', castcontext => 'i', + castmethod => 'f' }, +{ castsource => 'timetz', casttarget => 'timetz', + castfunc => 'timetz(timetz,int4)', castcontext => 'i', castmethod => 'f' }, +{ castsource => 'bit', casttarget => 'bit', castfunc => 'bit(bit,int4,bool)', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'varbit', casttarget => 'varbit', castfunc => 'varbit', + castcontext => 'i', castmethod => 'f' }, +{ castsource => 'numeric', casttarget => 'numeric', + castfunc => 'numeric(numeric,int4)', castcontext => 'i', castmethod => 'f' }, + +# json to/from jsonb +{ castsource => 'json', casttarget => 'jsonb', castfunc => '0', + castcontext => 'a', castmethod => 'i' }, +{ castsource => 'jsonb', casttarget => 'json', castfunc => '0', + castcontext => 'a', castmethod => 'i' }, + +# jsonb to numeric and bool types +{ castsource => 'jsonb', casttarget => 'bool', castfunc => 'bool(jsonb)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'jsonb', casttarget => 'numeric', castfunc => 'numeric(jsonb)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'jsonb', casttarget => 'int2', castfunc => 'int2(jsonb)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'jsonb', casttarget => 'int4', castfunc => 'int4(jsonb)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'jsonb', casttarget => 'int8', castfunc => 'int8(jsonb)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'jsonb', casttarget => 'float4', castfunc => 'float4(jsonb)', + castcontext => 'e', castmethod => 'f' }, +{ castsource => 'jsonb', casttarget => 'float8', castfunc => 'float8(jsonb)', + castcontext => 'e', castmethod => 'f' }, + +] diff --git a/src/include/catalog/pg_cast.h b/src/include/catalog/pg_cast.h index c47fb5bd0dd..10c796ab02e 100644 --- a/src/include/catalog/pg_cast.h +++ b/src/include/catalog/pg_cast.h @@ -2,7 +2,6 @@ * * pg_cast.h * definition of the system "type casts" relation (pg_cast) - * along with the relation's initial contents. * * As of Postgres 8.0, pg_cast describes not only type coercion functions * but also length coercion functions. @@ -13,8 +12,8 @@ * src/include/catalog/pg_cast.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -22,25 +21,40 @@ #define PG_CAST_H #include "catalog/genbki.h" +#include "catalog/pg_cast_d.h" /* ---------------- * pg_cast definition. cpp turns this into * typedef struct FormData_pg_cast * ---------------- */ -#define CastRelationId 2605 - -CATALOG(pg_cast,2605) +CATALOG(pg_cast,2605,CastRelationId) { - Oid castsource; /* source datatype for cast */ - Oid casttarget; /* destination datatype for cast */ - Oid castfunc; /* cast function; 0 = binary coercible */ - char castcontext; /* contexts in which cast can be used */ - char castmethod; /* cast method */ + /* source datatype for cast */ + Oid castsource BKI_LOOKUP(pg_type); + + /* destination datatype for cast */ + Oid casttarget BKI_LOOKUP(pg_type); + + /* cast function; 0 = binary coercible */ + Oid castfunc BKI_LOOKUP(pg_proc); + + /* contexts in which cast can be used */ + char castcontext; + + /* cast method */ + char castmethod; } FormData_pg_cast; +/* ---------------- + * Form_pg_cast corresponds to a pointer to a tuple with + * the format of pg_cast relation. + * ---------------- + */ typedef FormData_pg_cast *Form_pg_cast; +#ifdef EXPOSE_TO_CLIENT_CODE + /* * The allowable values for pg_cast.castcontext are specified by this enum. * Since castcontext is stored as a "char", we use ASCII codes for human @@ -69,336 +83,6 @@ typedef enum CoercionMethod COERCION_METHOD_INOUT = 'i' /* use input/output functions */ } CoercionMethod; - -/* ---------------- - * compiler constants for pg_cast - * ---------------- - */ -#define Natts_pg_cast 5 -#define Anum_pg_cast_castsource 1 -#define Anum_pg_cast_casttarget 2 -#define Anum_pg_cast_castfunc 3 -#define Anum_pg_cast_castcontext 4 -#define Anum_pg_cast_castmethod 5 - -/* ---------------- - * initial contents of pg_cast - * - * Note: this table has OIDs, but we don't bother to assign them manually, - * since nothing needs to know the specific OID of any built-in cast. - * ---------------- - */ - -/* - * Numeric category: implicit casts are allowed in the direction - * int2->int4->int8->numeric->float4->float8, while casts in the - * reverse direction are assignment-only. - */ -DATA(insert ( 20 21 714 a f )); -DATA(insert ( 20 23 480 a f )); -DATA(insert ( 20 700 652 i f )); -DATA(insert ( 20 701 482 i f )); -DATA(insert ( 20 1700 1781 i f )); -DATA(insert ( 21 20 754 i f )); -DATA(insert ( 21 23 313 i f )); -DATA(insert ( 21 700 236 i f )); -DATA(insert ( 21 701 235 i f )); -DATA(insert ( 21 1700 1782 i f )); -DATA(insert ( 23 20 481 i f )); -DATA(insert ( 23 21 314 a f )); -DATA(insert ( 23 700 318 i f )); -DATA(insert ( 23 701 316 i f )); -DATA(insert ( 23 1700 1740 i f )); -DATA(insert ( 700 20 653 a f )); -DATA(insert ( 700 21 238 a f )); -DATA(insert ( 700 23 319 a f )); -DATA(insert ( 700 701 311 i f )); -DATA(insert ( 700 1700 1742 a f )); -DATA(insert ( 701 20 483 a f )); -DATA(insert ( 701 21 237 a f )); -DATA(insert ( 701 23 317 a f )); -DATA(insert ( 701 700 312 a f )); -DATA(insert ( 701 1700 1743 a f )); -DATA(insert ( 1700 20 1779 a f )); -DATA(insert ( 1700 21 1783 a f )); -DATA(insert ( 1700 23 1744 a f )); -DATA(insert ( 1700 700 1745 i f )); -DATA(insert ( 1700 701 1746 i f )); -DATA(insert ( 790 1700 3823 a f )); -DATA(insert ( 1700 790 3824 a f )); -DATA(insert ( 23 790 3811 a f )); -DATA(insert ( 20 790 3812 a f )); - -/* Allow explicit coercions between int4 and bool */ -DATA(insert ( 23 16 2557 e f )); -DATA(insert ( 16 23 2558 e f )); - -/* - * OID category: allow implicit conversion from any integral type (including - * int8, to support OID literals > 2G) to OID, as well as assignment coercion - * from OID to int4 or int8. Similarly for each OID-alias type. Also allow - * implicit coercions between OID and each OID-alias type, as well as - * regproc<->regprocedure and regoper<->regoperator. (Other coercions - * between alias types must pass through OID.) Lastly, there are implicit - * casts from text and varchar to regclass, which exist mainly to support - * legacy forms of nextval() and related functions. - */ -DATA(insert ( 20 26 1287 i f )); -DATA(insert ( 21 26 313 i f )); -DATA(insert ( 23 26 0 i b )); -DATA(insert ( 26 20 1288 a f )); -DATA(insert ( 26 23 0 a b )); -DATA(insert ( 26 24 0 i b )); -DATA(insert ( 24 26 0 i b )); -DATA(insert ( 20 24 1287 i f )); -DATA(insert ( 21 24 313 i f )); -DATA(insert ( 23 24 0 i b )); -DATA(insert ( 24 20 1288 a f )); -DATA(insert ( 24 23 0 a b )); -DATA(insert ( 24 2202 0 i b )); -DATA(insert ( 2202 24 0 i b )); -DATA(insert ( 26 2202 0 i b )); -DATA(insert ( 2202 26 0 i b )); -DATA(insert ( 20 2202 1287 i f )); -DATA(insert ( 21 2202 313 i f )); -DATA(insert ( 23 2202 0 i b )); -DATA(insert ( 2202 20 1288 a f )); -DATA(insert ( 2202 23 0 a b )); -DATA(insert ( 26 2203 0 i b )); -DATA(insert ( 2203 26 0 i b )); -DATA(insert ( 20 2203 1287 i f )); -DATA(insert ( 21 2203 313 i f )); -DATA(insert ( 23 2203 0 i b )); -DATA(insert ( 2203 20 1288 a f )); -DATA(insert ( 2203 23 0 a b )); -DATA(insert ( 2203 2204 0 i b )); -DATA(insert ( 2204 2203 0 i b )); -DATA(insert ( 26 2204 0 i b )); -DATA(insert ( 2204 26 0 i b )); -DATA(insert ( 20 2204 1287 i f )); -DATA(insert ( 21 2204 313 i f )); -DATA(insert ( 23 2204 0 i b )); -DATA(insert ( 2204 20 1288 a f )); -DATA(insert ( 2204 23 0 a b )); -DATA(insert ( 26 2205 0 i b )); -DATA(insert ( 2205 26 0 i b )); -DATA(insert ( 20 2205 1287 i f )); -DATA(insert ( 21 2205 313 i f )); -DATA(insert ( 23 2205 0 i b )); -DATA(insert ( 2205 20 1288 a f )); -DATA(insert ( 2205 23 0 a b )); -DATA(insert ( 26 2206 0 i b )); -DATA(insert ( 2206 26 0 i b )); -DATA(insert ( 20 2206 1287 i f )); -DATA(insert ( 21 2206 313 i f )); -DATA(insert ( 23 2206 0 i b )); -DATA(insert ( 2206 20 1288 a f )); -DATA(insert ( 2206 23 0 a b )); -DATA(insert ( 26 3734 0 i b )); -DATA(insert ( 3734 26 0 i b )); -DATA(insert ( 20 3734 1287 i f )); -DATA(insert ( 21 3734 313 i f )); -DATA(insert ( 23 3734 0 i b )); -DATA(insert ( 3734 20 1288 a f )); -DATA(insert ( 3734 23 0 a b )); -DATA(insert ( 26 3769 0 i b )); -DATA(insert ( 3769 26 0 i b )); -DATA(insert ( 20 3769 1287 i f )); -DATA(insert ( 21 3769 313 i f )); -DATA(insert ( 23 3769 0 i b )); -DATA(insert ( 3769 20 1288 a f )); -DATA(insert ( 3769 23 0 a b )); -DATA(insert ( 25 2205 1079 i f )); -DATA(insert ( 1043 2205 1079 i f )); -DATA(insert ( 26 4096 0 i b )); -DATA(insert ( 4096 26 0 i b )); -DATA(insert ( 20 4096 1287 i f )); -DATA(insert ( 21 4096 313 i f )); -DATA(insert ( 23 4096 0 i b )); -DATA(insert ( 4096 20 1288 a f )); -DATA(insert ( 4096 23 0 a b )); -DATA(insert ( 26 4089 0 i b )); -DATA(insert ( 4089 26 0 i b )); -DATA(insert ( 20 4089 1287 i f )); -DATA(insert ( 21 4089 313 i f )); -DATA(insert ( 23 4089 0 i b )); -DATA(insert ( 4089 20 1288 a f )); -DATA(insert ( 4089 23 0 a b )); - -/* - * String category - */ -DATA(insert ( 25 1042 0 i b )); -DATA(insert ( 25 1043 0 i b )); -DATA(insert ( 1042 25 401 i f )); -DATA(insert ( 1042 1043 401 i f )); -DATA(insert ( 1043 25 0 i b )); -DATA(insert ( 1043 1042 0 i b )); -DATA(insert ( 18 25 946 i f )); -DATA(insert ( 18 1042 860 a f )); -DATA(insert ( 18 1043 946 a f )); -DATA(insert ( 19 25 406 i f )); -DATA(insert ( 19 1042 408 a f )); -DATA(insert ( 19 1043 1401 a f )); -DATA(insert ( 25 18 944 a f )); -DATA(insert ( 1042 18 944 a f )); -DATA(insert ( 1043 18 944 a f )); -DATA(insert ( 25 19 407 i f )); -DATA(insert ( 1042 19 409 i f )); -DATA(insert ( 1043 19 1400 i f )); - -/* Allow explicit coercions between int4 and "char" */ -DATA(insert ( 18 23 77 e f )); -DATA(insert ( 23 18 78 e f )); - -/* pg_node_tree can be coerced to, but not from, text */ -DATA(insert ( 194 25 0 i b )); - -/* pg_ndistinct can be coerced to, but not from, bytea and text */ -DATA(insert ( 3361 17 0 i b )); -DATA(insert ( 3361 25 0 i i )); - -/* pg_dependencies can be coerced to, but not from, bytea and text */ -DATA(insert ( 3402 17 0 i b )); -DATA(insert ( 3402 25 0 i i )); - -/* - * Datetime category - */ -DATA(insert ( 702 1082 1179 a f )); -DATA(insert ( 702 1083 1364 a f )); -DATA(insert ( 702 1114 2023 i f )); -DATA(insert ( 702 1184 1173 i f )); -DATA(insert ( 703 1186 1177 i f )); -DATA(insert ( 1082 1114 2024 i f )); -DATA(insert ( 1082 1184 1174 i f )); -DATA(insert ( 1083 1186 1370 i f )); -DATA(insert ( 1083 1266 2047 i f )); -DATA(insert ( 1114 702 2030 a f )); -DATA(insert ( 1114 1082 2029 a f )); -DATA(insert ( 1114 1083 1316 a f )); -DATA(insert ( 1114 1184 2028 i f )); -DATA(insert ( 1184 702 1180 a f )); -DATA(insert ( 1184 1082 1178 a f )); -DATA(insert ( 1184 1083 2019 a f )); -DATA(insert ( 1184 1114 2027 a f )); -DATA(insert ( 1184 1266 1388 a f )); -DATA(insert ( 1186 703 1194 a f )); -DATA(insert ( 1186 1083 1419 a f )); -DATA(insert ( 1266 1083 2046 a f )); -/* Cross-category casts between int4 and abstime, reltime */ -DATA(insert ( 23 702 0 e b )); -DATA(insert ( 702 23 0 e b )); -DATA(insert ( 23 703 0 e b )); -DATA(insert ( 703 23 0 e b )); - -/* - * Geometric category - */ -DATA(insert ( 600 603 4091 a f )); -DATA(insert ( 601 600 1532 e f )); -DATA(insert ( 602 600 1533 e f )); -DATA(insert ( 602 604 1449 a f )); -DATA(insert ( 603 600 1534 e f )); -DATA(insert ( 603 601 1541 e f )); -DATA(insert ( 603 604 1448 a f )); -DATA(insert ( 603 718 1479 e f )); -DATA(insert ( 604 600 1540 e f )); -DATA(insert ( 604 602 1447 a f )); -DATA(insert ( 604 603 1446 e f )); -DATA(insert ( 604 718 1474 e f )); -DATA(insert ( 718 600 1416 e f )); -DATA(insert ( 718 603 1480 e f )); -DATA(insert ( 718 604 1544 e f )); - -/* - * MAC address category - */ -DATA(insert ( 829 774 4123 i f )); -DATA(insert ( 774 829 4124 i f )); - -/* - * INET category - */ -DATA(insert ( 650 869 0 i b )); -DATA(insert ( 869 650 1715 a f )); - -/* - * BitString category - */ -DATA(insert ( 1560 1562 0 i b )); -DATA(insert ( 1562 1560 0 i b )); -/* Cross-category casts between bit and int4, int8 */ -DATA(insert ( 20 1560 2075 e f )); -DATA(insert ( 23 1560 1683 e f )); -DATA(insert ( 1560 20 2076 e f )); -DATA(insert ( 1560 23 1684 e f )); - -/* - * Cross-category casts to and from TEXT - * - * We need entries here only for a few specialized cases where the behavior - * of the cast function differs from the datatype's I/O functions. Otherwise, - * parse_coerce.c will generate CoerceViaIO operations without any prompting. - * - * Note that the castcontext values specified here should be no stronger than - * parse_coerce.c's automatic casts ('a' to text, 'e' from text) else odd - * behavior will ensue when the automatic cast is applied instead of the - * pg_cast entry! - */ -DATA(insert ( 650 25 730 a f )); -DATA(insert ( 869 25 730 a f )); -DATA(insert ( 16 25 2971 a f )); -DATA(insert ( 142 25 0 a b )); -DATA(insert ( 25 142 2896 e f )); - -/* - * Cross-category casts to and from VARCHAR - * - * We support all the same casts as for TEXT. - */ -DATA(insert ( 650 1043 730 a f )); -DATA(insert ( 869 1043 730 a f )); -DATA(insert ( 16 1043 2971 a f )); -DATA(insert ( 142 1043 0 a b )); -DATA(insert ( 1043 142 2896 e f )); - -/* - * Cross-category casts to and from BPCHAR - * - * We support all the same casts as for TEXT. - */ -DATA(insert ( 650 1042 730 a f )); -DATA(insert ( 869 1042 730 a f )); -DATA(insert ( 16 1042 2971 a f )); -DATA(insert ( 142 1042 0 a b )); -DATA(insert ( 1042 142 2896 e f )); - -/* - * Length-coercion functions - */ -DATA(insert ( 1042 1042 668 i f )); -DATA(insert ( 1043 1043 669 i f )); -DATA(insert ( 1083 1083 1968 i f )); -DATA(insert ( 1114 1114 1961 i f )); -DATA(insert ( 1184 1184 1967 i f )); -DATA(insert ( 1186 1186 1200 i f )); -DATA(insert ( 1266 1266 1969 i f )); -DATA(insert ( 1560 1560 1685 i f )); -DATA(insert ( 1562 1562 1687 i f )); -DATA(insert ( 1700 1700 1703 i f )); - -/* json to/from jsonb */ -DATA(insert ( 114 3802 0 a i )); -DATA(insert ( 3802 114 0 a i )); - -/* jsonb to numeric and bool types */ -DATA(insert ( 3802 16 3556 e f )); -DATA(insert ( 3802 1700 3449 e f )); -DATA(insert ( 3802 21 3450 e f )); -DATA(insert ( 3802 23 3451 e f )); -DATA(insert ( 3802 20 3452 e f )); -DATA(insert ( 3802 700 3453 e f )); -DATA(insert ( 3802 701 2580 e f )); +#endif /* EXPOSE_TO_CLIENT_CODE */ #endif /* PG_CAST_H */ diff --git a/src/include/catalog/pg_class.dat b/src/include/catalog/pg_class.dat new file mode 100644 index 00000000000..e1450e3fc7a --- /dev/null +++ b/src/include/catalog/pg_class.dat @@ -0,0 +1,68 @@ +#---------------------------------------------------------------------- +# +# pg_class.dat +# Initial contents of the pg_class system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_class.dat +# +#---------------------------------------------------------------------- + +[ + +# Note: only "bootstrapped" relations, ie those marked BKI_BOOTSTRAP, need to +# have entries here. Be sure that the OIDs listed here match those given in +# their CATALOG and BKI_ROWTYPE_OID macros, and that the relnatts values are +# correct. + +# Note: "3" in the relfrozenxid column stands for FirstNormalTransactionId; +# similarly, "1" in relminmxid stands for FirstMultiXactId + +{ oid => '1247', + relname => 'pg_type', relnamespace => 'PGNSP', reltype => '71', + reloftype => '0', relowner => 'PGUID', relam => '0', relfilenode => '0', + reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', + reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', + relpersistence => 'p', relkind => 'r', relnatts => '30', relchecks => '0', + relhasoids => 't', relhasrules => 'f', relhastriggers => 'f', + relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', + relispopulated => 't', relreplident => 'n', relispartition => 'f', + relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + reloptions => '_null_', relpartbound => '_null_' }, +{ oid => '1249', + relname => 'pg_attribute', relnamespace => 'PGNSP', reltype => '75', + reloftype => '0', relowner => 'PGUID', relam => '0', relfilenode => '0', + reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', + reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', + relpersistence => 'p', relkind => 'r', relnatts => '24', relchecks => '0', + relhasoids => 'f', relhasrules => 'f', relhastriggers => 'f', + relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', + relispopulated => 't', relreplident => 'n', relispartition => 'f', + relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + reloptions => '_null_', relpartbound => '_null_' }, +{ oid => '1255', + relname => 'pg_proc', relnamespace => 'PGNSP', reltype => '81', + reloftype => '0', relowner => 'PGUID', relam => '0', relfilenode => '0', + reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', + reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', + relpersistence => 'p', relkind => 'r', relnatts => '28', relchecks => '0', + relhasoids => 't', relhasrules => 'f', relhastriggers => 'f', + relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', + relispopulated => 't', relreplident => 'n', relispartition => 'f', + relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + reloptions => '_null_', relpartbound => '_null_' }, +{ oid => '1259', + relname => 'pg_class', relnamespace => 'PGNSP', reltype => '83', + reloftype => '0', relowner => 'PGUID', relam => '0', relfilenode => '0', + reltablespace => '0', relpages => '0', reltuples => '0', relallvisible => '0', + reltoastrelid => '0', relhasindex => 'f', relisshared => 'f', + relpersistence => 'p', relkind => 'r', relnatts => '33', relchecks => '0', + relhasoids => 't', relhasrules => 'f', relhastriggers => 'f', + relhassubclass => 'f', relrowsecurity => 'f', relforcerowsecurity => 'f', + relispopulated => 't', relreplident => 'n', relispartition => 'f', + relrewrite => '0', relfrozenxid => '3', relminmxid => '1', relacl => '_null_', + reloptions => '_null_', relpartbound => '_null_' }, + +] diff --git a/src/include/catalog/pg_class.h b/src/include/catalog/pg_class.h index 135f33d0f30..ef62c30cf95 100644 --- a/src/include/catalog/pg_class.h +++ b/src/include/catalog/pg_class.h @@ -2,7 +2,6 @@ * * pg_class.h * definition of the system "relation" relation (pg_class) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_class.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,16 +19,14 @@ #define PG_CLASS_H #include "catalog/genbki.h" +#include "catalog/pg_class_d.h" /* ---------------- * pg_class definition. cpp turns this into * typedef struct FormData_pg_class * ---------------- */ -#define RelationRelationId 1259 -#define RelationRelation_Rowtype_Id 83 - -CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO +CATALOG(pg_class,1259,RelationRelationId) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83,RelationRelation_Rowtype_Id) BKI_SCHEMA_MACRO { NameData relname; /* class name */ Oid relnamespace; /* OID of namespace containing this class */ @@ -94,68 +91,7 @@ CATALOG(pg_class,1259) BKI_BOOTSTRAP BKI_ROWTYPE_OID(83) BKI_SCHEMA_MACRO */ typedef FormData_pg_class *Form_pg_class; -/* ---------------- - * compiler constants for pg_class - * ---------------- - */ - -#define Natts_pg_class 33 -#define Anum_pg_class_relname 1 -#define Anum_pg_class_relnamespace 2 -#define Anum_pg_class_reltype 3 -#define Anum_pg_class_reloftype 4 -#define Anum_pg_class_relowner 5 -#define Anum_pg_class_relam 6 -#define Anum_pg_class_relfilenode 7 -#define Anum_pg_class_reltablespace 8 -#define Anum_pg_class_relpages 9 -#define Anum_pg_class_reltuples 10 -#define Anum_pg_class_relallvisible 11 -#define Anum_pg_class_reltoastrelid 12 -#define Anum_pg_class_relhasindex 13 -#define Anum_pg_class_relisshared 14 -#define Anum_pg_class_relpersistence 15 -#define Anum_pg_class_relkind 16 -#define Anum_pg_class_relnatts 17 -#define Anum_pg_class_relchecks 18 -#define Anum_pg_class_relhasoids 19 -#define Anum_pg_class_relhasrules 20 -#define Anum_pg_class_relhastriggers 21 -#define Anum_pg_class_relhassubclass 22 -#define Anum_pg_class_relrowsecurity 23 -#define Anum_pg_class_relforcerowsecurity 24 -#define Anum_pg_class_relispopulated 25 -#define Anum_pg_class_relreplident 26 -#define Anum_pg_class_relispartition 27 -#define Anum_pg_class_relrewrite 28 -#define Anum_pg_class_relfrozenxid 29 -#define Anum_pg_class_relminmxid 30 -#define Anum_pg_class_relacl 31 -#define Anum_pg_class_reloptions 32 -#define Anum_pg_class_relpartbound 33 - -/* ---------------- - * initial contents of pg_class - * - * NOTE: only "bootstrapped" relations need to be declared here. Be sure that - * the OIDs listed here match those given in their CATALOG macros, and that - * the relnatts values are correct. - * ---------------- - */ - -/* - * Note: "3" in the relfrozenxid column stands for FirstNormalTransactionId; - * similarly, "1" in relminmxid stands for FirstMultiXactId - */ -DATA(insert OID = 1247 ( pg_type PGNSP 71 0 PGUID 0 0 0 0 0 0 0 f f p r 30 0 t f f f f f t n f 0 3 1 _null_ _null_ _null_)); -DESCR(""); -DATA(insert OID = 1249 ( pg_attribute PGNSP 75 0 PGUID 0 0 0 0 0 0 0 f f p r 24 0 f f f f f f t n f 0 3 1 _null_ _null_ _null_)); -DESCR(""); -DATA(insert OID = 1255 ( pg_proc PGNSP 81 0 PGUID 0 0 0 0 0 0 0 f f p r 28 0 t f f f f f t n f 0 3 1 _null_ _null_ _null_)); -DESCR(""); -DATA(insert OID = 1259 ( pg_class PGNSP 83 0 PGUID 0 0 0 0 0 0 0 f f p r 33 0 t f f f f f t n f 0 3 1 _null_ _null_ _null_)); -DESCR(""); - +#ifdef EXPOSE_TO_CLIENT_CODE #define RELKIND_RELATION 'r' /* ordinary table */ #define RELKIND_INDEX 'i' /* secondary index */ @@ -185,4 +121,6 @@ DESCR(""); */ #define REPLICA_IDENTITY_INDEX 'i' +#endif /* EXPOSE_TO_CLIENT_CODE */ + #endif /* PG_CLASS_H */ diff --git a/src/include/catalog/pg_collation.dat b/src/include/catalog/pg_collation.dat new file mode 100644 index 00000000000..e98a4fd8177 --- /dev/null +++ b/src/include/catalog/pg_collation.dat @@ -0,0 +1,31 @@ +#---------------------------------------------------------------------- +# +# pg_collation.dat +# Initial contents of the pg_collation system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_collation.dat +# +#---------------------------------------------------------------------- + +[ + +{ oid => '100', oid_symbol => 'DEFAULT_COLLATION_OID', + descr => 'database\'s default collation', + collname => 'default', collnamespace => 'PGNSP', collowner => 'PGUID', + collprovider => 'd', collencoding => '-1', collcollate => '', collctype => '', + collversion => '_null_' }, +{ oid => '950', oid_symbol => 'C_COLLATION_OID', + descr => 'standard C collation', + collname => 'C', collnamespace => 'PGNSP', collowner => 'PGUID', + collprovider => 'c', collencoding => '-1', collcollate => 'C', + collctype => 'C', collversion => '_null_' }, +{ oid => '951', oid_symbol => 'POSIX_COLLATION_OID', + descr => 'standard POSIX collation', + collname => 'POSIX', collnamespace => 'PGNSP', collowner => 'PGUID', + collprovider => 'c', collencoding => '-1', collcollate => 'POSIX', + collctype => 'POSIX', collversion => '_null_' }, + +] diff --git a/src/include/catalog/pg_collation.h b/src/include/catalog/pg_collation.h index 8ef804c73b3..d932a42ce0d 100644 --- a/src/include/catalog/pg_collation.h +++ b/src/include/catalog/pg_collation.h @@ -2,7 +2,6 @@ * * pg_collation.h * definition of the system "collation" relation (pg_collation) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -12,8 +11,8 @@ * src/include/catalog/pg_collation.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -21,15 +20,14 @@ #define PG_COLLATION_H #include "catalog/genbki.h" +#include "catalog/pg_collation_d.h" /* ---------------- * pg_collation definition. cpp turns this into * typedef struct FormData_pg_collation * ---------------- */ -#define CollationRelationId 3456 - -CATALOG(pg_collation,3456) +CATALOG(pg_collation,3456,CollationRelationId) { NameData collname; /* collation name */ Oid collnamespace; /* OID of namespace containing collation */ @@ -51,38 +49,12 @@ CATALOG(pg_collation,3456) */ typedef FormData_pg_collation *Form_pg_collation; -/* ---------------- - * compiler constants for pg_collation - * ---------------- - */ -#define Natts_pg_collation 8 -#define Anum_pg_collation_collname 1 -#define Anum_pg_collation_collnamespace 2 -#define Anum_pg_collation_collowner 3 -#define Anum_pg_collation_collprovider 4 -#define Anum_pg_collation_collencoding 5 -#define Anum_pg_collation_collcollate 6 -#define Anum_pg_collation_collctype 7 -#define Anum_pg_collation_collversion 8 - -/* ---------------- - * initial contents of pg_collation - * ---------------- - */ - -DATA(insert OID = 100 ( default PGNSP PGUID d -1 "" "" _null_ )); -DESCR("database's default collation"); -#define DEFAULT_COLLATION_OID 100 -DATA(insert OID = 950 ( C PGNSP PGUID c -1 C C _null_ )); -DESCR("standard C collation"); -#define C_COLLATION_OID 950 -DATA(insert OID = 951 ( POSIX PGNSP PGUID c -1 POSIX POSIX _null_ )); -DESCR("standard POSIX collation"); -#define POSIX_COLLATION_OID 951 - +#ifdef EXPOSE_TO_CLIENT_CODE #define COLLPROVIDER_DEFAULT 'd' #define COLLPROVIDER_ICU 'i' #define COLLPROVIDER_LIBC 'c' +#endif /* EXPOSE_TO_CLIENT_CODE */ + #endif /* PG_COLLATION_H */ diff --git a/src/include/catalog/pg_constraint.h b/src/include/catalog/pg_constraint.h index a0fb5f82432..51640922315 100644 --- a/src/include/catalog/pg_constraint.h +++ b/src/include/catalog/pg_constraint.h @@ -2,7 +2,6 @@ * * pg_constraint.h * definition of the system "constraint" relation (pg_constraint) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_constraint.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_CONSTRAINT_H #include "catalog/genbki.h" +#include "catalog/pg_constraint_d.h" /* ---------------- * pg_constraint definition. cpp turns this into * typedef struct FormData_pg_constraint * ---------------- */ -#define ConstraintRelationId 2606 - -CATALOG(pg_constraint,2606) +CATALOG(pg_constraint,2606,ConstraintRelationId) { /* * conname + connamespace is deliberately not unique; we allow, for @@ -105,8 +103,8 @@ CATALOG(pg_constraint,2606) int16 conkey[1]; /* - * Columns of conrelid that the constraint does not apply to, but included - * into the same index with key columns. + * Columns of conrelid that the constraint does not apply to, but are + * included into the same index as the key columns */ int16 conincluding[1]; @@ -158,45 +156,7 @@ CATALOG(pg_constraint,2606) */ typedef FormData_pg_constraint *Form_pg_constraint; -/* ---------------- - * compiler constants for pg_constraint - * ---------------- - */ -#define Natts_pg_constraint 26 -#define Anum_pg_constraint_conname 1 -#define Anum_pg_constraint_connamespace 2 -#define Anum_pg_constraint_contype 3 -#define Anum_pg_constraint_condeferrable 4 -#define Anum_pg_constraint_condeferred 5 -#define Anum_pg_constraint_convalidated 6 -#define Anum_pg_constraint_conrelid 7 -#define Anum_pg_constraint_contypid 8 -#define Anum_pg_constraint_conindid 9 -#define Anum_pg_constraint_conparentid 10 -#define Anum_pg_constraint_confrelid 11 -#define Anum_pg_constraint_confupdtype 12 -#define Anum_pg_constraint_confdeltype 13 -#define Anum_pg_constraint_confmatchtype 14 -#define Anum_pg_constraint_conislocal 15 -#define Anum_pg_constraint_coninhcount 16 -#define Anum_pg_constraint_connoinherit 17 -#define Anum_pg_constraint_conkey 18 -#define Anum_pg_constraint_conincluding 19 -#define Anum_pg_constraint_confkey 20 -#define Anum_pg_constraint_conpfeqop 21 -#define Anum_pg_constraint_conppeqop 22 -#define Anum_pg_constraint_conffeqop 23 -#define Anum_pg_constraint_conexclop 24 -#define Anum_pg_constraint_conbin 25 -#define Anum_pg_constraint_consrc 26 - -/* ---------------- - * initial contents of pg_constraint - * ---------------- - */ - -/* nothing, at present */ - +#ifdef EXPOSE_TO_CLIENT_CODE /* Valid values for contype */ #define CONSTRAINT_CHECK 'c' @@ -212,4 +172,6 @@ typedef FormData_pg_constraint *Form_pg_constraint; * the FKCONSTR_MATCH_xxx constants defined in parsenodes.h. */ +#endif /* EXPOSE_TO_CLIENT_CODE */ + #endif /* PG_CONSTRAINT_H */ diff --git a/src/include/catalog/pg_conversion.h b/src/include/catalog/pg_conversion.h index 29f3c9d65ad..2a38d71b482 100644 --- a/src/include/catalog/pg_conversion.h +++ b/src/include/catalog/pg_conversion.h @@ -2,7 +2,6 @@ * * pg_conversion.h * definition of the system "conversion" relation (pg_conversion) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_conversion.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,6 +19,7 @@ #define PG_CONVERSION_H #include "catalog/genbki.h" +#include "catalog/pg_conversion_d.h" /* ---------------------------------------------------------------- * pg_conversion definition. @@ -35,9 +35,7 @@ * condefault true if this is a default conversion * ---------------------------------------------------------------- */ -#define ConversionRelationId 2607 - -CATALOG(pg_conversion,2607) +CATALOG(pg_conversion,2607,ConversionRelationId) { NameData conname; Oid connamespace; @@ -55,23 +53,4 @@ CATALOG(pg_conversion,2607) */ typedef FormData_pg_conversion *Form_pg_conversion; -/* ---------------- - * compiler constants for pg_conversion - * ---------------- - */ - -#define Natts_pg_conversion 7 -#define Anum_pg_conversion_conname 1 -#define Anum_pg_conversion_connamespace 2 -#define Anum_pg_conversion_conowner 3 -#define Anum_pg_conversion_conforencoding 4 -#define Anum_pg_conversion_contoencoding 5 -#define Anum_pg_conversion_conproc 6 -#define Anum_pg_conversion_condefault 7 - -/* ---------------- - * initial contents of pg_conversion - * --------------- - */ - #endif /* PG_CONVERSION_H */ diff --git a/src/include/catalog/pg_database.dat b/src/include/catalog/pg_database.dat new file mode 100644 index 00000000000..957ca8408a5 --- /dev/null +++ b/src/include/catalog/pg_database.dat @@ -0,0 +1,26 @@ +#---------------------------------------------------------------------- +# +# pg_database.dat +# Initial contents of the pg_database system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_database.dat +# +#---------------------------------------------------------------------- + +[ + +# LC_COLLATE and LC_CTYPE will be replaced at initdb time with user choices +# that might contain non-word characters, so we must double-quote them. + +{ oid => '1', oid_symbol => 'TemplateDbOid', + descr => 'default template for new databases', + datname => 'template1', datdba => 'PGUID', encoding => 'ENCODING', + datcollate => '"LC_COLLATE"', datctype => '"LC_CTYPE"', datistemplate => 't', + datallowconn => 't', datconnlimit => '-1', datlastsysoid => '0', + datfrozenxid => '0', datminmxid => '1', dattablespace => '1663', + datacl => '_null_' }, + +] diff --git a/src/include/catalog/pg_database.h b/src/include/catalog/pg_database.h index 56f9960dfe8..7f03d24c1e9 100644 --- a/src/include/catalog/pg_database.h +++ b/src/include/catalog/pg_database.h @@ -2,7 +2,6 @@ * * pg_database.h * definition of the system "database" relation (pg_database) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_database.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,16 +19,14 @@ #define PG_DATABASE_H #include "catalog/genbki.h" +#include "catalog/pg_database_d.h" /* ---------------- * pg_database definition. cpp turns this into * typedef struct FormData_pg_database * ---------------- */ -#define DatabaseRelationId 1262 -#define DatabaseRelation_Rowtype_Id 1248 - -CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_SCHEMA_MACRO +CATALOG(pg_database,1262,DatabaseRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248,DatabaseRelation_Rowtype_Id) BKI_SCHEMA_MACRO { NameData datname; /* database name */ Oid datdba; /* owner of database */ @@ -56,27 +53,4 @@ CATALOG(pg_database,1262) BKI_SHARED_RELATION BKI_ROWTYPE_OID(1248) BKI_SCHEMA_M */ typedef FormData_pg_database *Form_pg_database; -/* ---------------- - * compiler constants for pg_database - * ---------------- - */ -#define Natts_pg_database 13 -#define Anum_pg_database_datname 1 -#define Anum_pg_database_datdba 2 -#define Anum_pg_database_encoding 3 -#define Anum_pg_database_datcollate 4 -#define Anum_pg_database_datctype 5 -#define Anum_pg_database_datistemplate 6 -#define Anum_pg_database_datallowconn 7 -#define Anum_pg_database_datconnlimit 8 -#define Anum_pg_database_datlastsysoid 9 -#define Anum_pg_database_datfrozenxid 10 -#define Anum_pg_database_datminmxid 11 -#define Anum_pg_database_dattablespace 12 -#define Anum_pg_database_datacl 13 - -DATA(insert OID = 1 ( template1 PGUID ENCODING "LC_COLLATE" "LC_CTYPE" t t -1 0 0 1 1663 _null_)); -SHDESCR("default template for new databases"); -#define TemplateDbOid 1 - #endif /* PG_DATABASE_H */ diff --git a/src/include/catalog/pg_db_role_setting.h b/src/include/catalog/pg_db_role_setting.h index 86cc17d725c..896c410a173 100644 --- a/src/include/catalog/pg_db_role_setting.h +++ b/src/include/catalog/pg_db_role_setting.h @@ -1,7 +1,7 @@ /*------------------------------------------------------------------------- * * pg_db_role_setting.h - * definition of configuration settings + * definition of per-database/per-user configuration settings relation * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -10,17 +10,16 @@ * src/include/catalog/pg_db_role_setting.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. - * - * XXX do NOT break up DATA() statements into multiple lines! - * the scripts are not as smart as you might think... + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ #ifndef PG_DB_ROLE_SETTING_H #define PG_DB_ROLE_SETTING_H +#include "catalog/genbki.h" +#include "catalog/pg_db_role_setting_d.h" #include "utils/guc.h" #include "utils/relcache.h" #include "utils/snapshot.h" @@ -30,9 +29,7 @@ * typedef struct FormData_pg_db_role_setting * ---------------- */ -#define DbRoleSettingRelationId 2964 - -CATALOG(pg_db_role_setting,2964) BKI_SHARED_RELATION BKI_WITHOUT_OIDS +CATALOG(pg_db_role_setting,2964,DbRoleSettingRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS { Oid setdatabase; /* database */ Oid setrole; /* role */ @@ -44,20 +41,6 @@ CATALOG(pg_db_role_setting,2964) BKI_SHARED_RELATION BKI_WITHOUT_OIDS typedef FormData_pg_db_role_setting * Form_pg_db_role_setting; -/* ---------------- - * compiler constants for pg_db_role_setting - * ---------------- - */ -#define Natts_pg_db_role_setting 3 -#define Anum_pg_db_role_setting_setdatabase 1 -#define Anum_pg_db_role_setting_setrole 2 -#define Anum_pg_db_role_setting_setconfig 3 - -/* ---------------- - * initial contents of pg_db_role_setting are NOTHING - * ---------------- - */ - /* * prototypes for functions in pg_db_role_setting.h */ diff --git a/src/include/catalog/pg_default_acl.h b/src/include/catalog/pg_default_acl.h index 11b306037d0..d672d5b3f88 100644 --- a/src/include/catalog/pg_default_acl.h +++ b/src/include/catalog/pg_default_acl.h @@ -10,8 +10,8 @@ * src/include/catalog/pg_default_acl.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -19,15 +19,14 @@ #define PG_DEFAULT_ACL_H #include "catalog/genbki.h" +#include "catalog/pg_default_acl_d.h" /* ---------------- * pg_default_acl definition. cpp turns this into * typedef struct FormData_pg_default_acl * ---------------- */ -#define DefaultAclRelationId 826 - -CATALOG(pg_default_acl,826) +CATALOG(pg_default_acl,826,DefaultAclRelationId) { Oid defaclrole; /* OID of role owning this ACL */ Oid defaclnamespace; /* OID of namespace, or 0 for all */ @@ -45,21 +44,7 @@ CATALOG(pg_default_acl,826) */ typedef FormData_pg_default_acl *Form_pg_default_acl; -/* ---------------- - * compiler constants for pg_default_acl - * ---------------- - */ - -#define Natts_pg_default_acl 4 -#define Anum_pg_default_acl_defaclrole 1 -#define Anum_pg_default_acl_defaclnamespace 2 -#define Anum_pg_default_acl_defaclobjtype 3 -#define Anum_pg_default_acl_defaclacl 4 - -/* ---------------- - * pg_default_acl has no initial contents - * ---------------- - */ +#ifdef EXPOSE_TO_CLIENT_CODE /* * Types of objects for which the user is allowed to specify default @@ -72,4 +57,6 @@ typedef FormData_pg_default_acl *Form_pg_default_acl; #define DEFACLOBJ_TYPE 'T' /* type */ #define DEFACLOBJ_NAMESPACE 'n' /* namespace */ +#endif /* EXPOSE_TO_CLIENT_CODE */ + #endif /* PG_DEFAULT_ACL_H */ diff --git a/src/include/catalog/pg_depend.h b/src/include/catalog/pg_depend.h index be3867bbf2f..bf31c1ab408 100644 --- a/src/include/catalog/pg_depend.h +++ b/src/include/catalog/pg_depend.h @@ -2,7 +2,18 @@ * * pg_depend.h * definition of the system "dependency" relation (pg_depend) - * along with the relation's initial contents. + * + * pg_depend has no preloaded contents, so there is no pg_depend.dat + * file; system-defined dependencies are loaded into it during a late stage + * of the initdb process. + * + * NOTE: we do not represent all possible dependency pairs in pg_depend; + * for example, there's not much value in creating an explicit dependency + * from an attribute to its relation. Usually we make a dependency for + * cases where the relationship is conditional rather than essential + * (for example, not all triggers are dependent on constraints, but all + * attributes are dependent on relations) or where the dependency is not + * convenient to find from the contents of other catalogs. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +22,8 @@ * src/include/catalog/pg_depend.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +31,14 @@ #define PG_DEPEND_H #include "catalog/genbki.h" +#include "catalog/pg_depend_d.h" /* ---------------- * pg_depend definition. cpp turns this into * typedef struct FormData_pg_depend * ---------------- */ -#define DependRelationId 2608 - -CATALOG(pg_depend,2608) BKI_WITHOUT_OIDS +CATALOG(pg_depend,2608,DependRelationId) BKI_WITHOUT_OIDS { /* * Identification of the dependent (referencing) object. @@ -60,31 +70,4 @@ CATALOG(pg_depend,2608) BKI_WITHOUT_OIDS */ typedef FormData_pg_depend *Form_pg_depend; -/* ---------------- - * compiler constants for pg_depend - * ---------------- - */ -#define Natts_pg_depend 7 -#define Anum_pg_depend_classid 1 -#define Anum_pg_depend_objid 2 -#define Anum_pg_depend_objsubid 3 -#define Anum_pg_depend_refclassid 4 -#define Anum_pg_depend_refobjid 5 -#define Anum_pg_depend_refobjsubid 6 -#define Anum_pg_depend_deptype 7 - - -/* - * pg_depend has no preloaded contents; system-defined dependencies are - * loaded into it during a late stage of the initdb process. - * - * NOTE: we do not represent all possible dependency pairs in pg_depend; - * for example, there's not much value in creating an explicit dependency - * from an attribute to its relation. Usually we make a dependency for - * cases where the relationship is conditional rather than essential - * (for example, not all triggers are dependent on constraints, but all - * attributes are dependent on relations) or where the dependency is not - * convenient to find from the contents of other catalogs. - */ - #endif /* PG_DEPEND_H */ diff --git a/src/include/catalog/pg_description.h b/src/include/catalog/pg_description.h index d29100013ea..b95b188d289 100644 --- a/src/include/catalog/pg_description.h +++ b/src/include/catalog/pg_description.h @@ -3,6 +3,10 @@ * pg_description.h * definition of the system "description" relation (pg_description) * + * Because the contents of this table are taken from the *.dat files + * of other catalogs, there is no pg_description.dat file. The initial + * contents are assembled by genbki.pl and loaded during initdb. + * * NOTE: an object is identified by the OID of the row that primarily * defines the object, plus the OID of the table that that row appears in. * For example, a function is identified by the OID of its pg_proc row @@ -25,11 +29,8 @@ * src/include/catalog/pg_description.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. - * - * XXX do NOT break up DATA() statements into multiple lines! - * the scripts are not as smart as you might think... + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -37,15 +38,14 @@ #define PG_DESCRIPTION_H #include "catalog/genbki.h" +#include "catalog/pg_description_d.h" /* ---------------- * pg_description definition. cpp turns this into * typedef struct FormData_pg_description * ---------------- */ -#define DescriptionRelationId 2609 - -CATALOG(pg_description,2609) BKI_WITHOUT_OIDS +CATALOG(pg_description,2609,DescriptionRelationId) BKI_WITHOUT_OIDS { Oid objoid; /* OID of object itself */ Oid classoid; /* OID of table containing object */ @@ -63,25 +63,4 @@ CATALOG(pg_description,2609) BKI_WITHOUT_OIDS */ typedef FormData_pg_description * Form_pg_description; -/* ---------------- - * compiler constants for pg_description - * ---------------- - */ -#define Natts_pg_description 4 -#define Anum_pg_description_objoid 1 -#define Anum_pg_description_classoid 2 -#define Anum_pg_description_objsubid 3 -#define Anum_pg_description_description 4 - -/* ---------------- - * initial contents of pg_description - * ---------------- - */ - -/* - * Because the contents of this table are taken from the other *.h files, - * there is no initialization here. The initial contents are extracted - * by genbki.pl and loaded during initdb. - */ - #endif /* PG_DESCRIPTION_H */ diff --git a/src/include/catalog/pg_enum.h b/src/include/catalog/pg_enum.h index a65a8f45b6a..a0922be49ba 100644 --- a/src/include/catalog/pg_enum.h +++ b/src/include/catalog/pg_enum.h @@ -2,7 +2,6 @@ * * pg_enum.h * definition of the system "enum" relation (pg_enum) - * along with the relation's initial contents. * * * Copyright (c) 2006-2018, PostgreSQL Global Development Group @@ -10,11 +9,8 @@ * src/include/catalog/pg_enum.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. - * - * XXX do NOT break up DATA() statements into multiple lines! - * the scripts are not as smart as you might think... + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -22,6 +18,7 @@ #define PG_ENUM_H #include "catalog/genbki.h" +#include "catalog/pg_enum_d.h" #include "nodes/pg_list.h" /* ---------------- @@ -29,9 +26,7 @@ * typedef struct FormData_pg_enum * ---------------- */ -#define EnumRelationId 3501 - -CATALOG(pg_enum,3501) +CATALOG(pg_enum,3501,EnumRelationId) { Oid enumtypid; /* OID of owning enum type */ float4 enumsortorder; /* sort position of this enum value */ @@ -45,20 +40,6 @@ CATALOG(pg_enum,3501) */ typedef FormData_pg_enum *Form_pg_enum; -/* ---------------- - * compiler constants for pg_enum - * ---------------- - */ -#define Natts_pg_enum 3 -#define Anum_pg_enum_enumtypid 1 -#define Anum_pg_enum_enumsortorder 2 -#define Anum_pg_enum_enumlabel 3 - -/* ---------------- - * pg_enum has no initial contents - * ---------------- - */ - /* * prototypes for functions in pg_enum.c */ diff --git a/src/include/catalog/pg_event_trigger.h b/src/include/catalog/pg_event_trigger.h index e03c81997c6..f06cbe04dc1 100644 --- a/src/include/catalog/pg_event_trigger.h +++ b/src/include/catalog/pg_event_trigger.h @@ -2,7 +2,6 @@ * * pg_event_trigger.h * definition of the system "event trigger" relation (pg_event_trigger) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_event_trigger.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_EVENT_TRIGGER_H #include "catalog/genbki.h" +#include "catalog/pg_event_trigger_d.h" /* ---------------- * pg_event_trigger definition. cpp turns this into * typedef struct FormData_pg_event_trigger * ---------------- */ -#define EventTriggerRelationId 3466 - -CATALOG(pg_event_trigger,3466) +CATALOG(pg_event_trigger,3466,EventTriggerRelationId) { NameData evtname; /* trigger's name */ NameData evtevent; /* trigger's event */ @@ -49,16 +47,4 @@ CATALOG(pg_event_trigger,3466) */ typedef FormData_pg_event_trigger *Form_pg_event_trigger; -/* ---------------- - * compiler constants for pg_event_trigger - * ---------------- - */ -#define Natts_pg_event_trigger 6 -#define Anum_pg_event_trigger_evtname 1 -#define Anum_pg_event_trigger_evtevent 2 -#define Anum_pg_event_trigger_evtowner 3 -#define Anum_pg_event_trigger_evtfoid 4 -#define Anum_pg_event_trigger_evtenabled 5 -#define Anum_pg_event_trigger_evttags 6 - #endif /* PG_EVENT_TRIGGER_H */ diff --git a/src/include/catalog/pg_extension.h b/src/include/catalog/pg_extension.h index 9ca6ca7936c..10bbb692a5d 100644 --- a/src/include/catalog/pg_extension.h +++ b/src/include/catalog/pg_extension.h @@ -2,7 +2,6 @@ * * pg_extension.h * definition of the system "extension" relation (pg_extension) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_extension.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_EXTENSION_H #include "catalog/genbki.h" +#include "catalog/pg_extension_d.h" /* ---------------- * pg_extension definition. cpp turns this into * typedef struct FormData_pg_extension * ---------------- */ -#define ExtensionRelationId 3079 - -CATALOG(pg_extension,3079) +CATALOG(pg_extension,3079,ExtensionRelationId) { NameData extname; /* extension name */ Oid extowner; /* extension owner */ @@ -50,23 +48,4 @@ CATALOG(pg_extension,3079) */ typedef FormData_pg_extension *Form_pg_extension; -/* ---------------- - * compiler constants for pg_extension - * ---------------- - */ - -#define Natts_pg_extension 7 -#define Anum_pg_extension_extname 1 -#define Anum_pg_extension_extowner 2 -#define Anum_pg_extension_extnamespace 3 -#define Anum_pg_extension_extrelocatable 4 -#define Anum_pg_extension_extversion 5 -#define Anum_pg_extension_extconfig 6 -#define Anum_pg_extension_extcondition 7 - -/* ---------------- - * pg_extension has no initial contents - * ---------------- - */ - #endif /* PG_EXTENSION_H */ diff --git a/src/include/catalog/pg_foreign_data_wrapper.h b/src/include/catalog/pg_foreign_data_wrapper.h index dd00586b6e3..67e331987cf 100644 --- a/src/include/catalog/pg_foreign_data_wrapper.h +++ b/src/include/catalog/pg_foreign_data_wrapper.h @@ -2,7 +2,6 @@ * * pg_foreign_data_wrapper.h * definition of the system "foreign-data wrapper" relation (pg_foreign_data_wrapper) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_foreign_data_wrapper.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_FOREIGN_DATA_WRAPPER_H #include "catalog/genbki.h" +#include "catalog/pg_foreign_data_wrapper_d.h" /* ---------------- * pg_foreign_data_wrapper definition. cpp turns this into * typedef struct FormData_pg_foreign_data_wrapper * ---------------- */ -#define ForeignDataWrapperRelationId 2328 - -CATALOG(pg_foreign_data_wrapper,2328) +CATALOG(pg_foreign_data_wrapper,2328,ForeignDataWrapperRelationId) { NameData fdwname; /* foreign-data wrapper name */ Oid fdwowner; /* FDW owner */ @@ -48,17 +46,4 @@ CATALOG(pg_foreign_data_wrapper,2328) */ typedef FormData_pg_foreign_data_wrapper *Form_pg_foreign_data_wrapper; -/* ---------------- - * compiler constants for pg_fdw - * ---------------- - */ - -#define Natts_pg_foreign_data_wrapper 6 -#define Anum_pg_foreign_data_wrapper_fdwname 1 -#define Anum_pg_foreign_data_wrapper_fdwowner 2 -#define Anum_pg_foreign_data_wrapper_fdwhandler 3 -#define Anum_pg_foreign_data_wrapper_fdwvalidator 4 -#define Anum_pg_foreign_data_wrapper_fdwacl 5 -#define Anum_pg_foreign_data_wrapper_fdwoptions 6 - #endif /* PG_FOREIGN_DATA_WRAPPER_H */ diff --git a/src/include/catalog/pg_foreign_server.h b/src/include/catalog/pg_foreign_server.h index a8c9e875403..0d25839c3da 100644 --- a/src/include/catalog/pg_foreign_server.h +++ b/src/include/catalog/pg_foreign_server.h @@ -9,8 +9,8 @@ * src/include/catalog/pg_foreign_server.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -18,15 +18,14 @@ #define PG_FOREIGN_SERVER_H #include "catalog/genbki.h" +#include "catalog/pg_foreign_server_d.h" /* ---------------- * pg_foreign_server definition. cpp turns this into * typedef struct FormData_pg_foreign_server * ---------------- */ -#define ForeignServerRelationId 1417 - -CATALOG(pg_foreign_server,1417) +CATALOG(pg_foreign_server,1417,ForeignServerRelationId) { NameData srvname; /* foreign server name */ Oid srvowner; /* server owner */ @@ -47,18 +46,4 @@ CATALOG(pg_foreign_server,1417) */ typedef FormData_pg_foreign_server *Form_pg_foreign_server; -/* ---------------- - * compiler constants for pg_foreign_server - * ---------------- - */ - -#define Natts_pg_foreign_server 7 -#define Anum_pg_foreign_server_srvname 1 -#define Anum_pg_foreign_server_srvowner 2 -#define Anum_pg_foreign_server_srvfdw 3 -#define Anum_pg_foreign_server_srvtype 4 -#define Anum_pg_foreign_server_srvversion 5 -#define Anum_pg_foreign_server_srvacl 6 -#define Anum_pg_foreign_server_srvoptions 7 - #endif /* PG_FOREIGN_SERVER_H */ diff --git a/src/include/catalog/pg_foreign_table.h b/src/include/catalog/pg_foreign_table.h index 210e77b79ad..13de918880f 100644 --- a/src/include/catalog/pg_foreign_table.h +++ b/src/include/catalog/pg_foreign_table.h @@ -9,8 +9,8 @@ * src/include/catalog/pg_foreign_table.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -18,15 +18,14 @@ #define PG_FOREIGN_TABLE_H #include "catalog/genbki.h" +#include "catalog/pg_foreign_table_d.h" /* ---------------- * pg_foreign_table definition. cpp turns this into * typedef struct FormData_pg_foreign_table * ---------------- */ -#define ForeignTableRelationId 3118 - -CATALOG(pg_foreign_table,3118) BKI_WITHOUT_OIDS +CATALOG(pg_foreign_table,3118,ForeignTableRelationId) BKI_WITHOUT_OIDS { Oid ftrelid; /* OID of foreign table */ Oid ftserver; /* OID of foreign server */ @@ -43,14 +42,4 @@ CATALOG(pg_foreign_table,3118) BKI_WITHOUT_OIDS */ typedef FormData_pg_foreign_table *Form_pg_foreign_table; -/* ---------------- - * compiler constants for pg_foreign_table - * ---------------- - */ - -#define Natts_pg_foreign_table 3 -#define Anum_pg_foreign_table_ftrelid 1 -#define Anum_pg_foreign_table_ftserver 2 -#define Anum_pg_foreign_table_ftoptions 3 - #endif /* PG_FOREIGN_TABLE_H */ diff --git a/src/include/catalog/pg_index.h b/src/include/catalog/pg_index.h index 6ae03dbcbbc..88ff40f8207 100644 --- a/src/include/catalog/pg_index.h +++ b/src/include/catalog/pg_index.h @@ -2,7 +2,6 @@ * * pg_index.h * definition of the system "index" relation (pg_index) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_index.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_INDEX_H #include "catalog/genbki.h" +#include "catalog/pg_index_d.h" /* ---------------- * pg_index definition. cpp turns this into * typedef struct FormData_pg_index. * ---------------- */ -#define IndexRelationId 2610 - -CATALOG(pg_index,2610) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO +CATALOG(pg_index,2610,IndexRelationId) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO { Oid indexrelid; /* OID of the index */ Oid indrelid; /* OID of the relation it indexes */ @@ -67,31 +65,7 @@ CATALOG(pg_index,2610) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO */ typedef FormData_pg_index *Form_pg_index; -/* ---------------- - * compiler constants for pg_index - * ---------------- - */ -#define Natts_pg_index 20 -#define Anum_pg_index_indexrelid 1 -#define Anum_pg_index_indrelid 2 -#define Anum_pg_index_indnatts 3 -#define Anum_pg_index_indnkeyatts 4 -#define Anum_pg_index_indisunique 5 -#define Anum_pg_index_indisprimary 6 -#define Anum_pg_index_indisexclusion 7 -#define Anum_pg_index_indimmediate 8 -#define Anum_pg_index_indisclustered 9 -#define Anum_pg_index_indisvalid 10 -#define Anum_pg_index_indcheckxmin 11 -#define Anum_pg_index_indisready 12 -#define Anum_pg_index_indislive 13 -#define Anum_pg_index_indisreplident 14 -#define Anum_pg_index_indkey 15 -#define Anum_pg_index_indcollation 16 -#define Anum_pg_index_indclass 17 -#define Anum_pg_index_indoption 18 -#define Anum_pg_index_indexprs 19 -#define Anum_pg_index_indpred 20 +#ifdef EXPOSE_TO_CLIENT_CODE /* * Index AMs that support ordered scans must support these two indoption @@ -101,6 +75,8 @@ typedef FormData_pg_index *Form_pg_index; #define INDOPTION_DESC 0x0001 /* values are in reverse order */ #define INDOPTION_NULLS_FIRST 0x0002 /* NULLs are first instead of last */ +#endif /* EXPOSE_TO_CLIENT_CODE */ + /* * Use of these macros is recommended over direct examination of the state * flag columns where possible; this allows source code compatibility with diff --git a/src/include/catalog/pg_inherits.h b/src/include/catalog/pg_inherits.h index 3c572f421bc..3b2e03c4bfd 100644 --- a/src/include/catalog/pg_inherits.h +++ b/src/include/catalog/pg_inherits.h @@ -2,7 +2,6 @@ * * pg_inherits.h * definition of the system "inherits" relation (pg_inherits) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_inherits.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_INHERITS_H #include "catalog/genbki.h" +#include "catalog/pg_inherits_d.h" /* ---------------- * pg_inherits definition. cpp turns this into * typedef struct FormData_pg_inherits * ---------------- */ -#define InheritsRelationId 2611 - -CATALOG(pg_inherits,2611) BKI_WITHOUT_OIDS +CATALOG(pg_inherits,2611,InheritsRelationId) BKI_WITHOUT_OIDS { Oid inhrelid; Oid inhparent; @@ -42,18 +40,4 @@ CATALOG(pg_inherits,2611) BKI_WITHOUT_OIDS */ typedef FormData_pg_inherits *Form_pg_inherits; -/* ---------------- - * compiler constants for pg_inherits - * ---------------- - */ -#define Natts_pg_inherits 3 -#define Anum_pg_inherits_inhrelid 1 -#define Anum_pg_inherits_inhparent 2 -#define Anum_pg_inherits_inhseqno 3 - -/* ---------------- - * pg_inherits has no initial contents - * ---------------- - */ - #endif /* PG_INHERITS_H */ diff --git a/src/include/catalog/pg_init_privs.h b/src/include/catalog/pg_init_privs.h index 65f02c2aefe..6ce26463507 100644 --- a/src/include/catalog/pg_init_privs.h +++ b/src/include/catalog/pg_init_privs.h @@ -15,17 +15,20 @@ * for a table itself, so that it is distinct from any column privilege. * Currently, objsubid is unused and zero for all other kinds of objects. * + * Because the contents of this table depend on what is done with the other + * objects in the system (and, in particular, may change due to changes in + * system_views.sql), there is no pg_init_privs.dat file. The initial contents + * are loaded near the end of initdb. + * + * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * * src/include/catalog/pg_init_privs.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. - * - * XXX do NOT break up DATA() statements into multiple lines! - * the scripts are not as smart as you might think... + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -33,15 +36,14 @@ #define PG_INIT_PRIVS_H #include "catalog/genbki.h" +#include "catalog/pg_init_privs_d.h" /* ---------------- * pg_init_privs definition. cpp turns this into * typedef struct FormData_pg_init_privs * ---------------- */ -#define InitPrivsRelationId 3394 - -CATALOG(pg_init_privs,3394) BKI_WITHOUT_OIDS +CATALOG(pg_init_privs,3394,InitPrivsRelationId) BKI_WITHOUT_OIDS { Oid objoid; /* OID of object itself */ Oid classoid; /* OID of table containing object */ @@ -60,17 +62,6 @@ CATALOG(pg_init_privs,3394) BKI_WITHOUT_OIDS */ typedef FormData_pg_init_privs * Form_pg_init_privs; -/* ---------------- - * compiler constants for pg_init_privs - * ---------------- - */ -#define Natts_pg_init_privs 5 -#define Anum_pg_init_privs_objoid 1 -#define Anum_pg_init_privs_classoid 2 -#define Anum_pg_init_privs_objsubid 3 -#define Anum_pg_init_privs_privtype 4 -#define Anum_pg_init_privs_initprivs 5 - /* * It is important to know if the initial privileges are from initdb or from an * extension. This enum is used to provide that differentiation and the two @@ -84,17 +75,4 @@ typedef enum InitPrivsType INITPRIVS_EXTENSION = 'e' } InitPrivsType; -/* ---------------- - * initial contents of pg_init_privs - * ---------------- - */ - -/* - * Because the contents of this table depend on what is done with the other - * objects in the system (and, in particular, may change due to changes is - * system_views.sql), there is no initialization here. - * - * The initial contents are loaded near the end of initdb. - */ - #endif /* PG_INIT_PRIVS_H */ diff --git a/src/include/catalog/pg_language.dat b/src/include/catalog/pg_language.dat new file mode 100644 index 00000000000..1b50a66ea48 --- /dev/null +++ b/src/include/catalog/pg_language.dat @@ -0,0 +1,31 @@ +#---------------------------------------------------------------------- +# +# pg_language.dat +# Initial contents of the pg_language system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_language.dat +# +#---------------------------------------------------------------------- + +[ + +{ oid => '12', oid_symbol => 'INTERNALlanguageId', + descr => 'built-in functions', + lanname => 'internal', lanowner => 'PGUID', lanispl => 'f', + lanpltrusted => 'f', lanplcallfoid => '0', laninline => '0', + lanvalidator => '2246', lanacl => '_null_' }, +{ oid => '13', oid_symbol => 'ClanguageId', + descr => 'dynamically-loaded C functions', + lanname => 'c', lanowner => 'PGUID', lanispl => 'f', lanpltrusted => 'f', + lanplcallfoid => '0', laninline => '0', lanvalidator => '2247', + lanacl => '_null_' }, +{ oid => '14', oid_symbol => 'SQLlanguageId', + descr => 'SQL-language functions', + lanname => 'sql', lanowner => 'PGUID', lanispl => 'f', lanpltrusted => 't', + lanplcallfoid => '0', laninline => '0', lanvalidator => '2248', + lanacl => '_null_' }, + +] diff --git a/src/include/catalog/pg_language.h b/src/include/catalog/pg_language.h index 6b373f96d56..e2d8d1571b4 100644 --- a/src/include/catalog/pg_language.h +++ b/src/include/catalog/pg_language.h @@ -2,7 +2,6 @@ * * pg_language.h * definition of the system "language" relation (pg_language) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_language.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_LANGUAGE_H #include "catalog/genbki.h" +#include "catalog/pg_language_d.h" /* ---------------- * pg_language definition. cpp turns this into * typedef struct FormData_pg_language * ---------------- */ -#define LanguageRelationId 2612 - -CATALOG(pg_language,2612) +CATALOG(pg_language,2612,LanguageRelationId) { NameData lanname; /* Language name */ Oid lanowner; /* Language's owner */ @@ -50,33 +48,4 @@ CATALOG(pg_language,2612) */ typedef FormData_pg_language *Form_pg_language; -/* ---------------- - * compiler constants for pg_language - * ---------------- - */ -#define Natts_pg_language 8 -#define Anum_pg_language_lanname 1 -#define Anum_pg_language_lanowner 2 -#define Anum_pg_language_lanispl 3 -#define Anum_pg_language_lanpltrusted 4 -#define Anum_pg_language_lanplcallfoid 5 -#define Anum_pg_language_laninline 6 -#define Anum_pg_language_lanvalidator 7 -#define Anum_pg_language_lanacl 8 - -/* ---------------- - * initial contents of pg_language - * ---------------- - */ - -DATA(insert OID = 12 ( internal PGUID f f 0 0 2246 _null_ )); -DESCR("built-in functions"); -#define INTERNALlanguageId 12 -DATA(insert OID = 13 ( c PGUID f f 0 0 2247 _null_ )); -DESCR("dynamically-loaded C functions"); -#define ClanguageId 13 -DATA(insert OID = 14 ( sql PGUID f t 0 0 2248 _null_ )); -DESCR("SQL-language functions"); -#define SQLlanguageId 14 - #endif /* PG_LANGUAGE_H */ diff --git a/src/include/catalog/pg_largeobject.h b/src/include/catalog/pg_largeobject.h index 0a15649dddb..481d2ff63ba 100644 --- a/src/include/catalog/pg_largeobject.h +++ b/src/include/catalog/pg_largeobject.h @@ -2,7 +2,6 @@ * * pg_largeobject.h * definition of the system "largeobject" relation (pg_largeobject) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_largeobject.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_LARGEOBJECT_H #include "catalog/genbki.h" +#include "catalog/pg_largeobject_d.h" /* ---------------- * pg_largeobject definition. cpp turns this into * typedef struct FormData_pg_largeobject * ---------------- */ -#define LargeObjectRelationId 2613 - -CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS +CATALOG(pg_largeobject,2613,LargeObjectRelationId) BKI_WITHOUT_OIDS { Oid loid; /* Identifier of large object */ int32 pageno; /* Page number (starting from 0) */ @@ -45,15 +43,6 @@ CATALOG(pg_largeobject,2613) BKI_WITHOUT_OIDS */ typedef FormData_pg_largeobject *Form_pg_largeobject; -/* ---------------- - * compiler constants for pg_largeobject - * ---------------- - */ -#define Natts_pg_largeobject 3 -#define Anum_pg_largeobject_loid 1 -#define Anum_pg_largeobject_pageno 2 -#define Anum_pg_largeobject_data 3 - extern Oid LargeObjectCreate(Oid loid); extern void LargeObjectDrop(Oid loid); extern bool LargeObjectExists(Oid loid); diff --git a/src/include/catalog/pg_largeobject_metadata.h b/src/include/catalog/pg_largeobject_metadata.h index 4535b51b53a..a8732bc4890 100644 --- a/src/include/catalog/pg_largeobject_metadata.h +++ b/src/include/catalog/pg_largeobject_metadata.h @@ -2,7 +2,6 @@ * * pg_largeobject_metadata.h * definition of the system "largeobject_metadata" relation (pg_largeobject_metadata) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_largeobject_metadata.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,15 +19,14 @@ #define PG_LARGEOBJECT_METADATA_H #include "catalog/genbki.h" +#include "catalog/pg_largeobject_metadata_d.h" /* ---------------- * pg_largeobject_metadata definition. cpp turns this into * typedef struct FormData_pg_largeobject_metadata * ---------------- */ -#define LargeObjectMetadataRelationId 2995 - -CATALOG(pg_largeobject_metadata,2995) +CATALOG(pg_largeobject_metadata,2995,LargeObjectMetadataRelationId) { Oid lomowner; /* OID of the largeobject owner */ @@ -44,12 +42,4 @@ CATALOG(pg_largeobject_metadata,2995) */ typedef FormData_pg_largeobject_metadata *Form_pg_largeobject_metadata; -/* ---------------- - * compiler constants for pg_largeobject_metadata - * ---------------- - */ -#define Natts_pg_largeobject_metadata 2 -#define Anum_pg_largeobject_metadata_lomowner 1 -#define Anum_pg_largeobject_metadata_lomacl 2 - #endif /* PG_LARGEOBJECT_METADATA_H */ diff --git a/src/include/catalog/pg_namespace.dat b/src/include/catalog/pg_namespace.dat new file mode 100644 index 00000000000..e3549df2735 --- /dev/null +++ b/src/include/catalog/pg_namespace.dat @@ -0,0 +1,25 @@ +#---------------------------------------------------------------------- +# +# pg_namespace.dat +# Initial contents of the pg_namespace system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_namespace.dat +# +#---------------------------------------------------------------------- + +[ + +{ oid => '11', oid_symbol => 'PG_CATALOG_NAMESPACE', + descr => 'system catalog schema', + nspname => 'pg_catalog', nspowner => 'PGUID', nspacl => '_null_' }, +{ oid => '99', oid_symbol => 'PG_TOAST_NAMESPACE', + descr => 'reserved schema for TOAST tables', + nspname => 'pg_toast', nspowner => 'PGUID', nspacl => '_null_' }, +{ oid => '2200', oid_symbol => 'PG_PUBLIC_NAMESPACE', + descr => 'standard public schema', + nspname => 'public', nspowner => 'PGUID', nspacl => '_null_' }, + +] diff --git a/src/include/catalog/pg_namespace.h b/src/include/catalog/pg_namespace.h index dbb9f6626fc..0d9cada79f7 100644 --- a/src/include/catalog/pg_namespace.h +++ b/src/include/catalog/pg_namespace.h @@ -2,7 +2,6 @@ * * pg_namespace.h * definition of the system "namespace" relation (pg_namespace) - * along with the relation's initial contents. * * * Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group @@ -11,8 +10,8 @@ * src/include/catalog/pg_namespace.h * * NOTES - * the genbki.pl script reads this file and generates .bki - * information from the DATA() statements. + * The Catalog.pm module reads this file and derives schema + * information. * *------------------------------------------------------------------------- */ @@ -20,6 +19,7 @@ #define PG_NAMESPACE_H #include "catalog/genbki.h" +#include "catalog/pg_namespace_d.h" /* ---------------------------------------------------------------- * pg_namespace definition. @@ -31,9 +31,7 @@ * nspacl access privilege list * ---------------------------------------------------------------- */ -#define NamespaceRelationId 2615 - -CATALOG(pg_namespace,2615) +CATALOG(pg_namespace,2615,NamespaceRelationId) { NameData nspname; Oid nspowner; @@ -50,33 +48,6 @@ CATALOG(pg_namespace,2615) */ typedef FormData_pg_namespace *Form_pg_namespace; -/* ---------------- - * compiler constants for pg_namespace - * ---------------- - */ - -#define Natts_pg_namespace 3 -#define Anum_pg_namespace_nspname 1 -#define Anum_pg_namespace_nspowner 2 -#define Anum_pg_namespace_nspacl 3 - - -/* ---------------- - * initial contents of pg_namespace - * --------------- - */ - -DATA(insert OID = 11 ( pg_catalog PGUID _null_ )); -DESCR("system catalog schema"); -#define PG_CATALOG_NAMESPACE 11 -DATA(insert OID = 99 ( pg_toast PGUID _null_ )); -DESCR("reserved schema for TOAST tables"); -#define PG_TOAST_NAMESPACE 99 -DATA(insert OID = 2200 ( public PGUID _null_ )); -DESCR("standard public schema"); -#define PG_PUBLIC_NAMESPACE 2200 - - /* * prototypes for functions in pg_namespace.c */ diff --git a/src/include/catalog/pg_opclass.dat b/src/include/catalog/pg_opclass.dat new file mode 100644 index 00000000000..94e3e1e5fa5 --- /dev/null +++ b/src/include/catalog/pg_opclass.dat @@ -0,0 +1,357 @@ +#---------------------------------------------------------------------- +# +# pg_opclass.dat +# Initial contents of the pg_opclass system relation. +# +# Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group +# Portions Copyright (c) 1994, Regents of the University of California +# +# src/include/catalog/pg_opclass.dat +# +#---------------------------------------------------------------------- + +[ + +# Note: we hard-wire an OID only for a few entries that have to be explicitly +# referenced in the C code or in built-in catalog entries. The rest get OIDs +# assigned on-the-fly during initdb. + +{ opcmethod => 'btree', opcname => 'abstime_ops', + opcfamily => 'btree/abstime_ops', opcintype => 'abstime' }, +{ opcmethod => 'btree', opcname => 'array_ops', opcfamily => 'btree/array_ops', + opcintype => 'anyarray' }, +{ opcmethod => 'hash', opcname => 'array_ops', opcfamily => 'hash/array_ops', + opcintype => 'anyarray' }, +{ opcmethod => 'btree', opcname => 'bit_ops', opcfamily => 'btree/bit_ops', + opcintype => 'bit' }, +{ opcmethod => 'btree', opcname => 'bool_ops', opcfamily => 'btree/bool_ops', + opcintype => 'bool' }, +{ opcmethod => 'btree', opcname => 'bpchar_ops', + opcfamily => 'btree/bpchar_ops', opcintype => 'bpchar' }, +{ opcmethod => 'hash', opcname => 'bpchar_ops', opcfamily => 'hash/bpchar_ops', + opcintype => 'bpchar' }, +{ opcmethod => 'btree', opcname => 'bytea_ops', opcfamily => 'btree/bytea_ops', + opcintype => 'bytea' }, +{ opcmethod => 'btree', opcname => 'char_ops', opcfamily => 'btree/char_ops', + opcintype => 'char' }, +{ opcmethod => 'hash', opcname => 'char_ops', opcfamily => 'hash/char_ops', + opcintype => 'char' }, +{ opcmethod => 'btree', opcname => 'cidr_ops', opcfamily => 'btree/network_ops', + opcintype => 'inet', opcdefault => 'f' }, +{ opcmethod => 'hash', opcname => 'cidr_ops', opcfamily => 'hash/network_ops', + opcintype => 'inet', opcdefault => 'f' }, +{ oid => '3122', oid_symbol => 'DATE_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'date_ops', + opcfamily => 'btree/datetime_ops', opcintype => 'date' }, +{ opcmethod => 'hash', opcname => 'date_ops', opcfamily => 'hash/date_ops', + opcintype => 'date' }, +{ opcmethod => 'btree', opcname => 'float4_ops', opcfamily => 'btree/float_ops', + opcintype => 'float4' }, +{ opcmethod => 'hash', opcname => 'float4_ops', opcfamily => 'hash/float_ops', + opcintype => 'float4' }, +{ oid => '3123', oid_symbol => 'FLOAT8_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'float8_ops', opcfamily => 'btree/float_ops', + opcintype => 'float8' }, +{ opcmethod => 'hash', opcname => 'float8_ops', opcfamily => 'hash/float_ops', + opcintype => 'float8' }, +{ opcmethod => 'btree', opcname => 'inet_ops', opcfamily => 'btree/network_ops', + opcintype => 'inet' }, +{ opcmethod => 'hash', opcname => 'inet_ops', opcfamily => 'hash/network_ops', + opcintype => 'inet' }, +{ opcmethod => 'gist', opcname => 'inet_ops', opcfamily => 'gist/network_ops', + opcintype => 'inet', opcdefault => 'f' }, +{ opcmethod => 'spgist', opcname => 'inet_ops', + opcfamily => 'spgist/network_ops', opcintype => 'inet' }, +{ oid => '1979', oid_symbol => 'INT2_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'int2_ops', opcfamily => 'btree/integer_ops', + opcintype => 'int2' }, +{ opcmethod => 'hash', opcname => 'int2_ops', opcfamily => 'hash/integer_ops', + opcintype => 'int2' }, +{ oid => '1978', oid_symbol => 'INT4_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'int4_ops', opcfamily => 'btree/integer_ops', + opcintype => 'int4' }, +{ opcmethod => 'hash', opcname => 'int4_ops', opcfamily => 'hash/integer_ops', + opcintype => 'int4' }, +{ oid => '3124', oid_symbol => 'INT8_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'int8_ops', opcfamily => 'btree/integer_ops', + opcintype => 'int8' }, +{ opcmethod => 'hash', opcname => 'int8_ops', opcfamily => 'hash/integer_ops', + opcintype => 'int8' }, +{ opcmethod => 'btree', opcname => 'interval_ops', + opcfamily => 'btree/interval_ops', opcintype => 'interval' }, +{ opcmethod => 'hash', opcname => 'interval_ops', + opcfamily => 'hash/interval_ops', opcintype => 'interval' }, +{ opcmethod => 'btree', opcname => 'macaddr_ops', + opcfamily => 'btree/macaddr_ops', opcintype => 'macaddr' }, +{ opcmethod => 'hash', opcname => 'macaddr_ops', + opcfamily => 'hash/macaddr_ops', opcintype => 'macaddr' }, +{ opcmethod => 'btree', opcname => 'macaddr8_ops', + opcfamily => 'btree/macaddr8_ops', opcintype => 'macaddr8' }, +{ opcmethod => 'hash', opcname => 'macaddr8_ops', + opcfamily => 'hash/macaddr8_ops', opcintype => 'macaddr8' }, + +# Here's an ugly little hack to save space in the system catalog indexes. +# btree doesn't ordinarily allow a storage type different from input type; +# but cstring and name are the same thing except for trailing padding, +# and we can safely omit that within an index entry. So we declare the +# btree opclass for name as using cstring storage type. +{ opcmethod => 'btree', opcname => 'name_ops', opcfamily => 'btree/name_ops', + opcintype => 'name', opckeytype => 'cstring' }, + +{ opcmethod => 'hash', opcname => 'name_ops', opcfamily => 'hash/name_ops', + opcintype => 'name' }, +{ oid => '3125', oid_symbol => 'NUMERIC_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'numeric_ops', + opcfamily => 'btree/numeric_ops', opcintype => 'numeric' }, +{ opcmethod => 'hash', opcname => 'numeric_ops', + opcfamily => 'hash/numeric_ops', opcintype => 'numeric' }, +{ oid => '1981', oid_symbol => 'OID_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'oid_ops', opcfamily => 'btree/oid_ops', + opcintype => 'oid' }, +{ opcmethod => 'hash', opcname => 'oid_ops', opcfamily => 'hash/oid_ops', + opcintype => 'oid' }, +{ opcmethod => 'btree', opcname => 'oidvector_ops', + opcfamily => 'btree/oidvector_ops', opcintype => 'oidvector' }, +{ opcmethod => 'hash', opcname => 'oidvector_ops', + opcfamily => 'hash/oidvector_ops', opcintype => 'oidvector' }, +{ opcmethod => 'btree', opcname => 'record_ops', + opcfamily => 'btree/record_ops', opcintype => 'record' }, +{ opcmethod => 'btree', opcname => 'record_image_ops', + opcfamily => 'btree/record_image_ops', opcintype => 'record', + opcdefault => 'f' }, +{ oid => '3126', oid_symbol => 'TEXT_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'text_ops', opcfamily => 'btree/text_ops', + opcintype => 'text' }, +{ opcmethod => 'hash', opcname => 'text_ops', opcfamily => 'hash/text_ops', + opcintype => 'text' }, +{ opcmethod => 'btree', opcname => 'time_ops', opcfamily => 'btree/time_ops', + opcintype => 'time' }, +{ opcmethod => 'hash', opcname => 'time_ops', opcfamily => 'hash/time_ops', + opcintype => 'time' }, +{ oid => '3127', oid_symbol => 'TIMESTAMPTZ_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'timestamptz_ops', + opcfamily => 'btree/datetime_ops', opcintype => 'timestamptz' }, +{ opcmethod => 'hash', opcname => 'timestamptz_ops', + opcfamily => 'hash/timestamptz_ops', opcintype => 'timestamptz' }, +{ opcmethod => 'btree', opcname => 'timetz_ops', + opcfamily => 'btree/timetz_ops', opcintype => 'timetz' }, +{ opcmethod => 'hash', opcname => 'timetz_ops', opcfamily => 'hash/timetz_ops', + opcintype => 'timetz' }, +{ opcmethod => 'btree', opcname => 'varbit_ops', + opcfamily => 'btree/varbit_ops', opcintype => 'varbit' }, +{ opcmethod => 'btree', opcname => 'varchar_ops', opcfamily => 'btree/text_ops', + opcintype => 'text', opcdefault => 'f' }, +{ opcmethod => 'hash', opcname => 'varchar_ops', opcfamily => 'hash/text_ops', + opcintype => 'text', opcdefault => 'f' }, +{ oid => '3128', oid_symbol => 'TIMESTAMP_BTREE_OPS_OID', + opcmethod => 'btree', opcname => 'timestamp_ops', + opcfamily => 'btree/datetime_ops', opcintype => 'timestamp' }, +{ opcmethod => 'hash', opcname => 'timestamp_ops', + opcfamily => 'hash/timestamp_ops', opcintype => 'timestamp' }, +{ opcmethod => 'btree', opcname => 'text_pattern_ops', + opcfamily => 'btree/text_pattern_ops', opcintype => 'text', + opcdefault => 'f' }, +{ opcmethod => 'btree', opcname => 'varchar_pattern_ops', + opcfamily => 'btree/text_pattern_ops', opcintype => 'text', + opcdefault => 'f' }, +{ opcmethod => 'btree', opcname => 'bpchar_pattern_ops', + opcfamily => 'btree/bpchar_pattern_ops', opcintype => 'bpchar', + opcdefault => 'f' }, +{ opcmethod => 'btree', opcname => 'money_ops', opcfamily => 'btree/money_ops', + opcintype => 'money' }, +{ opcmethod => 'hash', opcname => 'bool_ops', opcfamily => 'hash/bool_ops', + opcintype => 'bool' }, +{ opcmethod => 'hash', opcname => 'bytea_ops', opcfamily => 'hash/bytea_ops', + opcintype => 'bytea' }, +{ opcmethod => 'btree', opcname => 'tid_ops', opcfamily => 'btree/tid_ops', + opcintype => 'tid' }, +{ opcmethod => 'hash', opcname => 'xid_ops', opcfamily => 'hash/xid_ops', + opcintype => 'xid' }, +{ opcmethod => 'hash', opcname => 'cid_ops', opcfamily => 'hash/cid_ops', + opcintype => 'cid' }, +{ opcmethod => 'hash', opcname => 'abstime_ops', + opcfamily => 'hash/abstime_ops', opcintype => 'abstime' }, +{ opcmethod => 'hash', opcname => 'reltime_ops', + opcfamily => 'hash/reltime_ops', opcintype => 'reltime' }, +{ opcmethod => 'hash', opcname => 'text_pattern_ops', + opcfamily => 'hash/text_pattern_ops', opcintype => 'text', + opcdefault => 'f' }, +{ opcmethod => 'hash', opcname => 'varchar_pattern_ops', + opcfamily => 'hash/text_pattern_ops', opcintype => 'text', + opcdefault => 'f' }, +{ opcmethod => 'hash', opcname => 'bpchar_pattern_ops', + opcfamily => 'hash/bpchar_pattern_ops', opcintype => 'bpchar', + opcdefault => 'f' }, +{ opcmethod => 'btree', opcname => 'reltime_ops', + opcfamily => 'btree/reltime_ops', opcintype => 'reltime' }, +{ opcmethod => 'btree', opcname => 'tinterval_ops', + opcfamily => 'btree/tinterval_ops', opcintype => 'tinterval' }, +{ opcmethod => 'hash', opcname => 'aclitem_ops', + opcfamily => 'hash/aclitem_ops', opcintype => 'aclitem' }, +{ opcmethod => 'gist', opcname => 'box_ops', opcfamily => 'gist/box_ops', + opcintype => 'box' }, +{ opcmethod => 'gist', opcname => 'point_ops', opcfamily => 'gist/point_ops', + opcintype => 'point', opckeytype => 'box' }, +{ opcmethod => 'gist', opcname => 'poly_ops', opcfamily => 'gist/poly_ops', + opcintype => 'polygon', opckeytype => 'box' }, +{ opcmethod => 'gist', opcname => 'circle_ops', opcfamily => 'gist/circle_ops', + opcintype => 'circle', opckeytype => 'box' }, +{ opcmethod => 'gin', opcname => 'array_ops', opcfamily => 'gin/array_ops', + opcintype => 'anyarray', opckeytype => 'anyelement' }, +{ opcmethod => 'btree', opcname => 'uuid_ops', opcfamily => 'btree/uuid_ops', + opcintype => 'uuid' }, +{ opcmethod => 'hash', opcname => 'uuid_ops', opcfamily => 'hash/uuid_ops', + opcintype => 'uuid' }, +{ opcmethod => 'btree', opcname => 'pg_lsn_ops', + opcfamily => 'btree/pg_lsn_ops', opcintype => 'pg_lsn' }, +{ opcmethod => 'hash', opcname => 'pg_lsn_ops', opcfamily => 'hash/pg_lsn_ops', + opcintype => 'pg_lsn' }, +{ opcmethod => 'btree', opcname => 'enum_ops', opcfamily => 'btree/enum_ops', + opcintype => 'anyenum' }, +{ opcmethod => 'hash', opcname => 'enum_ops', opcfamily => 'hash/enum_ops', + opcintype => 'anyenum' }, +{ opcmethod => 'btree', opcname => 'tsvector_ops', + opcfamily => 'btree/tsvector_ops', opcintype => 'tsvector' }, +{ opcmethod => 'gist', opcname => 'tsvector_ops', + opcfamily => 'gist/tsvector_ops', opcintype => 'tsvector', + opckeytype => 'gtsvector' }, +{ opcmethod => 'gin', opcname => 'tsvector_ops', + opcfamily => 'gin/tsvector_ops', opcintype => 'tsvector', + opckeytype => 'text' }, +{ opcmethod => 'btree', opcname => 'tsquery_ops', + opcfamily => 'btree/tsquery_ops', opcintype => 'tsquery' }, +{ opcmethod => 'gist', opcname => 'tsquery_ops', + opcfamily => 'gist/tsquery_ops', opcintype => 'tsquery', + opckeytype => 'int8' }, +{ opcmethod => 'btree', opcname => 'range_ops', opcfamily => 'btree/range_ops', + opcintype => 'anyrange' }, +{ opcmethod => 'hash', opcname => 'range_ops', opcfamily => 'hash/range_ops', + opcintype => 'anyrange' }, +{ opcmethod => 'gist', opcname => 'range_ops', opcfamily => 'gist/range_ops', + opcintype => 'anyrange' }, +{ opcmethod => 'spgist', opcname => 'range_ops', + opcfamily => 'spgist/range_ops', opcintype => 'anyrange' }, +{ opcmethod => 'spgist', opcname => 'box_ops', opcfamily => 'spgist/box_ops', + opcintype => 'box' }, +{ opcmethod => 'spgist', opcname => 'quad_point_ops', + opcfamily => 'spgist/quad_point_ops', opcintype => 'point' }, +{ opcmethod => 'spgist', opcname => 'kd_point_ops', + opcfamily => 'spgist/kd_point_ops', opcintype => 'point', opcdefault => 'f' }, +{ opcmethod => 'spgist', opcname => 'text_ops', opcfamily => 'spgist/text_ops', + opcintype => 'text' }, +{ opcmethod => 'spgist', opcname => 'poly_ops', opcfamily => 'spgist/poly_ops', + opcintype => 'polygon', opckeytype => 'box' }, +{ opcmethod => 'btree', opcname => 'jsonb_ops', opcfamily => 'btree/jsonb_ops', + opcintype => 'jsonb' }, +{ opcmethod => 'hash', opcname => 'jsonb_ops', opcfamily => 'hash/jsonb_ops', + opcintype => 'jsonb' }, +{ opcmethod => 'gin', opcname => 'jsonb_ops', opcfamily => 'gin/jsonb_ops', + opcintype => 'jsonb', opckeytype => 'text' }, +{ opcmethod => 'gin', opcname => 'jsonb_path_ops', + opcfamily => 'gin/jsonb_path_ops', opcintype => 'jsonb', opcdefault => 'f', + opckeytype => 'int4' }, + +# BRIN operator classes + +# no brin opclass for bool + +{ opcmethod => 'brin', opcname => 'bytea_minmax_ops', + opcfamily => 'brin/bytea_minmax_ops', opcintype => 'bytea', + opckeytype => 'bytea' }, +{ opcmethod => 'brin', opcname => 'char_minmax_ops', + opcfamily => 'brin/char_minmax_ops', opcintype => 'char', + opckeytype => 'char' }, +{ opcmethod => 'brin', opcname => 'name_minmax_ops', + opcfamily => 'brin/name_minmax_ops', opcintype => 'name', + opckeytype => 'name' }, +{ opcmethod => 'brin', opcname => 'int8_minmax_ops', + opcfamily => 'brin/integer_minmax_ops', opcintype => 'int8', + opckeytype => 'int8' }, +{ opcmethod => 'brin', opcname => 'int2_minmax_ops', + opcfamily => 'brin/integer_minmax_ops', opcintype => 'int2', + opckeytype => 'int2' }, +{ opcmethod => 'brin', opcname => 'int4_minmax_ops', + opcfamily => 'brin/integer_minmax_ops', opcintype => 'int4', + opckeytype => 'int4' }, +{ opcmethod => 'brin', opcname => 'text_minmax_ops', + opcfamily => 'brin/text_minmax_ops', opcintype => 'text', + opckeytype => 'text' }, +{ opcmethod => 'brin', opcname => 'oid_minmax_ops', + opcfamily => 'brin/oid_minmax_ops', opcintype => 'oid', opckeytype => 'oid' }, +{ opcmethod => 'brin', opcname => 'tid_minmax_ops', + opcfamily => 'brin/tid_minmax_ops', opcintype => 'tid', opckeytype => 'tid' }, +{ opcmethod => 'brin', opcname => 'float4_minmax_ops', + opcfamily => 'brin/float_minmax_ops', opcintype => 'float4', + opckeytype => 'float4' }, +{ opcmethod => 'brin', opcname => 'float8_minmax_ops', + opcfamily => 'brin/float_minmax_ops', opcintype => 'float8', + opckeytype => 'float8' }, +{ opcmethod => 'brin', opcname => 'abstime_minmax_ops', + opcfamily => 'brin/abstime_minmax_ops', opcintype => 'abstime', + opckeytype => 'abstim