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
This commit is contained in:
Tom Lane 2018-04-08 13:16:50 -04:00
parent 02f3e558f2
commit 372728b0d4
110 changed files with 22953 additions and 12505 deletions

View File

@ -1,38 +1,647 @@
<!-- doc/src/sgml/bki.sgml -->
<chapter id="bki">
<title><acronym>BKI</acronym> Backend Interface</title>
<title>System Catalog Declarations and Initial Contents</title>
<para>
Backend Interface (<acronym>BKI</acronym>) files are scripts in a
special language that is understood by the
<productname>PostgreSQL</productname> backend when running in the
<quote>bootstrap</quote> mode. The bootstrap mode allows system catalogs
to be created and filled from scratch, whereas ordinary SQL commands
require the catalogs to exist already.
<acronym>BKI</acronym> files can therefore be used to create the
database system in the first place. (And they are probably not
useful for anything else.)
<productname>PostgreSQL</productname> 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.
</para>
<para>
<application>initdb</application> uses a <acronym>BKI</acronym> file
to do part of its job when creating a new database cluster. The
input file used by <application>initdb</application> is created as
part of building and installing <productname>PostgreSQL</productname>
by a program named <filename>genbki.pl</filename>, which reads some
specially formatted C header files in the <filename>src/include/catalog/</filename>
directory of the source tree. The created <acronym>BKI</acronym> file
is called <filename>postgres.bki</filename> and is
normally installed in the
<filename>share</filename> subdirectory of the installation tree.
The structures of the catalogs are declared in specially formatted C
header files in the <filename>src/include/catalog/</filename> directory of
the source tree. In particular, for each catalog there is a header file
named after the catalog (e.g., <filename>pg_class.h</filename>
for <structname>pg_class</structname>), 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 <filename>indexing.h</filename>, which defines the indexes present
on all the system catalogs, and <filename>toasting.h</filename>, which
defines TOAST tables for catalogs that need one.
</para>
<para>
Related information can be found in the documentation for
<application>initdb</application>.
Many of the catalogs have initial data that must be loaded into them
during the <quote>bootstrap</quote> phase
of <application>initdb</application>, to bring the system up to a point
where it is capable of executing SQL commands. (For
example, <filename>pg_class.h</filename> 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 <filename>src/include/catalog/</filename> directory. For example,
<filename>pg_proc.dat</filename> describes all the initial rows that must
be inserted into the <structname>pg_proc</structname> catalog.
</para>
<para>
To create the catalog files and load this initial data into them, a
backend running in bootstrap mode reads a <acronym>BKI</acronym>
(Backend Interface) file containing commands and initial data.
The <filename>postgres.bki</filename> file used in this mode is prepared
from the aforementioned header and data files, while building
a <productname>PostgreSQL</productname> distribution, by a Perl script
named <filename>genbki.pl</filename>.
Although it's specific to a particular <productname>PostgreSQL</productname>
release, <filename>postgres.bki</filename> is platform-independent and is
installed in the <filename>share</filename> subdirectory of the
installation tree.
</para>
<para>
<filename>genbki.pl</filename> also produces a derived header file for
each catalog, for example <filename>pg_class_d.h</filename> for
the <structname>pg_class</structname> 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.
</para>
<para>
Most Postgres developers don't need to be directly concerned with
the <acronym>BKI</acronym> 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 <acronym>BKI</acronym> file format.
</para>
<sect1 id="system-catalog-declarations">
<title>System Catalog Declaration Rules</title>
<para>
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 <literal>CATALOG</literal> macro, which so far as the C compiler is
concerned is just shorthand for <literal>typedef struct
FormData_<replaceable>catalogname</replaceable></literal>.
Each field in the struct gives rise to a catalog column.
Fields can be annotated using the BKI property macros described
in <filename>genbki.h</filename>, for example to define a default value
for a field or mark it as nullable or not nullable.
The <literal>CATALOG</literal> line can also be annotated, with some
other BKI property macros described in <filename>genbki.h</filename>, to
define other properties of the catalog as a whole, such as whether
it has OIDs (by default, it does).
</para>
<para>
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 <structname>pg_type</structname>.<structfield>typrelid</structfield>
to be NULL, it would fail when some piece of code tried to reference
<literal>typetup-&gt;typrelid</literal> (or worse,
<literal>typetup-&gt;typelem</literal>, because that follows
<structfield>typrelid</structfield>). This would result in
random errors or even segmentation violations.
</para>
<para>
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 <literal>#ifdef
CATALOG_VARLEN</literal> ... <literal>#endif</literal> (where
<literal>CATALOG_VARLEN</literal> 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 <structname>pg_attribute</structname>. The bootstrap code will
automatically mark catalog columns as <literal>NOT NULL</literal>
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
<literal>BKI_FORCE_NOT_NULL</literal>
and <literal>BKI_FORCE_NULL</literal> annotations as needed. But note
that <literal>NOT NULL</literal> 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.
</para>
<para>
Frontend code should not include any <structname>pg_xxx.h</structname>
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 <filename>src/backend/catalog/</filename> files.)
Instead, frontend code may include the corresponding
generated <structname>pg_xxx_d.h</structname> header, which will contain
OID <literal>#define</literal>s 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 <literal>#ifdef
EXPOSE_TO_CLIENT_CODE</literal> ... <literal>#endif</literal> around that
section to instruct <filename>genbki.pl</filename> to copy that section
to the <structname>pg_xxx_d.h</structname> header.
</para>
<para>
A few of the catalogs are so fundamental that they can't even be created
by the <acronym>BKI</acronym> <literal>create</literal> 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 <firstterm>bootstrap</firstterm> 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 <structname>pg_class</structname>
and <structname>pg_type</structname>, and those entries will need to be
updated for subsequent changes to the catalog's structure.
(Bootstrap catalogs also need pre-loaded entries
in <structname>pg_attribute</structname>, but
fortunately <filename>genbki.pl</filename> handles that chore nowadays.)
Avoid making new catalogs be bootstrap catalogs if at all possible.
</para>
</sect1>
<sect1 id="system-catalog-initial-data">
<title>System Catalog Initial Data</title>
<para>
Each catalog that has any manually-created initial data (some do not)
has a corresponding <literal>.dat</literal> file that contains its
initial data in an editable format.
</para>
<sect2 id="system-catalog-initial-data-format">
<title>Data File Format</title>
<para>
Each <literal>.dat</literal> 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 <filename>pg_database.dat</filename>
will demonstrate the key features:
</para>
<programlisting>
[
# 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 =&gt; '1', oid_symbol =&gt; 'TemplateDbOid',
descr =&gt; 'database\'s default template',
datname =&gt; 'template1', datdba =&gt; 'PGUID', encoding =&gt; 'ENCODING',
datcollate =&gt; '"LC_COLLATE"', datctype =&gt; '"LC_CTYPE"', datistemplate =&gt; 't',
datallowconn =&gt; 't', datconnlimit =&gt; '-1', datlastsysoid =&gt; '0',
datfrozenxid =&gt; '0', datminmxid =&gt; '1', dattablespace =&gt; '1663',
datacl =&gt; '_null_' },
]
</programlisting>
<para>
Points to note:
</para>
<itemizedlist>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
Within each catalog row, write comma-separated
<replaceable>key</replaceable> <literal>=&gt;</literal>
<replaceable>value</replaceable> pairs. The
allowed <replaceable>key</replaceable>s are the names of the catalog's
columns, plus the metadata keys <literal>oid</literal>,
<literal>oid_symbol</literal>, and <literal>descr</literal>.
(The use of <literal>oid</literal> and <literal>oid_symbol</literal>
is described in <xref linkend="system-catalog-oid-assignment"/>
below. <literal>descr</literal> supplies a description string for
the object, which will be inserted
into <structname>pg_description</structname>
or <structname>pg_shdescription</structname> as appropriate.)
While the metadata keys are optional, the catalog's defined columns
must all be provided, except when the catalog's <literal>.h</literal>
file specifies a default value for the column.
</para>
</listitem>
<listitem>
<para>
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.)
</para>
</listitem>
<listitem>
<para>
Null values are represented by <literal>_null_</literal>.
</para>
</listitem>
<listitem>
<para>
If a value is a macro to be expanded
by <application>initdb</application>, 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.
</para>
</listitem>
<listitem>
<para>
Comments are preceded by <literal>#</literal>, and must be on their
own lines.
</para>
</listitem>
<listitem>
<para>
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 <xref linkend="system-catalog-oid-references"/>
below.
</para>
</listitem>
<listitem>
<para>
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 <filename>reformat_dat_file.pl</filename>:
<itemizedlist>
<listitem>
<para>
Within each pair of curly braces, the metadata
fields <literal>oid</literal>, <literal>oid_symbol</literal>,
and <literal>descr</literal> (if present) come first, in that
order, then the catalog's own fields appear in their defined order.
</para>
</listitem>
<listitem>
<para>
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.
</para>
</listitem>
<listitem>
<para>
If the catalog's <literal>.h</literal> file specifies a default
value for a column, and a data entry has that same
value, <filename>reformat_dat_file.pl</filename> will omit it from
the data file. This keeps the data representation compact.
</para>
</listitem>
<listitem>
<para>
<filename>reformat_dat_file.pl</filename> preserves blank lines
and comment lines as-is.
</para>
</listitem>
</itemizedlist>
It's recommended to run <filename>reformat_dat_file.pl</filename>
before submitting catalog data patches. For convenience, you can
simply change to <filename>src/include/catalog/</filename> and
run <literal>make reformat-dat-files</literal>.
</para>
</listitem>
<listitem>
<para>
If you want to add a new method of making the data representation
smaller, you must implement it
in <filename>reformat_dat_file.pl</filename> and also
teach <function>Catalog::ParseData()</function> how to expand the
data back into the full representation.
</para>
</listitem>
</itemizedlist>
</sect2>
<sect2 id="system-catalog-oid-assignment">
<title>OID Assignment</title>
<para>
A catalog row appearing in the initial data can be given a
manually-assigned OID by writing an <literal>oid
=&gt; <replaceable>nnnn</replaceable></literal> metadata field.
Furthermore, if an OID is assigned, a C macro for that OID can be
created by writing an <literal>oid_symbol
=&gt; <replaceable>name</replaceable></literal> metadata field.
</para>
<para>
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 <literal>oid</literal> 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.
</para>
<para>
Writing the actual numeric value of any OID in C code is considered
very bad form; always use a macro, instead. Direct references
to <structname>pg_proc</structname> OIDs are common enough that there's
a special mechanism to create the necessary macros automatically;
see <filename>src/backend/utils/Gen_fmgrtab.pl</filename>. Similarly
&mdash; but, for historical reasons, not done the same way &mdash;
there's an automatic method for creating macros
for <structname>pg_type</structname>
OIDs. <literal>oid_symbol</literal> entries are therefore not
necessary in those two catalogs. Likewise, macros for
the <structname>pg_class</structname> 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 <literal>oid_symbol</literal> entries.
</para>
<para>
To find an available OID for a new pre-loaded row, run the
script <filename>src/include/catalog/unused_oids</filename>.
It prints inclusive ranges of unused OIDs (e.g., the output
line <quote>45-900</quote> means OIDs 45 through 900 have not been
allocated yet). Currently, OIDs 1-9999 are reserved for manual
assignment; the <filename>unused_oids</filename> script simply looks
through the catalog headers and <filename>.dat</filename> files
to see which ones do not appear. You can also use
the <filename>duplicate_oids</filename> script to check for mistakes.
(That script is run automatically at compile time, and will stop the
build if a duplicate is found.)
</para>
<para>
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 <literal>oid</literal> field, then it will
receive an OID of 10000 or above.
</para>
</sect2>
<sect2 id="system-catalog-oid-references">
<title>OID Reference Lookup</title>
<para>
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, <filename>genbki.pl</filename> 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:
</para>
<itemizedlist>
<listitem>
<para>
Use of symbolic references is enabled in a particular catalog column
by attaching <literal>BKI_LOOKUP(<replaceable>lookuprule</replaceable>)</literal>
to the column's definition, where <replaceable>lookuprule</replaceable>
is <structname>pg_am</structname>, <structname>pg_proc</structname>,
<structname>pg_operator</structname>,
<structname>pg_opclass</structname>,
<structname>pg_opfamily</structname>,
or <structname>pg_type</structname>.
<literal>BKI_LOOKUP</literal> can be attached to columns of
type <type>Oid</type>, <type>regproc</type>, <type>oidvector</type>,
or <type>Oid[]</type>; in the latter two cases it implies performing a
lookup on each element of the array.
</para>
</listitem>
<listitem>
<para>
In such a column, all entries must use the symbolic format except
when writing <literal>0</literal> for InvalidOid. (If the column is
declared <type>regproc</type>, you can optionally
write <literal>-</literal> instead of <literal>0</literal>.)
<filename>genbki.pl</filename> will warn about unrecognized names.
</para>
</listitem>
<listitem>
<para>
Access methods are just represented by their names, as are types.
Type names must match the referenced <structname>pg_type</structname>
entry's <structfield>typname</structfield>; you do not get to use any
aliases such as <literal>integer</literal>
for <literal>int4</literal>.
</para>
</listitem>
<listitem>
<para>
A function can be represented by
its <structfield>proname</structfield>, if that is unique among
the <filename>pg_proc.dat</filename> entries (this works like regproc
input). Otherwise, write it
as <replaceable>proname(argtypename,argtypename,...)</replaceable>,
like regprocedure. The argument type names must be spelled exactly as
they are in the <filename>pg_proc.dat</filename> entry's
<structfield>proargtypes</structfield> field. Do not insert any
spaces.
</para>
</listitem>
<listitem>
<para>
Operators are represented
by <replaceable>oprname(lefttype,righttype)</replaceable>,
writing the type names exactly as they appear in
the <filename>pg_operator.dat</filename>
entry's <structfield>oprleft</structfield>
and <structfield>oprright</structfield> fields.
(Write <literal>0</literal> for the omitted operand of a unary
operator.)
</para>
</listitem>
<listitem>
<para>
The names of opclasses and opfamilies are only unique within an
access method, so they are represented
by <replaceable>access_method_name</replaceable><literal>/</literal><replaceable>object_name</replaceable>.
</para>
</listitem>
<listitem>
<para>
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.
</para>
</listitem>
</itemizedlist>
<para>
<filename>genbki.pl</filename> 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.
</para>
</sect2>
<sect2 id="system-catalog-recipes">
<title>Recipes for Editing Data Files</title>
<para>
Here are some suggestions about the easiest ways to perform common tasks
when updating catalog data files.
</para>
<formalpara>
<title>Add a new column with a default to a catalog:</title>
<para>
Add the column to the header file with
a <literal>BKI_DEFAULT(<replaceable>value</replaceable>)</literal>
annotation. The data file need only be adjusted by adding the field
in existing rows where a non-default value is needed.
</para>
</formalpara>
<formalpara>
<title>Add a default value to an existing column that doesn't have
one:</title>
<para>
Add a <literal>BKI_DEFAULT</literal> annotation to the header file,
then run <literal>make reformat-dat-files</literal> to remove
now-redundant field entries.
</para>
</formalpara>
<formalpara>
<title>Remove a column, whether it has a default or not:</title>
<para>
Remove the column from the header, then run <literal>make
reformat-dat-files</literal> to remove now-useless field entries.
</para>
</formalpara>
<formalpara>
<title>Change or remove an existing default value:</title>
<para>
You cannot simply change the header file, since that will cause the
current data to be interpreted incorrectly. First run <literal>make
expand-dat-files</literal> to rewrite the data files with all
default values inserted explicitly, then change or remove
the <literal>BKI_DEFAULT</literal> annotation, then run <literal>make
reformat-dat-files</literal> to remove superfluous fields again.
</para>
</formalpara>
<formalpara>
<title>Ad-hoc bulk editing:</title>
<para>
<filename>reformat_dat_file.pl</filename> 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 <structname>pg_proc</structname>
into a char field:
<orderedlist>
<listitem>
<para>
Add the new column, with a default,
to <filename>pg_proc.h</filename>:
<programlisting>
+ /* see PROKIND_ categories below */
+ char prokind BKI_DEFAULT(f);
</programlisting>
</para>
</listitem>
<listitem>
<para>
Create a new script based on <filename>reformat_dat_file.pl</filename>
to insert appropriate values on-the-fly:
<programlisting>
- # 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';
+ }
</programlisting>
</para>
</listitem>
<listitem>
<para>
Run the new script:
<programlisting>
$ cd src/include/catalog
$ perl -I ../../backend/catalog rewrite_dat_with_prokind.pl pg_proc.dat
</programlisting>
At this point <filename>pg_proc.dat</filename> has all three
columns, <structfield>prokind</structfield>,
<structfield>proisagg</structfield>,
and <structfield>proiswindow</structfield>, though they will appear
only in rows where they have non-default values.
</para>
</listitem>
<listitem>
<para>
Remove the old columns from <filename>pg_proc.h</filename>:
<programlisting>
- /* is it an aggregate? */
- bool proisagg BKI_DEFAULT(f);
-
- /* is it a window function? */
- bool proiswindow BKI_DEFAULT(f);
</programlisting>
</para>
</listitem>
<listitem>
<para>
Finally, run <literal>make reformat-dat-files</literal> to remove
the useless old entries from <filename>pg_proc.dat</filename>.
</para>
</listitem>
</orderedlist>
For further examples of scripts used for bulk editing, see
<filename>convert_oid2name.pl</filename>
and <filename>remove_pg_type_oid_symbols.pl</filename> attached to this
message:
<ulink url="https://www.postgresql.org/message-id/CAJVSVGVX8gXnPm+Xa=DxR7kFYprcQ1tNcCT5D0O3ShfnM6jehA@mail.gmail.com"></ulink>
</para>
</formalpara>
</sect2>
</sect1>
<sect1 id="bki-format">
<title><acronym>BKI</acronym> File Format</title>
@ -76,10 +685,10 @@
<optional><literal>rowtype_oid</literal> <replaceable>oid</replaceable></optional>
(<replaceable class="parameter">name1</replaceable> =
<replaceable class="parameter">type1</replaceable>
<optional>FORCE NOT NULL | FORCE NULL </optional> <optional>,
<optional><literal>FORCE NOT NULL</literal> | <literal>FORCE NULL</literal> </optional> <optional>,
<replaceable class="parameter">name2</replaceable> =
<replaceable class="parameter">type2</replaceable>
<optional>FORCE NOT NULL | FORCE NULL </optional>,
<optional><literal>FORCE NOT NULL</literal> | <literal>FORCE NULL</literal> </optional>,
...</optional>)
</term>
@ -106,7 +715,7 @@
tables containing columns of other types, this cannot be done until
after <structname>pg_type</structname> 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.)
</para>
@ -340,7 +949,7 @@
</sect1>
<sect1 id="bki-example">
<title>Example</title>
<title>BKI Example</title>
<para>
The following sequence of commands will create the

View File

@ -3566,7 +3566,7 @@ Oid PQftype(const PGresult *res,
You can query the system table <literal>pg_type</literal> to
obtain the names and properties of the various data types. The
<acronym>OID</acronym>s of the built-in data types are defined
in the file <filename>src/include/catalog/pg_type.h</filename>
in the file <filename>src/include/catalog/pg_type_d.h</filename>
in the source tree.
</para>
</listitem>

View File

@ -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

View File

@ -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 \

View File

@ -2,3 +2,5 @@
/postgres.description
/postgres.shdescription
/schemapg.h
/pg_*_d.h
/bki-stamp

View File

@ -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;/\*;)
# Set appropriate flag when we're in certain code sections.
if (/^#/)
{
# 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;
$is_varlen = 1 if /^#ifdef\s+CATALOG_VARLEN/;
if (/^#ifdef\s+EXPOSE_TO_CLIENT_CODE/)
{
$is_client_code = 1;
next;
}
next if !$is_client_code;
}
# Remember input line number for later.
my $input_line_number = $.;
if (!$is_client_code)
{
# Strip C-style comments.
s;/\*(.|\n)*\*/;;g;
if (m;/\*;)
{
# Strip useless whitespace and trailing semicolons.
chomp;
s/^\s+//;
s/;\s*$//;
s/\s+/ /g;
# 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;
}
# Push the data into the appropriate data structure.
if (/$natts_pat\s+(\d+)/)
if (/^DECLARE_TOAST\(\s*(\w+),\s*(\d+),\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\(\"(.*)\"\)$/)
{
$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 '')
{
$most_recent->{descr} = $1;
}
}
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 '')
{
$most_recent->{shdescr} = $1;
}
}
elsif (/^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 ($is_client_code)
{
if (/^#endif/)
{
$is_client_code = 0;
}
else
{
push @{ $catalog{client_code} }, $_;
}
}
elsif ($declaring_attributes)
{
next if (/^{|^$/);
if (/^#/)
{
$is_varlen = 1 if /^#ifdef\s+CATALOG_VARLEN/;
next;
}
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;
my ($input_file, $schema, $preserve_formatting) = @_;
# 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;
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 = [];
return @result;
# 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;

View File

@ -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)

View File

@ -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.

View File

@ -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');
# Read all the input header files into internal data structures
my $catalogs = Catalog::Catalogs(@input_files);
# Generate postgres.bki, postgres.description, and postgres.shdescription
# Build lookup tables for OID macro substitutions and for pg_attribute
# copies of pg_type values.
# index access method OID lookup
my %amoids;
foreach my $row (@{ $catalog_data{pg_am} })
{
$amoids{ $row->{amname} } = $row->{oid};
}
# 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 <<EOM, $catname, $catname, uc $catname, uc $catname;
/*-------------------------------------------------------------------------
*
* %s_d.h
* Macro definitions for %s
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* NOTES
* ******************************
* *** DO NOT EDIT THIS FILE! ***
* ******************************
*
* It has been GENERATED by src/backend/catalog/genbki.pl
*
*-------------------------------------------------------------------------
*/
#ifndef %s_D_H
#define %s_D_H
EOM
# Emit OID macros for catalog's OID and rowtype OID, if wanted
printf $def "#define %s %s\n",
$catalog->{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)
{
my $table = $catalogs->{$table_name};
push @attnames, $column->{name};
}
foreach my $table_name (@catnames)
{
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 <<EOM;
Usage: genbki.pl [options] header...
Options:
-I path to include files
-o output path
--set-version PostgreSQL version number for initdb cross-check
genbki.pl generates BKI files from specially formatted
header files. These BKI files are used to initialize the
genbki.pl generates BKI files and symbol definition
headers from specially formatted header files and .dat
files. The BKI files are used to initialize the
postgres template database.
Report bugs to <pgsql-bugs\@postgresql.org>.

View File

@ -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 data from the include/catalog files.
my $catalogs = Catalog::Catalogs($infile);
# Collect the raw data from pg_proc.h.
my @fmgr = ();
my @attnames;
foreach my $column (@{ $catalogs->{pg_proc}->{columns} })
# 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)
{
push @attnames, $column->{name};
$datfile =~ /(.+)\.dat$/
or die "Input files need to be data (.dat) files.\n";
my $header = "$1.h";
die "There in no header file corresponding to $datfile"
if ! -e $header;
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');
# Split line into tokens without interpreting their meaning.
my %bki_values;
@bki_values{@attnames} = Catalog::SplitDataLine($row->{bki_values});
# Collect certain fields from pg_proc.dat.
my @fmgr = ();
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;
Usage: perl -I [directory of Catalog.pm] Gen_fmgrtab.pl [path to pg_proc.h]
Usage: perl -I [directory of Catalog.pm] Gen_fmgrtab.pl -I [include path] [path to pg_proc.dat]
Gen_fmgrtab.pl generates fmgroids.h, fmgrprotos.h, and fmgrtab.c from
pg_proc.h
pg_proc.dat
Report bugs to <pgsql-bugs\@postgresql.org>.
EOM

View File

@ -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 $< > $@

View File

@ -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

View File

@ -1 +1,3 @@
/schemapg.h
/pg_*_d.h
/header-stamp

View File

@ -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

View File

@ -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+)/

View File

@ -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 */

View File

@ -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

View File

@ -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' },
]

View File

@ -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 */

View File

@ -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' },
]

View File

@ -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 */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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_' },
]

View File

@ -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 */

View File

@ -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' },
]

View File

@ -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 */

View File

@ -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_' },
]

View File

@ -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 */

View File

@ -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_' },
]

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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_' },
]

View File

@ -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 */

View File

@ -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
*/

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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
*/

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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 */

View File

@ -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

View File

@ -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 */

View File

@ -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 */

View File

@ -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_' },
]

View File

@ -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 */

View File

@ -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);

View File

@ -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 */

View File

@ -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_' },
]

View File

@ -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
*/

View File

@ -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 => 'abstime' },
{ opcmethod => 'brin', opcname => 'reltime_minmax_ops',
opcfamily => 'brin/reltime_minmax_ops', opcintype => 'reltime',
opckeytype => 'reltime' },
{ opcmethod => 'brin', opcname => 'macaddr_minmax_ops',
opcfamily => 'brin/macaddr_minmax_ops', opcintype => 'macaddr',
opckeytype => 'macaddr' },
{ opcmethod => 'brin', opcname => 'macaddr8_minmax_ops',
opcfamily => 'brin/macaddr8_minmax_ops', opcintype => 'macaddr8',
opckeytype => 'macaddr8' },
{ opcmethod => 'brin', opcname => 'inet_minmax_ops',
opcfamily => 'brin/network_minmax_ops', opcintype => 'inet',
opcdefault => 'f', opckeytype => 'inet' },
{ opcmethod => 'brin', opcname => 'inet_inclusion_ops',
opcfamily => 'brin/network_inclusion_ops', opcintype => 'inet',
opckeytype => 'inet' },
{ opcmethod => 'brin', opcname => 'bpchar_minmax_ops',
opcfamily => 'brin/bpchar_minmax_ops', opcintype => 'bpchar',
opckeytype => 'bpchar' },
{ opcmethod => 'brin', opcname => 'time_minmax_ops',
opcfamily => 'brin/time_minmax_ops', opcintype => 'time',
opckeytype => 'time' },
{ opcmethod => 'brin', opcname => 'date_minmax_ops',
opcfamily => 'brin/datetime_minmax_ops', opcintype => 'date',
opckeytype => 'date' },
{ opcmethod => 'brin', opcname => 'timestamp_minmax_ops',
opcfamily => 'brin/datetime_minmax_ops', opcintype => 'timestamp',
opckeytype => 'timestamp' },
{ opcmethod => 'brin', opcname => 'timestamptz_minmax_ops',
opcfamily => 'brin/datetime_minmax_ops', opcintype => 'timestamptz',
opckeytype => 'timestamptz' },
{ opcmethod => 'brin', opcname => 'interval_minmax_ops',
opcfamily => 'brin/interval_minmax_ops', opcintype => 'interval',
opckeytype => 'interval' },
{ opcmethod => 'brin', opcname => 'timetz_minmax_ops',
opcfamily => 'brin/timetz_minmax_ops', opcintype => 'timetz',
opckeytype => 'timetz' },
{ opcmethod => 'brin', opcname => 'bit_minmax_ops',
opcfamily => 'brin/bit_minmax_ops', opcintype => 'bit', opckeytype => 'bit' },
{ opcmethod => 'brin', opcname => 'varbit_minmax_ops',
opcfamily => 'brin/varbit_minmax_ops', opcintype => 'varbit',
opckeytype => 'varbit' },
{ opcmethod => 'brin', opcname => 'numeric_minmax_ops',
opcfamily => 'brin/numeric_minmax_ops', opcintype => 'numeric',
opckeytype => 'numeric' },
# no brin opclass for record, anyarray
{ opcmethod => 'brin', opcname => 'uuid_minmax_ops',
opcfamily => 'brin/uuid_minmax_ops', opcintype => 'uuid',
opckeytype => 'uuid' },
{ opcmethod => 'brin', opcname => 'range_inclusion_ops',
opcfamily => 'brin/range_inclusion_ops', opcintype => 'anyrange',
opckeytype => 'anyrange' },
{ opcmethod => 'brin', opcname => 'pg_lsn_minmax_ops',
opcfamily => 'brin/pg_lsn_minmax_ops', opcintype => 'pg_lsn',
opckeytype => 'pg_lsn' },
# no brin opclass for enum, tsvector, tsquery, jsonb
{ opcmethod => 'brin', opcname => 'box_inclusion_ops',
opcfamily => 'brin/box_inclusion_ops', opcintype => 'box',
opckeytype => 'box' },
# no brin opclass for the geometric types except box
]

View File

@ -2,7 +2,6 @@
*
* pg_opclass.h
* definition of the system "opclass" relation (pg_opclass)
* along with the relation's initial contents.
*
* The primary key for this table is <opcmethod, opcname, opcnamespace> ---
* that is, there is a row for each valid combination of opclass name and
@ -31,8 +30,8 @@
* src/include/catalog/pg_opclass.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.
*
*-------------------------------------------------------------------------
*/
@ -40,24 +39,38 @@
#define PG_OPCLASS_H
#include "catalog/genbki.h"
#include "catalog/pg_opclass_d.h"
/* ----------------
* pg_opclass definition. cpp turns this into
* typedef struct FormData_pg_opclass
* ----------------
*/
#define OperatorClassRelationId 2616
CATALOG(pg_opclass,2616)
CATALOG(pg_opclass,2616,OperatorClassRelationId)
{
Oid opcmethod; /* index access method opclass is for */
NameData opcname; /* name of this opclass */
Oid opcnamespace; /* namespace of this opclass */
Oid opcowner; /* opclass owner */
Oid opcfamily; /* containing operator family */
Oid opcintype; /* type of data indexed by opclass */
bool opcdefault; /* T if opclass is default for opcintype */
Oid opckeytype; /* type of data in index, or InvalidOid */
/* index access method opclass is for */
Oid opcmethod BKI_LOOKUP(pg_am);
/* name of this opclass */
NameData opcname;
/* namespace of this opclass */
Oid opcnamespace BKI_DEFAULT(PGNSP);
/* opclass owner */
Oid opcowner BKI_DEFAULT(PGUID);
/* containing operator family */
Oid opcfamily BKI_LOOKUP(pg_opfamily);
/* type of data indexed by opclass */
Oid opcintype BKI_LOOKUP(pg_type);
/* T if opclass is default for opcintype */
bool opcdefault BKI_DEFAULT(t);
/* type of data in index, or InvalidOid */
Oid opckeytype BKI_DEFAULT(0) BKI_LOOKUP(pg_type);
} FormData_pg_opclass;
/* ----------------
@ -67,185 +80,4 @@ CATALOG(pg_opclass,2616)
*/
typedef FormData_pg_opclass *Form_pg_opclass;
/* ----------------
* compiler constants for pg_opclass
* ----------------
*/
#define Natts_pg_opclass 8
#define Anum_pg_opclass_opcmethod 1
#define Anum_pg_opclass_opcname 2
#define Anum_pg_opclass_opcnamespace 3
#define Anum_pg_opclass_opcowner 4
#define Anum_pg_opclass_opcfamily 5
#define Anum_pg_opclass_opcintype 6
#define Anum_pg_opclass_opcdefault 7
#define Anum_pg_opclass_opckeytype 8
/* ----------------
* initial contents of pg_opclass
*
* 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.
* ----------------
*/
DATA(insert ( 403 abstime_ops PGNSP PGUID 421 702 t 0 ));
DATA(insert ( 403 array_ops PGNSP PGUID 397 2277 t 0 ));
DATA(insert ( 405 array_ops PGNSP PGUID 627 2277 t 0 ));
DATA(insert ( 403 bit_ops PGNSP PGUID 423 1560 t 0 ));
DATA(insert ( 403 bool_ops PGNSP PGUID 424 16 t 0 ));
DATA(insert ( 403 bpchar_ops PGNSP PGUID 426 1042 t 0 ));
DATA(insert ( 405 bpchar_ops PGNSP PGUID 427 1042 t 0 ));
DATA(insert ( 403 bytea_ops PGNSP PGUID 428 17 t 0 ));
DATA(insert ( 403 char_ops PGNSP PGUID 429 18 t 0 ));
DATA(insert ( 405 char_ops PGNSP PGUID 431 18 t 0 ));
DATA(insert ( 403 cidr_ops PGNSP PGUID 1974 869 f 0 ));
DATA(insert ( 405 cidr_ops PGNSP PGUID 1975 869 f 0 ));
DATA(insert OID = 3122 ( 403 date_ops PGNSP PGUID 434 1082 t 0 ));
#define DATE_BTREE_OPS_OID 3122
DATA(insert ( 405 date_ops PGNSP PGUID 435 1082 t 0 ));
DATA(insert ( 403 float4_ops PGNSP PGUID 1970 700 t 0 ));
DATA(insert ( 405 float4_ops PGNSP PGUID 1971 700 t 0 ));
DATA(insert OID = 3123 ( 403 float8_ops PGNSP PGUID 1970 701 t 0 ));
#define FLOAT8_BTREE_OPS_OID 3123
DATA(insert ( 405 float8_ops PGNSP PGUID 1971 701 t 0 ));
DATA(insert ( 403 inet_ops PGNSP PGUID 1974 869 t 0 ));
DATA(insert ( 405 inet_ops PGNSP PGUID 1975 869 t 0 ));
DATA(insert ( 783 inet_ops PGNSP PGUID 3550 869 f 0 ));
DATA(insert ( 4000 inet_ops PGNSP PGUID 3794 869 t 0 ));
DATA(insert OID = 1979 ( 403 int2_ops PGNSP PGUID 1976 21 t 0 ));
#define INT2_BTREE_OPS_OID 1979
DATA(insert ( 405 int2_ops PGNSP PGUID 1977 21 t 0 ));
DATA(insert OID = 1978 ( 403 int4_ops PGNSP PGUID 1976 23 t 0 ));
#define INT4_BTREE_OPS_OID 1978
DATA(insert ( 405 int4_ops PGNSP PGUID 1977 23 t 0 ));
DATA(insert OID = 3124 ( 403 int8_ops PGNSP PGUID 1976 20 t 0 ));
#define INT8_BTREE_OPS_OID 3124
DATA(insert ( 405 int8_ops PGNSP PGUID 1977 20 t 0 ));
DATA(insert ( 403 interval_ops PGNSP PGUID 1982 1186 t 0 ));
DATA(insert ( 405 interval_ops PGNSP PGUID 1983 1186 t 0 ));
DATA(insert ( 403 macaddr_ops PGNSP PGUID 1984 829 t 0 ));
DATA(insert ( 405 macaddr_ops PGNSP PGUID 1985 829 t 0 ));
DATA(insert ( 403 macaddr8_ops PGNSP PGUID 3371 774 t 0 ));
DATA(insert ( 405 macaddr8_ops PGNSP PGUID 3372 774 t 0 ));
/*
* 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.
*/
DATA(insert ( 403 name_ops PGNSP PGUID 1986 19 t 2275 ));
DATA(insert ( 405 name_ops PGNSP PGUID 1987 19 t 0 ));
DATA(insert OID = 3125 ( 403 numeric_ops PGNSP PGUID 1988 1700 t 0 ));
#define NUMERIC_BTREE_OPS_OID 3125
DATA(insert ( 405 numeric_ops PGNSP PGUID 1998 1700 t 0 ));
DATA(insert OID = 1981 ( 403 oid_ops PGNSP PGUID 1989 26 t 0 ));
#define OID_BTREE_OPS_OID 1981
DATA(insert ( 405 oid_ops PGNSP PGUID 1990 26 t 0 ));
DATA(insert ( 403 oidvector_ops PGNSP PGUID 1991 30 t 0 ));
DATA(insert ( 405 oidvector_ops PGNSP PGUID 1992 30 t 0 ));
DATA(insert ( 403 record_ops PGNSP PGUID 2994 2249 t 0 ));
DATA(insert ( 403 record_image_ops PGNSP PGUID 3194 2249 f 0 ));
DATA(insert OID = 3126 ( 403 text_ops PGNSP PGUID 1994 25 t 0 ));
#define TEXT_BTREE_OPS_OID 3126
DATA(insert ( 405 text_ops PGNSP PGUID 1995 25 t 0 ));
DATA(insert ( 403 time_ops PGNSP PGUID 1996 1083 t 0 ));
DATA(insert ( 405 time_ops PGNSP PGUID 1997 1083 t 0 ));
DATA(insert OID = 3127 ( 403 timestamptz_ops PGNSP PGUID 434 1184 t 0 ));
#define TIMESTAMPTZ_BTREE_OPS_OID 3127
DATA(insert ( 405 timestamptz_ops PGNSP PGUID 1999 1184 t 0 ));
DATA(insert ( 403 timetz_ops PGNSP PGUID 2000 1266 t 0 ));
DATA(insert ( 405 timetz_ops PGNSP PGUID 2001 1266 t 0 ));
DATA(insert ( 403 varbit_ops PGNSP PGUID 2002 1562 t 0 ));
DATA(insert ( 403 varchar_ops PGNSP PGUID 1994 25 f 0 ));
DATA(insert ( 405 varchar_ops PGNSP PGUID 1995 25 f 0 ));
DATA(insert OID = 3128 ( 403 timestamp_ops PGNSP PGUID 434 1114 t 0 ));
#define TIMESTAMP_BTREE_OPS_OID 3128
DATA(insert ( 405 timestamp_ops PGNSP PGUID 2040 1114 t 0 ));
DATA(insert ( 403 text_pattern_ops PGNSP PGUID 2095 25 f 0 ));
DATA(insert ( 403 varchar_pattern_ops PGNSP PGUID 2095 25 f 0 ));
DATA(insert ( 403 bpchar_pattern_ops PGNSP PGUID 2097 1042 f 0 ));
DATA(insert ( 403 money_ops PGNSP PGUID 2099 790 t 0 ));
DATA(insert ( 405 bool_ops PGNSP PGUID 2222 16 t 0 ));
DATA(insert ( 405 bytea_ops PGNSP PGUID 2223 17 t 0 ));
DATA(insert ( 403 tid_ops PGNSP PGUID 2789 27 t 0 ));
DATA(insert ( 405 xid_ops PGNSP PGUID 2225 28 t 0 ));
DATA(insert ( 405 cid_ops PGNSP PGUID 2226 29 t 0 ));
DATA(insert ( 405 abstime_ops PGNSP PGUID 2227 702 t 0 ));
DATA(insert ( 405 reltime_ops PGNSP PGUID 2228 703 t 0 ));
DATA(insert ( 405 text_pattern_ops PGNSP PGUID 2229 25 f 0 ));
DATA(insert ( 405 varchar_pattern_ops PGNSP PGUID 2229 25 f 0 ));
DATA(insert ( 405 bpchar_pattern_ops PGNSP PGUID 2231 1042 f 0 ));
DATA(insert ( 403 reltime_ops PGNSP PGUID 2233 703 t 0 ));
DATA(insert ( 403 tinterval_ops PGNSP PGUID 2234 704 t 0 ));
DATA(insert ( 405 aclitem_ops PGNSP PGUID 2235 1033 t 0 ));
DATA(insert ( 783 box_ops PGNSP PGUID 2593 603 t 0 ));
DATA(insert ( 783 point_ops PGNSP PGUID 1029 600 t 603 ));
DATA(insert ( 783 poly_ops PGNSP PGUID 2594 604 t 603 ));
DATA(insert ( 783 circle_ops PGNSP PGUID 2595 718 t 603 ));
DATA(insert ( 2742 array_ops PGNSP PGUID 2745 2277 t 2283 ));
DATA(insert ( 403 uuid_ops PGNSP PGUID 2968 2950 t 0 ));
DATA(insert ( 405 uuid_ops PGNSP PGUID 2969 2950 t 0 ));
DATA(insert ( 403 pg_lsn_ops PGNSP PGUID 3253 3220 t 0 ));
DATA(insert ( 405 pg_lsn_ops PGNSP PGUID 3254 3220 t 0 ));
DATA(insert ( 403 enum_ops PGNSP PGUID 3522 3500 t 0 ));
DATA(insert ( 405 enum_ops PGNSP PGUID 3523 3500 t 0 ));
DATA(insert ( 403 tsvector_ops PGNSP PGUID 3626 3614 t 0 ));
DATA(insert ( 783 tsvector_ops PGNSP PGUID 3655 3614 t 3642 ));
DATA(insert ( 2742 tsvector_ops PGNSP PGUID 3659 3614 t 25 ));
DATA(insert ( 403 tsquery_ops PGNSP PGUID 3683 3615 t 0 ));
DATA(insert ( 783 tsquery_ops PGNSP PGUID 3702 3615 t 20 ));
DATA(insert ( 403 range_ops PGNSP PGUID 3901 3831 t 0 ));
DATA(insert ( 405 range_ops PGNSP PGUID 3903 3831 t 0 ));
DATA(insert ( 783 range_ops PGNSP PGUID 3919 3831 t 0 ));
DATA(insert ( 4000 range_ops PGNSP PGUID 3474 3831 t 0 ));
DATA(insert ( 4000 box_ops PGNSP PGUID 5000 603 t 0 ));
DATA(insert ( 4000 quad_point_ops PGNSP PGUID 4015 600 t 0 ));
DATA(insert ( 4000 kd_point_ops PGNSP PGUID 4016 600 f 0 ));
DATA(insert ( 4000 text_ops PGNSP PGUID 4017 25 t 0 ));
DATA(insert ( 4000 poly_ops PGNSP PGUID 5008 604 t 603 ));
DATA(insert ( 403 jsonb_ops PGNSP PGUID 4033 3802 t 0 ));
DATA(insert ( 405 jsonb_ops PGNSP PGUID 4034 3802 t 0 ));
DATA(insert ( 2742 jsonb_ops PGNSP PGUID 4036 3802 t 25 ));
DATA(insert ( 2742 jsonb_path_ops PGNSP PGUID 4037 3802 f 23 ));
/* BRIN operator classes */
/* no brin opclass for bool */
DATA(insert ( 3580 bytea_minmax_ops PGNSP PGUID 4064 17 t 17 ));
DATA(insert ( 3580 char_minmax_ops PGNSP PGUID 4062 18 t 18 ));
DATA(insert ( 3580 name_minmax_ops PGNSP PGUID 4065 19 t 19 ));
DATA(insert ( 3580 int8_minmax_ops PGNSP PGUID 4054 20 t 20 ));
DATA(insert ( 3580 int2_minmax_ops PGNSP PGUID 4054 21 t 21 ));
DATA(insert ( 3580 int4_minmax_ops PGNSP PGUID 4054 23 t 23 ));
DATA(insert ( 3580 text_minmax_ops PGNSP PGUID 4056 25 t 25 ));
DATA(insert ( 3580 oid_minmax_ops PGNSP PGUID 4068 26 t 26 ));
DATA(insert ( 3580 tid_minmax_ops PGNSP PGUID 4069 27 t 27 ));
DATA(insert ( 3580 float4_minmax_ops PGNSP PGUID 4070 700 t 700 ));
DATA(insert ( 3580 float8_minmax_ops PGNSP PGUID 4070 701 t 701 ));
DATA(insert ( 3580 abstime_minmax_ops PGNSP PGUID 4072 702 t 702 ));
DATA(insert ( 3580 reltime_minmax_ops PGNSP PGUID 4073 703 t 703 ));
DATA(insert ( 3580 macaddr_minmax_ops PGNSP PGUID 4074 829 t 829 ));
DATA(insert ( 3580 macaddr8_minmax_ops PGNSP PGUID 4109 774 t 774 ));
DATA(insert ( 3580 inet_minmax_ops PGNSP PGUID 4075 869 f 869 ));
DATA(insert ( 3580 inet_inclusion_ops PGNSP PGUID 4102 869 t 869 ));
DATA(insert ( 3580 bpchar_minmax_ops PGNSP PGUID 4076 1042 t 1042 ));
DATA(insert ( 3580 time_minmax_ops PGNSP PGUID 4077 1083 t 1083 ));
DATA(insert ( 3580 date_minmax_ops PGNSP PGUID 4059 1082 t 1082 ));
DATA(insert ( 3580 timestamp_minmax_ops PGNSP PGUID 4059 1114 t 1114 ));
DATA(insert ( 3580 timestamptz_minmax_ops PGNSP PGUID 4059 1184 t 1184 ));
DATA(insert ( 3580 interval_minmax_ops PGNSP PGUID 4078 1186 t 1186 ));
DATA(insert ( 3580 timetz_minmax_ops PGNSP PGUID 4058 1266 t 1266 ));
DATA(insert ( 3580 bit_minmax_ops PGNSP PGUID 4079 1560 t 1560 ));
DATA(insert ( 3580 varbit_minmax_ops PGNSP PGUID 4080 1562 t 1562 ));
DATA(insert ( 3580 numeric_minmax_ops PGNSP PGUID 4055 1700 t 1700 ));
/* no brin opclass for record, anyarray */
DATA(insert ( 3580 uuid_minmax_ops PGNSP PGUID 4081 2950 t 2950 ));
DATA(insert ( 3580 range_inclusion_ops PGNSP PGUID 4103 3831 t 3831 ));
DATA(insert ( 3580 pg_lsn_minmax_ops PGNSP PGUID 4082 3220 t 3220 ));
/* no brin opclass for enum, tsvector, tsquery, jsonb */
DATA(insert ( 3580 box_inclusion_ops PGNSP PGUID 4104 603 t 603 ));
/* no brin opclass for the geometric types except box */
#endif /* PG_OPCLASS_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -0,0 +1,248 @@
#----------------------------------------------------------------------
#
# pg_opfamily.dat
# Initial contents of the pg_opfamily 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_opfamily.dat
#
#----------------------------------------------------------------------
[
{ oid => '421',
opfmethod => 'btree', opfname => 'abstime_ops' },
{ oid => '397',
opfmethod => 'btree', opfname => 'array_ops' },
{ oid => '627',
opfmethod => 'hash', opfname => 'array_ops' },
{ oid => '423',
opfmethod => 'btree', opfname => 'bit_ops' },
{ oid => '424', oid_symbol => 'BOOL_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'bool_ops' },
{ oid => '426', oid_symbol => 'BPCHAR_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'bpchar_ops' },
{ oid => '427',
opfmethod => 'hash', opfname => 'bpchar_ops' },
{ oid => '428', oid_symbol => 'BYTEA_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'bytea_ops' },
{ oid => '429',
opfmethod => 'btree', opfname => 'char_ops' },
{ oid => '431',
opfmethod => 'hash', opfname => 'char_ops' },
{ oid => '434',
opfmethod => 'btree', opfname => 'datetime_ops' },
{ oid => '435',
opfmethod => 'hash', opfname => 'date_ops' },
{ oid => '1970',
opfmethod => 'btree', opfname => 'float_ops' },
{ oid => '1971',
opfmethod => 'hash', opfname => 'float_ops' },
{ oid => '1974', oid_symbol => 'NETWORK_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'network_ops' },
{ oid => '1975',
opfmethod => 'hash', opfname => 'network_ops' },
{ oid => '3550',
opfmethod => 'gist', opfname => 'network_ops' },
{ oid => '3794',
opfmethod => 'spgist', opfname => 'network_ops' },
{ oid => '1976', oid_symbol => 'INTEGER_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'integer_ops' },
{ oid => '1977',
opfmethod => 'hash', opfname => 'integer_ops' },
{ oid => '1982',
opfmethod => 'btree', opfname => 'interval_ops' },
{ oid => '1983',
opfmethod => 'hash', opfname => 'interval_ops' },
{ oid => '1984',
opfmethod => 'btree', opfname => 'macaddr_ops' },
{ oid => '1985',
opfmethod => 'hash', opfname => 'macaddr_ops' },
{ oid => '3371',
opfmethod => 'btree', opfname => 'macaddr8_ops' },
{ oid => '3372',
opfmethod => 'hash', opfname => 'macaddr8_ops' },
{ oid => '1986', oid_symbol => 'NAME_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'name_ops' },
{ oid => '1987',
opfmethod => 'hash', opfname => 'name_ops' },
{ oid => '1988',
opfmethod => 'btree', opfname => 'numeric_ops' },
{ oid => '1998',
opfmethod => 'hash', opfname => 'numeric_ops' },
{ oid => '1989', oid_symbol => 'OID_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'oid_ops' },
{ oid => '1990',
opfmethod => 'hash', opfname => 'oid_ops' },
{ oid => '1991',
opfmethod => 'btree', opfname => 'oidvector_ops' },
{ oid => '1992',
opfmethod => 'hash', opfname => 'oidvector_ops' },
{ oid => '2994',
opfmethod => 'btree', opfname => 'record_ops' },
{ oid => '3194',
opfmethod => 'btree', opfname => 'record_image_ops' },
{ oid => '1994', oid_symbol => 'TEXT_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'text_ops' },
{ oid => '1995',
opfmethod => 'hash', opfname => 'text_ops' },
{ oid => '1996',
opfmethod => 'btree', opfname => 'time_ops' },
{ oid => '1997',
opfmethod => 'hash', opfname => 'time_ops' },
{ oid => '1999',
opfmethod => 'hash', opfname => 'timestamptz_ops' },
{ oid => '2000',
opfmethod => 'btree', opfname => 'timetz_ops' },
{ oid => '2001',
opfmethod => 'hash', opfname => 'timetz_ops' },
{ oid => '2002',
opfmethod => 'btree', opfname => 'varbit_ops' },
{ oid => '2040',
opfmethod => 'hash', opfname => 'timestamp_ops' },
{ oid => '2095', oid_symbol => 'TEXT_PATTERN_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'text_pattern_ops' },
{ oid => '2097', oid_symbol => 'BPCHAR_PATTERN_BTREE_FAM_OID',
opfmethod => 'btree', opfname => 'bpchar_pattern_ops' },
{ oid => '2099',
opfmethod => 'btree', opfname => 'money_ops' },
{ oid => '2222', oid_symbol => 'BOOL_HASH_FAM_OID',
opfmethod => 'hash', opfname => 'bool_ops' },
{ oid => '2223',
opfmethod => 'hash', opfname => 'bytea_ops' },
{ oid => '2789',
opfmethod => 'btree', opfname => 'tid_ops' },
{ oid => '2225',
opfmethod => 'hash', opfname => 'xid_ops' },
{ oid => '2226',
opfmethod => 'hash', opfname => 'cid_ops' },
{ oid => '2227',
opfmethod => 'hash', opfname => 'abstime_ops' },
{ oid => '2228',
opfmethod => 'hash', opfname => 'reltime_ops' },
{ oid => '2229',
opfmethod => 'hash', opfname => 'text_pattern_ops' },
{ oid => '2231',
opfmethod => 'hash', opfname => 'bpchar_pattern_ops' },
{ oid => '2233',
opfmethod => 'btree', opfname => 'reltime_ops' },
{ oid => '2234',
opfmethod => 'btree', opfname => 'tinterval_ops' },
{ oid => '2235',
opfmethod => 'hash', opfname => 'aclitem_ops' },
{ oid => '2593',
opfmethod => 'gist', opfname => 'box_ops' },
{ oid => '2594',
opfmethod => 'gist', opfname => 'poly_ops' },
{ oid => '2595',
opfmethod => 'gist', opfname => 'circle_ops' },
{ oid => '1029',
opfmethod => 'gist', opfname => 'point_ops' },
{ oid => '2745',
opfmethod => 'gin', opfname => 'array_ops' },
{ oid => '2968',
opfmethod => 'btree', opfname => 'uuid_ops' },
{ oid => '2969',
opfmethod => 'hash', opfname => 'uuid_ops' },
{ oid => '3253',
opfmethod => 'btree', opfname => 'pg_lsn_ops' },
{ oid => '3254',
opfmethod => 'hash', opfname => 'pg_lsn_ops' },
{ oid => '3522',
opfmethod => 'btree', opfname => 'enum_ops' },
{ oid => '3523',
opfmethod => 'hash', opfname => 'enum_ops' },
{ oid => '3626',
opfmethod => 'btree', opfname => 'tsvector_ops' },
{ oid => '3655',
opfmethod => 'gist', opfname => 'tsvector_ops' },
{ oid => '3659',
opfmethod => 'gin', opfname => 'tsvector_ops' },
{ oid => '3683',
opfmethod => 'btree', opfname => 'tsquery_ops' },
{ oid => '3702',
opfmethod => 'gist', opfname => 'tsquery_ops' },
{ oid => '3901',
opfmethod => 'btree', opfname => 'range_ops' },
{ oid => '3903',
opfmethod => 'hash', opfname => 'range_ops' },
{ oid => '3919',
opfmethod => 'gist', opfname => 'range_ops' },
{ oid => '3474',
opfmethod => 'spgist', opfname => 'range_ops' },
{ oid => '4015',
opfmethod => 'spgist', opfname => 'quad_point_ops' },
{ oid => '4016',
opfmethod => 'spgist', opfname => 'kd_point_ops' },
{ oid => '4017', oid_symbol => 'TEXT_SPGIST_FAM_OID',
opfmethod => 'spgist', opfname => 'text_ops' },
{ oid => '4033',
opfmethod => 'btree', opfname => 'jsonb_ops' },
{ oid => '4034',
opfmethod => 'hash', opfname => 'jsonb_ops' },
{ oid => '4035',
opfmethod => 'gist', opfname => 'jsonb_ops' },
{ oid => '4036',
opfmethod => 'gin', opfname => 'jsonb_ops' },
{ oid => '4037',
opfmethod => 'gin', opfname => 'jsonb_path_ops' },
{ oid => '4054',
opfmethod => 'brin', opfname => 'integer_minmax_ops' },
{ oid => '4055',
opfmethod => 'brin', opfname => 'numeric_minmax_ops' },
{ oid => '4056',
opfmethod => 'brin', opfname => 'text_minmax_ops' },
{ oid => '4058',
opfmethod => 'brin', opfname => 'timetz_minmax_ops' },
{ oid => '4059',
opfmethod => 'brin', opfname => 'datetime_minmax_ops' },
{ oid => '4062',
opfmethod => 'brin', opfname => 'char_minmax_ops' },
{ oid => '4064',
opfmethod => 'brin', opfname => 'bytea_minmax_ops' },
{ oid => '4065',
opfmethod => 'brin', opfname => 'name_minmax_ops' },
{ oid => '4068',
opfmethod => 'brin', opfname => 'oid_minmax_ops' },
{ oid => '4069',
opfmethod => 'brin', opfname => 'tid_minmax_ops' },
{ oid => '4070',
opfmethod => 'brin', opfname => 'float_minmax_ops' },
{ oid => '4072',
opfmethod => 'brin', opfname => 'abstime_minmax_ops' },
{ oid => '4073',
opfmethod => 'brin', opfname => 'reltime_minmax_ops' },
{ oid => '4074',
opfmethod => 'brin', opfname => 'macaddr_minmax_ops' },
{ oid => '4109',
opfmethod => 'brin', opfname => 'macaddr8_minmax_ops' },
{ oid => '4075',
opfmethod => 'brin', opfname => 'network_minmax_ops' },
{ oid => '4102',
opfmethod => 'brin', opfname => 'network_inclusion_ops' },
{ oid => '4076',
opfmethod => 'brin', opfname => 'bpchar_minmax_ops' },
{ oid => '4077',
opfmethod => 'brin', opfname => 'time_minmax_ops' },
{ oid => '4078',
opfmethod => 'brin', opfname => 'interval_minmax_ops' },
{ oid => '4079',
opfmethod => 'brin', opfname => 'bit_minmax_ops' },
{ oid => '4080',
opfmethod => 'brin', opfname => 'varbit_minmax_ops' },
{ oid => '4081',
opfmethod => 'brin', opfname => 'uuid_minmax_ops' },
{ oid => '4103',
opfmethod => 'brin', opfname => 'range_inclusion_ops' },
{ oid => '4082',
opfmethod => 'brin', opfname => 'pg_lsn_minmax_ops' },
{ oid => '4104',
opfmethod => 'brin', opfname => 'box_inclusion_ops' },
{ oid => '5000',
opfmethod => 'spgist', opfname => 'box_ops' },
{ oid => '5008',
opfmethod => 'spgist', opfname => 'poly_ops' },
]

View File

@ -2,7 +2,6 @@
*
* pg_opfamily.h
* definition of the system "opfamily" relation (pg_opfamily)
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
@ -11,8 +10,8 @@
* src/include/catalog/pg_opfamily.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,20 +19,26 @@
#define PG_OPFAMILY_H
#include "catalog/genbki.h"
#include "catalog/pg_opfamily_d.h"
/* ----------------
* pg_opfamily definition. cpp turns this into
* typedef struct FormData_pg_opfamily
* ----------------
*/
#define OperatorFamilyRelationId 2753
CATALOG(pg_opfamily,2753)
CATALOG(pg_opfamily,2753,OperatorFamilyRelationId)
{
Oid opfmethod; /* index access method opfamily is for */
NameData opfname; /* name of this opfamily */
Oid opfnamespace; /* namespace of this opfamily */
Oid opfowner; /* opfamily owner */
/* index access method opfamily is for */
Oid opfmethod BKI_LOOKUP(pg_am);
/* name of this opfamily */
NameData opfname;
/* namespace of this opfamily */
Oid opfnamespace BKI_DEFAULT(PGNSP);
/* opfamily owner */
Oid opfowner BKI_DEFAULT(PGUID);
} FormData_pg_opfamily;
/* ----------------
@ -43,152 +48,11 @@ CATALOG(pg_opfamily,2753)
*/
typedef FormData_pg_opfamily *Form_pg_opfamily;
/* ----------------
* compiler constants for pg_opfamily
* ----------------
*/
#define Natts_pg_opfamily 4
#define Anum_pg_opfamily_opfmethod 1
#define Anum_pg_opfamily_opfname 2
#define Anum_pg_opfamily_opfnamespace 3
#define Anum_pg_opfamily_opfowner 4
#ifdef EXPOSE_TO_CLIENT_CODE
#define IsBooleanOpfamily(opfamily) \
((opfamily) == BOOL_BTREE_FAM_OID || (opfamily) == BOOL_HASH_FAM_OID)
/* ----------------
* initial contents of pg_opfamily
* ----------------
*/
DATA(insert OID = 421 ( 403 abstime_ops PGNSP PGUID ));
DATA(insert OID = 397 ( 403 array_ops PGNSP PGUID ));
DATA(insert OID = 627 ( 405 array_ops PGNSP PGUID ));
DATA(insert OID = 423 ( 403 bit_ops PGNSP PGUID ));
DATA(insert OID = 424 ( 403 bool_ops PGNSP PGUID ));
#define BOOL_BTREE_FAM_OID 424
DATA(insert OID = 426 ( 403 bpchar_ops PGNSP PGUID ));
#define BPCHAR_BTREE_FAM_OID 426
DATA(insert OID = 427 ( 405 bpchar_ops PGNSP PGUID ));
DATA(insert OID = 428 ( 403 bytea_ops PGNSP PGUID ));
#define BYTEA_BTREE_FAM_OID 428
DATA(insert OID = 429 ( 403 char_ops PGNSP PGUID ));
DATA(insert OID = 431 ( 405 char_ops PGNSP PGUID ));
DATA(insert OID = 434 ( 403 datetime_ops PGNSP PGUID ));
DATA(insert OID = 435 ( 405 date_ops PGNSP PGUID ));
DATA(insert OID = 1970 ( 403 float_ops PGNSP PGUID ));
DATA(insert OID = 1971 ( 405 float_ops PGNSP PGUID ));
DATA(insert OID = 1974 ( 403 network_ops PGNSP PGUID ));
#define NETWORK_BTREE_FAM_OID 1974
DATA(insert OID = 1975 ( 405 network_ops PGNSP PGUID ));
DATA(insert OID = 3550 ( 783 network_ops PGNSP PGUID ));
DATA(insert OID = 3794 ( 4000 network_ops PGNSP PGUID ));
DATA(insert OID = 1976 ( 403 integer_ops PGNSP PGUID ));
#define INTEGER_BTREE_FAM_OID 1976
DATA(insert OID = 1977 ( 405 integer_ops PGNSP PGUID ));
DATA(insert OID = 1982 ( 403 interval_ops PGNSP PGUID ));
DATA(insert OID = 1983 ( 405 interval_ops PGNSP PGUID ));
DATA(insert OID = 1984 ( 403 macaddr_ops PGNSP PGUID ));
DATA(insert OID = 1985 ( 405 macaddr_ops PGNSP PGUID ));
DATA(insert OID = 3371 ( 403 macaddr8_ops PGNSP PGUID ));
DATA(insert OID = 3372 ( 405 macaddr8_ops PGNSP PGUID ));
DATA(insert OID = 1986 ( 403 name_ops PGNSP PGUID ));
#define NAME_BTREE_FAM_OID 1986
DATA(insert OID = 1987 ( 405 name_ops PGNSP PGUID ));
DATA(insert OID = 1988 ( 403 numeric_ops PGNSP PGUID ));
DATA(insert OID = 1998 ( 405 numeric_ops PGNSP PGUID ));
DATA(insert OID = 1989 ( 403 oid_ops PGNSP PGUID ));
#define OID_BTREE_FAM_OID 1989
DATA(insert OID = 1990 ( 405 oid_ops PGNSP PGUID ));
DATA(insert OID = 1991 ( 403 oidvector_ops PGNSP PGUID ));
DATA(insert OID = 1992 ( 405 oidvector_ops PGNSP PGUID ));
DATA(insert OID = 2994 ( 403 record_ops PGNSP PGUID ));
DATA(insert OID = 3194 ( 403 record_image_ops PGNSP PGUID ));
DATA(insert OID = 1994 ( 403 text_ops PGNSP PGUID ));
#define TEXT_BTREE_FAM_OID 1994
DATA(insert OID = 1995 ( 405 text_ops PGNSP PGUID ));
DATA(insert OID = 1996 ( 403 time_ops PGNSP PGUID ));
DATA(insert OID = 1997 ( 405 time_ops PGNSP PGUID ));
DATA(insert OID = 1999 ( 405 timestamptz_ops PGNSP PGUID ));
DATA(insert OID = 2000 ( 403 timetz_ops PGNSP PGUID ));
DATA(insert OID = 2001 ( 405 timetz_ops PGNSP PGUID ));
DATA(insert OID = 2002 ( 403 varbit_ops PGNSP PGUID ));
DATA(insert OID = 2040 ( 405 timestamp_ops PGNSP PGUID ));
DATA(insert OID = 2095 ( 403 text_pattern_ops PGNSP PGUID ));
#define TEXT_PATTERN_BTREE_FAM_OID 2095
DATA(insert OID = 2097 ( 403 bpchar_pattern_ops PGNSP PGUID ));
#define BPCHAR_PATTERN_BTREE_FAM_OID 2097
DATA(insert OID = 2099 ( 403 money_ops PGNSP PGUID ));
DATA(insert OID = 2222 ( 405 bool_ops PGNSP PGUID ));
#define BOOL_HASH_FAM_OID 2222
DATA(insert OID = 2223 ( 405 bytea_ops PGNSP PGUID ));
DATA(insert OID = 2789 ( 403 tid_ops PGNSP PGUID ));
DATA(insert OID = 2225 ( 405 xid_ops PGNSP PGUID ));
DATA(insert OID = 2226 ( 405 cid_ops PGNSP PGUID ));
DATA(insert OID = 2227 ( 405 abstime_ops PGNSP PGUID ));
DATA(insert OID = 2228 ( 405 reltime_ops PGNSP PGUID ));
DATA(insert OID = 2229 ( 405 text_pattern_ops PGNSP PGUID ));
DATA(insert OID = 2231 ( 405 bpchar_pattern_ops PGNSP PGUID ));
DATA(insert OID = 2233 ( 403 reltime_ops PGNSP PGUID ));
DATA(insert OID = 2234 ( 403 tinterval_ops PGNSP PGUID ));
DATA(insert OID = 2235 ( 405 aclitem_ops PGNSP PGUID ));
DATA(insert OID = 2593 ( 783 box_ops PGNSP PGUID ));
DATA(insert OID = 2594 ( 783 poly_ops PGNSP PGUID ));
DATA(insert OID = 2595 ( 783 circle_ops PGNSP PGUID ));
DATA(insert OID = 1029 ( 783 point_ops PGNSP PGUID ));
DATA(insert OID = 2745 ( 2742 array_ops PGNSP PGUID ));
DATA(insert OID = 2968 ( 403 uuid_ops PGNSP PGUID ));
DATA(insert OID = 2969 ( 405 uuid_ops PGNSP PGUID ));
DATA(insert OID = 3253 ( 403 pg_lsn_ops PGNSP PGUID ));
DATA(insert OID = 3254 ( 405 pg_lsn_ops PGNSP PGUID ));
DATA(insert OID = 3522 ( 403 enum_ops PGNSP PGUID ));
DATA(insert OID = 3523 ( 405 enum_ops PGNSP PGUID ));
DATA(insert OID = 3626 ( 403 tsvector_ops PGNSP PGUID ));
DATA(insert OID = 3655 ( 783 tsvector_ops PGNSP PGUID ));
DATA(insert OID = 3659 ( 2742 tsvector_ops PGNSP PGUID ));
DATA(insert OID = 3683 ( 403 tsquery_ops PGNSP PGUID ));
DATA(insert OID = 3702 ( 783 tsquery_ops PGNSP PGUID ));
DATA(insert OID = 3901 ( 403 range_ops PGNSP PGUID ));
DATA(insert OID = 3903 ( 405 range_ops PGNSP PGUID ));
DATA(insert OID = 3919 ( 783 range_ops PGNSP PGUID ));
DATA(insert OID = 3474 ( 4000 range_ops PGNSP PGUID ));
DATA(insert OID = 4015 ( 4000 quad_point_ops PGNSP PGUID ));
DATA(insert OID = 4016 ( 4000 kd_point_ops PGNSP PGUID ));
DATA(insert OID = 4017 ( 4000 text_ops PGNSP PGUID ));
#define TEXT_SPGIST_FAM_OID 4017
DATA(insert OID = 4033 ( 403 jsonb_ops PGNSP PGUID ));
DATA(insert OID = 4034 ( 405 jsonb_ops PGNSP PGUID ));
DATA(insert OID = 4035 ( 783 jsonb_ops PGNSP PGUID ));
DATA(insert OID = 4036 ( 2742 jsonb_ops PGNSP PGUID ));
DATA(insert OID = 4037 ( 2742 jsonb_path_ops PGNSP PGUID ));
DATA(insert OID = 4054 ( 3580 integer_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4055 ( 3580 numeric_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4056 ( 3580 text_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4058 ( 3580 timetz_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4059 ( 3580 datetime_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4062 ( 3580 char_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4064 ( 3580 bytea_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4065 ( 3580 name_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4068 ( 3580 oid_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4069 ( 3580 tid_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4070 ( 3580 float_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4072 ( 3580 abstime_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4073 ( 3580 reltime_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4074 ( 3580 macaddr_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4109 ( 3580 macaddr8_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4075 ( 3580 network_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4102 ( 3580 network_inclusion_ops PGNSP PGUID ));
DATA(insert OID = 4076 ( 3580 bpchar_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4077 ( 3580 time_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4078 ( 3580 interval_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4079 ( 3580 bit_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4080 ( 3580 varbit_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4081 ( 3580 uuid_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4103 ( 3580 range_inclusion_ops PGNSP PGUID ));
DATA(insert OID = 4082 ( 3580 pg_lsn_minmax_ops PGNSP PGUID ));
DATA(insert OID = 4104 ( 3580 box_inclusion_ops PGNSP PGUID ));
DATA(insert OID = 5000 ( 4000 box_ops PGNSP PGUID ));
DATA(insert OID = 5008 ( 4000 poly_ops PGNSP PGUID ));
#endif /* EXPOSE_TO_CLIENT_CODE */
#endif /* PG_OPFAMILY_H */

View File

@ -2,7 +2,6 @@
*
* pg_partitioned_table.h
* definition of the system "partitioned table" relation
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
@ -10,8 +9,8 @@
* src/include/catalog/pg_partitioned_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.
*
*-------------------------------------------------------------------------
*/
@ -19,15 +18,14 @@
#define PG_PARTITIONED_TABLE_H
#include "catalog/genbki.h"
#include "catalog/pg_partitioned_table_d.h"
/* ----------------
* pg_partitioned_table definition. cpp turns this into
* typedef struct FormData_pg_partitioned_table
* ----------------
*/
#define PartitionedRelationId 3350
CATALOG(pg_partitioned_table,3350) BKI_WITHOUT_OIDS
CATALOG(pg_partitioned_table,3350,PartitionedRelationId) BKI_WITHOUT_OIDS
{
Oid partrelid; /* partitioned table oid */
char partstrat; /* partitioning strategy */
@ -60,18 +58,4 @@ CATALOG(pg_partitioned_table,3350) BKI_WITHOUT_OIDS
*/
typedef FormData_pg_partitioned_table *Form_pg_partitioned_table;
/* ----------------
* compiler constants for pg_partitioned_table
* ----------------
*/
#define Natts_pg_partitioned_table 8
#define Anum_pg_partitioned_table_partrelid 1
#define Anum_pg_partitioned_table_partstrat 2
#define Anum_pg_partitioned_table_partnatts 3
#define Anum_pg_partitioned_table_partdefid 4
#define Anum_pg_partitioned_table_partattrs 5
#define Anum_pg_partitioned_table_partclass 6
#define Anum_pg_partitioned_table_partcollation 7
#define Anum_pg_partitioned_table_partexprs 8
#endif /* PG_PARTITIONED_TABLE_H */

View File

@ -0,0 +1,51 @@
#----------------------------------------------------------------------
#
# pg_pltemplate.dat
# Initial contents of the pg_pltemplate 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_pltemplate.dat
#
#----------------------------------------------------------------------
[
{ tmplname => 'plpgsql', tmpltrusted => 't', tmpldbacreate => 't',
tmplhandler => 'plpgsql_call_handler', tmplinline => 'plpgsql_inline_handler',
tmplvalidator => 'plpgsql_validator', tmpllibrary => '$libdir/plpgsql',
tmplacl => '_null_' },
{ tmplname => 'pltcl', tmpltrusted => 't', tmpldbacreate => 't',
tmplhandler => 'pltcl_call_handler', tmplinline => '_null_',
tmplvalidator => '_null_', tmpllibrary => '$libdir/pltcl',
tmplacl => '_null_' },
{ tmplname => 'pltclu', tmpltrusted => 'f', tmpldbacreate => 'f',
tmplhandler => 'pltclu_call_handler', tmplinline => '_null_',
tmplvalidator => '_null_', tmpllibrary => '$libdir/pltcl',
tmplacl => '_null_' },
{ tmplname => 'plperl', tmpltrusted => 't', tmpldbacreate => 't',
tmplhandler => 'plperl_call_handler', tmplinline => 'plperl_inline_handler',
tmplvalidator => 'plperl_validator', tmpllibrary => '$libdir/plperl',
tmplacl => '_null_' },
{ tmplname => 'plperlu', tmpltrusted => 'f', tmpldbacreate => 'f',
tmplhandler => 'plperlu_call_handler', tmplinline => 'plperlu_inline_handler',
tmplvalidator => 'plperlu_validator', tmpllibrary => '$libdir/plperl',
tmplacl => '_null_' },
{ tmplname => 'plpythonu', tmpltrusted => 'f', tmpldbacreate => 'f',
tmplhandler => 'plpython_call_handler',
tmplinline => 'plpython_inline_handler',
tmplvalidator => 'plpython_validator', tmpllibrary => '$libdir/plpython2',
tmplacl => '_null_' },
{ tmplname => 'plpython2u', tmpltrusted => 'f', tmpldbacreate => 'f',
tmplhandler => 'plpython2_call_handler',
tmplinline => 'plpython2_inline_handler',
tmplvalidator => 'plpython2_validator', tmpllibrary => '$libdir/plpython2',
tmplacl => '_null_' },
{ tmplname => 'plpython3u', tmpltrusted => 'f', tmpldbacreate => 'f',
tmplhandler => 'plpython3_call_handler',
tmplinline => 'plpython3_inline_handler',
tmplvalidator => 'plpython3_validator', tmpllibrary => '$libdir/plpython3',
tmplacl => '_null_' },
]

View File

@ -2,7 +2,6 @@
*
* pg_pltemplate.h
* definition of the system "PL template" relation (pg_pltemplate)
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
@ -11,8 +10,8 @@
* src/include/catalog/pg_pltemplate.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_PLTEMPLATE_H
#include "catalog/genbki.h"
#include "catalog/pg_pltemplate_d.h"
/* ----------------
* pg_pltemplate definition. cpp turns this into
* typedef struct FormData_pg_pltemplate
* ----------------
*/
#define PLTemplateRelationId 1136
CATALOG(pg_pltemplate,1136) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
CATALOG(pg_pltemplate,1136,PLTemplateRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{
NameData tmplname; /* name of PL */
bool tmpltrusted; /* PL is trusted? */
@ -51,33 +49,4 @@ CATALOG(pg_pltemplate,1136) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
*/
typedef FormData_pg_pltemplate *Form_pg_pltemplate;
/* ----------------
* compiler constants for pg_pltemplate
* ----------------
*/
#define Natts_pg_pltemplate 8
#define Anum_pg_pltemplate_tmplname 1
#define Anum_pg_pltemplate_tmpltrusted 2
#define Anum_pg_pltemplate_tmpldbacreate 3
#define Anum_pg_pltemplate_tmplhandler 4
#define Anum_pg_pltemplate_tmplinline 5
#define Anum_pg_pltemplate_tmplvalidator 6
#define Anum_pg_pltemplate_tmpllibrary 7
#define Anum_pg_pltemplate_tmplacl 8
/* ----------------
* initial contents of pg_pltemplate
* ----------------
*/
DATA(insert ( plpgsql t t plpgsql_call_handler plpgsql_inline_handler plpgsql_validator "$libdir/plpgsql" _null_ ));
DATA(insert ( pltcl t t pltcl_call_handler _null_ _null_ "$libdir/pltcl" _null_ ));
DATA(insert ( pltclu f f pltclu_call_handler _null_ _null_ "$libdir/pltcl" _null_ ));
DATA(insert ( plperl t t plperl_call_handler plperl_inline_handler plperl_validator "$libdir/plperl" _null_ ));
DATA(insert ( plperlu f f plperlu_call_handler plperlu_inline_handler plperlu_validator "$libdir/plperl" _null_ ));
DATA(insert ( plpythonu f f plpython_call_handler plpython_inline_handler plpython_validator "$libdir/plpython2" _null_ ));
DATA(insert ( plpython2u f f plpython2_call_handler plpython2_inline_handler plpython2_validator "$libdir/plpython2" _null_ ));
DATA(insert ( plpython3u f f plpython3_call_handler plpython3_inline_handler plpython3_validator "$libdir/plpython3" _null_ ));
#endif /* PG_PLTEMPLATE_H */

View File

@ -1,24 +1,32 @@
/*
/*-------------------------------------------------------------------------
*
* pg_policy.h
* definition of the system "policy" relation (pg_policy)
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_policy.h
*
* NOTES
* The Catalog.pm module reads this file and derives schema
* information.
*
*-------------------------------------------------------------------------
*/
#ifndef PG_POLICY_H
#define PG_POLICY_H
#include "catalog/genbki.h"
#include "catalog/pg_policy_d.h"
/* ----------------
* pg_policy definition. cpp turns this into
* typedef struct FormData_pg_policy
* ----------------
*/
#define PolicyRelationId 3256
CATALOG(pg_policy,3256)
CATALOG(pg_policy,3256,PolicyRelationId)
{
NameData polname; /* Policy name. */
Oid polrelid; /* Oid of the relation with policy. */
@ -39,17 +47,4 @@ CATALOG(pg_policy,3256)
*/
typedef FormData_pg_policy *Form_pg_policy;
/* ----------------
* compiler constants for pg_policy
* ----------------
*/
#define Natts_pg_policy 7
#define Anum_pg_policy_polname 1
#define Anum_pg_policy_polrelid 2
#define Anum_pg_policy_polcmd 3
#define Anum_pg_policy_polpermissive 4
#define Anum_pg_policy_polroles 5
#define Anum_pg_policy_polqual 6
#define Anum_pg_policy_polwithcheck 7
#endif /* PG_POLICY_H */

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -9,8 +9,8 @@
* src/include/catalog/pg_publication.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,17 +18,15 @@
#define PG_PUBLICATION_H
#include "catalog/genbki.h"
#include "catalog/pg_publication_d.h"
#include "catalog/objectaddress.h"
/* ----------------
* pg_publication definition. cpp turns this into
* typedef struct FormData_pg_publication
*
* ----------------
*/
#define PublicationRelationId 6104
CATALOG(pg_publication,6104)
CATALOG(pg_publication,6104,PublicationRelationId)
{
NameData pubname; /* name of the publication */
@ -61,20 +59,6 @@ CATALOG(pg_publication,6104)
*/
typedef FormData_pg_publication *Form_pg_publication;
/* ----------------
* compiler constants for pg_publication
* ----------------
*/
#define Natts_pg_publication 7
#define Anum_pg_publication_pubname 1
#define Anum_pg_publication_pubowner 2
#define Anum_pg_publication_puballtables 3
#define Anum_pg_publication_pubinsert 4
#define Anum_pg_publication_pubupdate 5
#define Anum_pg_publication_pubdelete 6
#define Anum_pg_publication_pubtruncate 7
typedef struct PublicationActions
{
bool pubinsert;

View File

@ -9,8 +9,8 @@
* src/include/catalog/pg_publication_rel.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,16 +18,14 @@
#define PG_PUBLICATION_REL_H
#include "catalog/genbki.h"
#include "catalog/pg_publication_rel_d.h"
/* ----------------
* pg_publication_rel definition. cpp turns this into
* typedef struct FormData_pg_publication_rel
*
* ----------------
*/
#define PublicationRelRelationId 6106
CATALOG(pg_publication_rel,6106)
CATALOG(pg_publication_rel,6106,PublicationRelRelationId)
{
Oid prpubid; /* Oid of the publication */
Oid prrelid; /* Oid of the relation */
@ -40,13 +38,4 @@ CATALOG(pg_publication_rel,6106)
*/
typedef FormData_pg_publication_rel *Form_pg_publication_rel;
/* ----------------
* compiler constants for pg_publication_rel
* ----------------
*/
#define Natts_pg_publication_rel 2
#define Anum_pg_publication_rel_prpubid 1
#define Anum_pg_publication_rel_prrelid 2
#endif /* PG_PUBLICATION_REL_H */

View File

@ -0,0 +1,31 @@
#----------------------------------------------------------------------
#
# pg_range.dat
# Initial contents of the pg_range 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_range.dat
#
#----------------------------------------------------------------------
[
{ rngtypid => 'int4range', rngsubtype => 'int4', rngsubopc => 'btree/int4_ops',
rngcanonical => 'int4range_canonical', rngsubdiff => 'int4range_subdiff' },
{ rngtypid => 'numrange', rngsubtype => 'numeric',
rngsubopc => 'btree/numeric_ops', rngcanonical => '-',
rngsubdiff => 'numrange_subdiff' },
{ rngtypid => 'tsrange', rngsubtype => 'timestamp',
rngsubopc => 'btree/timestamp_ops', rngcanonical => '-',
rngsubdiff => 'tsrange_subdiff' },
{ rngtypid => 'tstzrange', rngsubtype => 'timestamptz',
rngsubopc => 'btree/timestamptz_ops', rngcanonical => '-',
rngsubdiff => 'tstzrange_subdiff' },
{ rngtypid => 'daterange', rngsubtype => 'date', rngsubopc => 'btree/date_ops',
rngcanonical => 'daterange_canonical', rngsubdiff => 'daterange_subdiff' },
{ rngtypid => 'int8range', rngsubtype => 'int8', rngsubopc => 'btree/int8_ops',
rngcanonical => 'int8range_canonical', rngsubdiff => 'int8range_subdiff' },
]

View File

@ -2,7 +2,6 @@
*
* pg_range.h
* definition of the system "range" relation (pg_range)
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
@ -11,11 +10,8 @@
* src/include/catalog/pg_range.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,22 +19,32 @@
#define PG_RANGE_H
#include "catalog/genbki.h"
#include "catalog/pg_range_d.h"
/* ----------------
* pg_range definition. cpp turns this into
* typedef struct FormData_pg_range
* ----------------
*/
#define RangeRelationId 3541
CATALOG(pg_range,3541) BKI_WITHOUT_OIDS
CATALOG(pg_range,3541,RangeRelationId) BKI_WITHOUT_OIDS
{
Oid rngtypid; /* OID of owning range type */
Oid rngsubtype; /* OID of range's element type (subtype) */
Oid rngcollation; /* collation for this range type, or 0 */
Oid rngsubopc; /* subtype's btree opclass */
regproc rngcanonical; /* canonicalize range, or 0 */
regproc rngsubdiff; /* subtype difference as a float8, or 0 */
/* OID of owning range type */
Oid rngtypid BKI_LOOKUP(pg_type);
/* OID of range's element type (subtype) */
Oid rngsubtype BKI_LOOKUP(pg_type);
/* collation for this range type, or 0 */
Oid rngcollation BKI_DEFAULT(0);
/* subtype's btree opclass */
Oid rngsubopc BKI_LOOKUP(pg_opclass);
/* canonicalize range, or 0 */
regproc rngcanonical BKI_LOOKUP(pg_proc);
/* subtype difference as a float8, or 0 */
regproc rngsubdiff BKI_LOOKUP(pg_proc);
} FormData_pg_range;
/* ----------------
@ -48,31 +54,6 @@ CATALOG(pg_range,3541) BKI_WITHOUT_OIDS
*/
typedef FormData_pg_range *Form_pg_range;
/* ----------------
* compiler constants for pg_range
* ----------------
*/
#define Natts_pg_range 6
#define Anum_pg_range_rngtypid 1
#define Anum_pg_range_rngsubtype 2
#define Anum_pg_range_rngcollation 3
#define Anum_pg_range_rngsubopc 4
#define Anum_pg_range_rngcanonical 5
#define Anum_pg_range_rngsubdiff 6
/* ----------------
* initial contents of pg_range
* ----------------
*/
DATA(insert ( 3904 23 0 1978 int4range_canonical int4range_subdiff));
DATA(insert ( 3906 1700 0 3125 - numrange_subdiff));
DATA(insert ( 3908 1114 0 3128 - tsrange_subdiff));
DATA(insert ( 3910 1184 0 3127 - tstzrange_subdiff));
DATA(insert ( 3912 1082 0 3122 daterange_canonical daterange_subdiff));
DATA(insert ( 3926 20 0 3124 int8range_canonical int8range_subdiff));
/*
* prototypes for functions in pg_range.c
*/

View File

@ -9,8 +9,8 @@
* src/include/catalog/pg_replication_origin.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,6 +18,7 @@
#define PG_REPLICATION_ORIGIN_H
#include "catalog/genbki.h"
#include "catalog/pg_replication_origin_d.h"
#include "access/xlogdefs.h"
/* ----------------
@ -25,9 +26,7 @@
* typedef struct FormData_pg_replication_origin
* ----------------
*/
#define ReplicationOriginRelationId 6000
CATALOG(pg_replication_origin,6000) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
CATALOG(pg_replication_origin,6000,ReplicationOriginRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{
/*
* Locally known id that get included into WAL.
@ -54,17 +53,4 @@ CATALOG(pg_replication_origin,6000) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
typedef FormData_pg_replication_origin *Form_pg_replication_origin;
/* ----------------
* compiler constants for pg_replication_origin
* ----------------
*/
#define Natts_pg_replication_origin 2
#define Anum_pg_replication_origin_roident 1
#define Anum_pg_replication_origin_roname 2
/* ----------------
* pg_replication_origin has no initial contents
* ----------------
*/
#endif /* PG_REPLICATION_ORIGIN_H */

View File

@ -2,7 +2,6 @@
*
* pg_rewrite.h
* definition of the system "rewrite-rule" relation (pg_rewrite)
* along with the relation's initial contents.
*
* As of Postgres 7.3, the primary key for this table is <ev_class, rulename>
* --- ie, rule names are only unique among the rules of a given table.
@ -14,8 +13,8 @@
* src/include/catalog/pg_rewrite.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.
*
*-------------------------------------------------------------------------
*/
@ -23,15 +22,14 @@
#define PG_REWRITE_H
#include "catalog/genbki.h"
#include "catalog/pg_rewrite_d.h"
/* ----------------
* pg_rewrite definition. cpp turns this into
* typedef struct FormData_pg_rewrite
* ----------------
*/
#define RewriteRelationId 2618
CATALOG(pg_rewrite,2618)
CATALOG(pg_rewrite,2618,RewriteRelationId)
{
NameData rulename;
Oid ev_class;
@ -52,17 +50,4 @@ CATALOG(pg_rewrite,2618)
*/
typedef FormData_pg_rewrite *Form_pg_rewrite;
/* ----------------
* compiler constants for pg_rewrite
* ----------------
*/
#define Natts_pg_rewrite 7
#define Anum_pg_rewrite_rulename 1
#define Anum_pg_rewrite_ev_class 2
#define Anum_pg_rewrite_ev_type 3
#define Anum_pg_rewrite_ev_enabled 4
#define Anum_pg_rewrite_is_instead 5
#define Anum_pg_rewrite_ev_qual 6
#define Anum_pg_rewrite_ev_action 7
#endif /* PG_REWRITE_H */

View File

@ -12,15 +12,14 @@
#define PG_SECLABEL_H
#include "catalog/genbki.h"
#include "catalog/pg_seclabel_d.h"
/* ----------------
* pg_seclabel definition. cpp turns this into
* typedef struct FormData_pg_seclabel
* ----------------
*/
#define SecLabelRelationId 3596
CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS
CATALOG(pg_seclabel,3596,SecLabelRelationId) BKI_WITHOUT_OIDS
{
Oid objoid; /* OID of the object itself */
Oid classoid; /* OID of table containing the object */
@ -32,15 +31,4 @@ CATALOG(pg_seclabel,3596) BKI_WITHOUT_OIDS
#endif
} FormData_pg_seclabel;
/* ----------------
* compiler constants for pg_seclabel
* ----------------
*/
#define Natts_pg_seclabel 5
#define Anum_pg_seclabel_objoid 1
#define Anum_pg_seclabel_classoid 2
#define Anum_pg_seclabel_objsubid 3
#define Anum_pg_seclabel_provider 4
#define Anum_pg_seclabel_label 5
#endif /* PG_SECLABEL_H */

View File

@ -12,10 +12,9 @@
#define PG_SEQUENCE_H
#include "catalog/genbki.h"
#include "catalog/pg_sequence_d.h"
#define SequenceRelationId 2224
CATALOG(pg_sequence,2224) BKI_WITHOUT_OIDS
CATALOG(pg_sequence,2224,SequenceRelationId) BKI_WITHOUT_OIDS
{
Oid seqrelid;
Oid seqtypid;
@ -27,16 +26,11 @@ CATALOG(pg_sequence,2224) BKI_WITHOUT_OIDS
bool seqcycle;
} FormData_pg_sequence;
/* ----------------
* Form_pg_sequence corresponds to a pointer to a tuple with
* the format of pg_sequence relation.
* ----------------
*/
typedef FormData_pg_sequence *Form_pg_sequence;
#define Natts_pg_sequence 8
#define Anum_pg_sequence_seqrelid 1
#define Anum_pg_sequence_seqtypid 2
#define Anum_pg_sequence_seqstart 3
#define Anum_pg_sequence_seqincrement 4
#define Anum_pg_sequence_seqmax 5
#define Anum_pg_sequence_seqmin 6
#define Anum_pg_sequence_seqcache 7
#define Anum_pg_sequence_seqcycle 8
#endif /* PG_SEQUENCE_H */

View File

@ -2,8 +2,15 @@
*
* pg_shdepend.h
* definition of the system "shared dependency" relation (pg_shdepend)
* along with the relation's initial contents.
*
* pg_shdepend has no preloaded contents, so there is no pg_shdepend.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_shdepend;
* for example, there's not much value in creating an explicit dependency
* from a relation to its database. Currently, only dependencies on roles
* are explicitly stored in pg_shdepend.
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
@ -11,8 +18,8 @@
* src/include/catalog/pg_shdepend.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 +27,14 @@
#define PG_SHDEPEND_H
#include "catalog/genbki.h"
#include "catalog/pg_shdepend_d.h"
/* ----------------
* pg_shdepend definition. cpp turns this into
* typedef struct FormData_pg_shdepend
* ----------------
*/
#define SharedDependRelationId 1214
CATALOG(pg_shdepend,1214) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
CATALOG(pg_shdepend,1214,SharedDependRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{
/*
* Identification of the dependent (referencing) object.
@ -63,28 +69,4 @@ CATALOG(pg_shdepend,1214) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
*/
typedef FormData_pg_shdepend *Form_pg_shdepend;
/* ----------------
* compiler constants for pg_shdepend
* ----------------
*/
#define Natts_pg_shdepend 7
#define Anum_pg_shdepend_dbid 1
#define Anum_pg_shdepend_classid 2
#define Anum_pg_shdepend_objid 3
#define Anum_pg_shdepend_objsubid 4
#define Anum_pg_shdepend_refclassid 5
#define Anum_pg_shdepend_refobjid 6
#define Anum_pg_shdepend_deptype 7
/*
* pg_shdepend 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_shdepend;
* for example, there's not much value in creating an explicit dependency
* from a relation to its database. Currently, only dependencies on roles
* are explicitly stored in pg_shdepend.
*/
#endif /* PG_SHDEPEND_H */

View File

@ -4,6 +4,10 @@
* definition of the system "shared description" relation
* (pg_shdescription)
*
* Because the contents of this table are taken from the *.dat files
* of other catalogs, there is no pg_shdescription.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 database is identified by the OID of its pg_database row
@ -18,11 +22,8 @@
* src/include/catalog/pg_shdescription.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.
*
*-------------------------------------------------------------------------
*/
@ -30,15 +31,14 @@
#define PG_SHDESCRIPTION_H
#include "catalog/genbki.h"
#include "catalog/pg_shdescription_d.h"
/* ----------------
* pg_shdescription definition. cpp turns this into
* typedef struct FormData_pg_shdescription
* ----------------
*/
#define SharedDescriptionRelationId 2396
CATALOG(pg_shdescription,2396) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
CATALOG(pg_shdescription,2396,SharedDescriptionRelationId) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
{
Oid objoid; /* OID of object itself */
Oid classoid; /* OID of table containing object */
@ -55,24 +55,4 @@ CATALOG(pg_shdescription,2396) BKI_SHARED_RELATION BKI_WITHOUT_OIDS
*/
typedef FormData_pg_shdescription * Form_pg_shdescription;
/* ----------------
* compiler constants for pg_shdescription
* ----------------
*/
#define Natts_pg_shdescription 3
#define Anum_pg_shdescription_objoid 1
#define Anum_pg_shdescription_classoid 2
#define Anum_pg_shdescription_description 3
/* ----------------
* initial contents of pg_shdescription
* ----------------
*/
/*
* 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_SHDESCRIPTION_H */

View File

@ -1,7 +1,7 @@
/* -------------------------------------------------------------------------
*
* pg_shseclabel.h
* definition of the system "security label" relation (pg_shseclabel)
* definition of the system "shared security label" relation (pg_shseclabel)
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
@ -12,16 +12,14 @@
#define PG_SHSECLABEL_H
#include "catalog/genbki.h"
#include "catalog/pg_shseclabel_d.h"
/* ----------------
* pg_shseclabel definition. cpp turns this into
* typedef struct FormData_pg_shseclabel
* ----------------
*/
#define SharedSecLabelRelationId 3592
#define SharedSecLabelRelation_Rowtype_Id 4066
CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_ROWTYPE_OID(4066) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO
CATALOG(pg_shseclabel,3592,SharedSecLabelRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(4066,SharedSecLabelRelation_Rowtype_Id) BKI_WITHOUT_OIDS BKI_SCHEMA_MACRO
{
Oid objoid; /* OID of the shared object itself */
Oid classoid; /* OID of table containing the shared object */
@ -34,14 +32,4 @@ CATALOG(pg_shseclabel,3592) BKI_SHARED_RELATION BKI_ROWTYPE_OID(4066) BKI_WITHOU
typedef FormData_pg_shseclabel * Form_pg_shseclabel;
/* ----------------
* compiler constants for pg_shseclabel
* ----------------
*/
#define Natts_pg_shseclabel 4
#define Anum_pg_shseclabel_objoid 1
#define Anum_pg_shseclabel_classoid 2
#define Anum_pg_shseclabel_provider 3
#define Anum_pg_shseclabel_label 4
#endif /* PG_SHSECLABEL_H */

View File

@ -2,7 +2,6 @@
*
* pg_statistic.h
* definition of the system "statistic" relation (pg_statistic)
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
@ -11,8 +10,8 @@
* src/include/catalog/pg_statistic.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_STATISTIC_H
#include "catalog/genbki.h"
#include "catalog/pg_statistic_d.h"
/* ----------------
* pg_statistic definition. cpp turns this into
* typedef struct FormData_pg_statistic
* ----------------
*/
#define StatisticRelationId 2619
CATALOG(pg_statistic,2619) BKI_WITHOUT_OIDS
CATALOG(pg_statistic,2619,StatisticRelationId) BKI_WITHOUT_OIDS
{
/* These fields form the unique key for the entry: */
Oid starelid; /* relation containing attribute */
@ -128,37 +126,7 @@ CATALOG(pg_statistic,2619) BKI_WITHOUT_OIDS
*/
typedef FormData_pg_statistic *Form_pg_statistic;
/* ----------------
* compiler constants for pg_statistic
* ----------------
*/
#define Natts_pg_statistic 26
#define Anum_pg_statistic_starelid 1
#define Anum_pg_statistic_staattnum 2
#define Anum_pg_statistic_stainherit 3
#define Anum_pg_statistic_stanullfrac 4
#define Anum_pg_statistic_stawidth 5
#define Anum_pg_statistic_stadistinct 6
#define Anum_pg_statistic_stakind1 7
#define Anum_pg_statistic_stakind2 8
#define Anum_pg_statistic_stakind3 9
#define Anum_pg_statistic_stakind4 10
#define Anum_pg_statistic_stakind5 11
#define Anum_pg_statistic_staop1 12
#define Anum_pg_statistic_staop2 13
#define Anum_pg_statistic_staop3 14
#define Anum_pg_statistic_staop4 15
#define Anum_pg_statistic_staop5 16
#define Anum_pg_statistic_stanumbers1 17
#define Anum_pg_statistic_stanumbers2 18
#define Anum_pg_statistic_stanumbers3 19
#define Anum_pg_statistic_stanumbers4 20
#define Anum_pg_statistic_stanumbers5 21
#define Anum_pg_statistic_stavalues1 22
#define Anum_pg_statistic_stavalues2 23
#define Anum_pg_statistic_stavalues3 24
#define Anum_pg_statistic_stavalues4 25
#define Anum_pg_statistic_stavalues5 26
#ifdef EXPOSE_TO_CLIENT_CODE
/*
* Several statistical slot "kinds" are defined by core PostgreSQL, as
@ -289,4 +257,6 @@ typedef FormData_pg_statistic *Form_pg_statistic;
*/
#define STATISTIC_KIND_BOUNDS_HISTOGRAM 7
#endif /* EXPOSE_TO_CLIENT_CODE */
#endif /* PG_STATISTIC_H */

View File

@ -2,7 +2,6 @@
*
* pg_statistic_ext.h
* definition of the system "extended statistic" relation (pg_statistic_ext)
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
@ -11,8 +10,8 @@
* src/include/catalog/pg_statistic_ext.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_STATISTIC_EXT_H
#include "catalog/genbki.h"
#include "catalog/pg_statistic_ext_d.h"
/* ----------------
* pg_statistic_ext definition. cpp turns this into
* typedef struct FormData_pg_statistic_ext
* ----------------
*/
#define StatisticExtRelationId 3381
CATALOG(pg_statistic_ext,3381)
CATALOG(pg_statistic_ext,3381,StatisticExtRelationId)
{
Oid stxrelid; /* relation containing attributes */
@ -60,21 +58,11 @@ CATALOG(pg_statistic_ext,3381)
*/
typedef FormData_pg_statistic_ext *Form_pg_statistic_ext;
/* ----------------
* compiler constants for pg_statistic_ext
* ----------------
*/
#define Natts_pg_statistic_ext 8
#define Anum_pg_statistic_ext_stxrelid 1
#define Anum_pg_statistic_ext_stxname 2
#define Anum_pg_statistic_ext_stxnamespace 3
#define Anum_pg_statistic_ext_stxowner 4
#define Anum_pg_statistic_ext_stxkeys 5
#define Anum_pg_statistic_ext_stxkind 6
#define Anum_pg_statistic_ext_stxndistinct 7
#define Anum_pg_statistic_ext_stxdependencies 8
#ifdef EXPOSE_TO_CLIENT_CODE
#define STATS_EXT_NDISTINCT 'd'
#define STATS_EXT_DEPENDENCIES 'f'
#endif /* EXPOSE_TO_CLIENT_CODE */
#endif /* PG_STATISTIC_EXT_H */

View File

@ -12,6 +12,7 @@
#define PG_SUBSCRIPTION_H
#include "catalog/genbki.h"
#include "catalog/pg_subscription_d.h"
#include "nodes/pg_list.h"
/* ----------------
@ -19,8 +20,6 @@
* typedef struct FormData_pg_subscription
* ----------------
*/
#define SubscriptionRelationId 6100
#define SubscriptionRelation_Rowtype_Id 6101
/*
* Technically, the subscriptions live inside the database, so a shared catalog
@ -30,7 +29,7 @@
*
* NOTE: When adding a column, also update system_views.sql.
*/
CATALOG(pg_subscription,6100) BKI_SHARED_RELATION BKI_ROWTYPE_OID(6101) BKI_SCHEMA_MACRO
CATALOG(pg_subscription,6100,SubscriptionRelationId) BKI_SHARED_RELATION BKI_ROWTYPE_OID(6101,SubscriptionRelation_Rowtype_Id) BKI_SCHEMA_MACRO
{
Oid subdbid; /* Database the subscription is in. */
NameData subname; /* Name of the subscription */
@ -57,21 +56,6 @@ CATALOG(pg_subscription,6100) BKI_SHARED_RELATION BKI_ROWTYPE_OID(6101) BKI_SCHE
typedef FormData_pg_subscription *Form_pg_subscription;
/* ----------------
* compiler constants for pg_subscription
* ----------------
*/
#define Natts_pg_subscription 8
#define Anum_pg_subscription_subdbid 1
#define Anum_pg_subscription_subname 2
#define Anum_pg_subscription_subowner 3
#define Anum_pg_subscription_subenabled 4
#define Anum_pg_subscription_subconninfo 5
#define Anum_pg_subscription_subslotname 6
#define Anum_pg_subscription_subsynccommit 7
#define Anum_pg_subscription_subpublications 8
typedef struct Subscription
{
Oid oid; /* Oid of the subscription */

View File

@ -12,8 +12,9 @@
#ifndef PG_SUBSCRIPTION_REL_H
#define PG_SUBSCRIPTION_REL_H
#include "access/xlogdefs.h"
#include "catalog/genbki.h"
#include "catalog/pg_subscription_rel_d.h"
#include "access/xlogdefs.h"
#include "nodes/pg_list.h"
/* ----------------
@ -21,9 +22,7 @@
* typedef struct FormData_pg_subscription_rel
* ----------------
*/
#define SubscriptionRelRelationId 6102
CATALOG(pg_subscription_rel,6102) BKI_WITHOUT_OIDS
CATALOG(pg_subscription_rel,6102,SubscriptionRelRelationId) BKI_WITHOUT_OIDS
{
Oid srsubid; /* Oid of subscription */
Oid srrelid; /* Oid of relation */
@ -34,15 +33,7 @@ CATALOG(pg_subscription_rel,6102) BKI_WITHOUT_OIDS
typedef FormData_pg_subscription_rel *Form_pg_subscription_rel;
/* ----------------
* compiler constants for pg_subscription_rel
* ----------------
*/
#define Natts_pg_subscription_rel 4
#define Anum_pg_subscription_rel_srsubid 1
#define Anum_pg_subscription_rel_srrelid 2
#define Anum_pg_subscription_rel_srsubstate 3
#define Anum_pg_subscription_rel_srsublsn 4
#ifdef EXPOSE_TO_CLIENT_CODE
/* ----------------
* substate constants
@ -60,6 +51,8 @@ typedef FormData_pg_subscription_rel *Form_pg_subscription_rel;
#define SUBREL_STATE_SYNCWAIT 'w' /* waiting for sync */
#define SUBREL_STATE_CATCHUP 'c' /* catching up with apply */
#endif /* EXPOSE_TO_CLIENT_CODE */
typedef struct SubscriptionRelState
{
Oid relid;

View File

@ -0,0 +1,22 @@
#----------------------------------------------------------------------
#
# pg_tablespace.dat
# Initial contents of the pg_tablespace 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_tablespace.dat
#
#----------------------------------------------------------------------
[
{ oid => '1663', oid_symbol => 'DEFAULTTABLESPACE_OID',
spcname => 'pg_default', spcowner => 'PGUID', spcacl => '_null_',
spcoptions => '_null_' },
{ oid => '1664', oid_symbol => 'GLOBALTABLESPACE_OID',
spcname => 'pg_global', spcowner => 'PGUID', spcacl => '_null_',
spcoptions => '_null_' },
]

View File

@ -2,7 +2,6 @@
*
* pg_tablespace.h
* definition of the system "tablespace" relation (pg_tablespace)
* along with the relation's initial contents.
*
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
@ -11,8 +10,8 @@
* src/include/catalog/pg_tablespace.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_TABLESPACE_H
#include "catalog/genbki.h"
#include "catalog/pg_tablespace_d.h"
/* ----------------
* pg_tablespace definition. cpp turns this into
* typedef struct FormData_pg_tablespace
* ----------------
*/
#define TableSpaceRelationId 1213
CATALOG(pg_tablespace,1213) BKI_SHARED_RELATION
CATALOG(pg_tablespace,1213,TableSpaceRelationId) BKI_SHARED_RELATION
{
NameData spcname; /* tablespace name */
Oid spcowner; /* owner of tablespace */
@ -46,20 +44,4 @@ CATALOG(pg_tablespace,1213) BKI_SHARED_RELATION
*/
typedef FormData_pg_tablespace *Form_pg_tablespace;
/* ----------------
* compiler constants for pg_tablespace
* ----------------
*/
#define Natts_pg_tablespace 4
#define Anum_pg_tablespace_spcname 1
#define Anum_pg_tablespace_spcowner 2
#define Anum_pg_tablespace_spcacl 3
#define Anum_pg_tablespace_spcoptions 4
DATA(insert OID = 1663 ( pg_default PGUID _null_ _null_ ));
#define DEFAULTTABLESPACE_OID 1663
DATA(insert OID = 1664 ( pg_global PGUID _null_ _null_ ));
#define GLOBALTABLESPACE_OID 1664
#endif /* PG_TABLESPACE_H */

View File

@ -1,14 +1,17 @@
/*-------------------------------------------------------------------------
*
* pg_transform.h
* definition of the system "transform" relation (pg_transform)
*
* Copyright (c) 2012-2018, PostgreSQL Global Development Group
*
* Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
* Portions Copyright (c) 1994, Regents of the University of California
*
* src/include/catalog/pg_transform.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.
*
*-------------------------------------------------------------------------
*/
@ -16,15 +19,14 @@
#define PG_TRANSFORM_H
#include "catalog/genbki.h"
#include "catalog/pg_transform_d.h"
/* ----------------
* pg_transform definition. cpp turns this into
* typedef struct FormData_pg_transform
* ----------------
*/
#define TransformRelationId 3576
CATALOG(pg_transform,3576)
CATALOG(pg_transform,3576,TransformRelationId)
{
Oid trftype;
Oid trflang;
@ -32,16 +34,11 @@ CATALOG(pg_transform,3576)
regproc trftosql;
} FormData_pg_transform;
typedef FormData_pg_transform *Form_pg_transform;
/* ----------------
* compiler constants for pg_transform
* Form_pg_transform corresponds to a pointer to a tuple with
* the format of pg_transform relation.
* ----------------
*/
#define Natts_pg_transform 4
#define Anum_pg_transform_trftype 1
#define Anum_pg_transform_trflang 2
#define Anum_pg_transform_trffromsql 3
#define Anum_pg_transform_trftosql 4
typedef FormData_pg_transform *Form_pg_transform;
#endif /* PG_TRANSFORM_H */

View File

@ -2,7 +2,6 @@
*
* pg_trigger.h
* definition of the system "trigger" relation (pg_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_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,6 +19,7 @@
#define PG_TRIGGER_H
#include "catalog/genbki.h"
#include "catalog/pg_trigger_d.h"
/* ----------------
* pg_trigger definition. cpp turns this into
@ -31,9 +31,7 @@
* to be associated with a deferrable constraint.
* ----------------
*/
#define TriggerRelationId 2620
CATALOG(pg_trigger,2620)
CATALOG(pg_trigger,2620,TriggerRelationId)
{
Oid tgrelid; /* relation trigger is attached to */
NameData tgname; /* trigger's name */
@ -71,28 +69,7 @@ CATALOG(pg_trigger,2620)
*/
typedef FormData_pg_trigger *Form_pg_trigger;
/* ----------------
* compiler constants for pg_trigger
* ----------------
*/
#define Natts_pg_trigger 17
#define Anum_pg_trigger_tgrelid 1
#define Anum_pg_trigger_tgname 2
#define Anum_pg_trigger_tgfoid 3
#define Anum_pg_trigger_tgtype 4
#define Anum_pg_trigger_tgenabled 5
#define Anum_pg_trigger_tgisinternal 6
#define Anum_pg_trigger_tgconstrrelid 7
#define Anum_pg_trigger_tgconstrindid 8
#define Anum_pg_trigger_tgconstraint 9
#define Anum_pg_trigger_tgdeferrable 10
#define Anum_pg_trigger_tginitdeferred 11
#define Anum_pg_trigger_tgnargs 12
#define Anum_pg_trigger_tgattr 13
#define Anum_pg_trigger_tgargs 14
#define Anum_pg_trigger_tgqual 15
#define Anum_pg_trigger_tgoldtable 16
#define Anum_pg_trigger_tgnewtable 17
#ifdef EXPOSE_TO_CLIENT_CODE
/* Bits within tgtype */
#define TRIGGER_TYPE_ROW (1 << 0)
@ -153,4 +130,6 @@ typedef FormData_pg_trigger *Form_pg_trigger;
#define TRIGGER_USES_TRANSITION_TABLE(namepointer) \
((namepointer) != (char *) NULL)
#endif /* EXPOSE_TO_CLIENT_CODE */
#endif /* PG_TRIGGER_H */

View File

@ -0,0 +1,19 @@
#----------------------------------------------------------------------
#
# pg_ts_config.dat
# Initial contents of the pg_ts_config 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_ts_config.dat
#
#----------------------------------------------------------------------
[
{ oid => '3748', descr => 'simple configuration',
cfgname => 'simple', cfgnamespace => 'PGNSP', cfgowner => 'PGUID',
cfgparser => '3722' },
]

View File

@ -10,11 +10,8 @@
* src/include/catalog/pg_ts_config.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,15 +19,14 @@
#define PG_TS_CONFIG_H
#include "catalog/genbki.h"
#include "catalog/pg_ts_config_d.h"
/* ----------------
* pg_ts_config definition. cpp turns this into
* typedef struct FormData_pg_ts_config
* ----------------
*/
#define TSConfigRelationId 3602
CATALOG(pg_ts_config,3602)
CATALOG(pg_ts_config,3602,TSConfigRelationId)
{
NameData cfgname; /* name of configuration */
Oid cfgnamespace; /* name space */
@ -40,21 +36,4 @@ CATALOG(pg_ts_config,3602)
typedef FormData_pg_ts_config *Form_pg_ts_config;
/* ----------------
* compiler constants for pg_ts_config
* ----------------
*/
#define Natts_pg_ts_config 4
#define Anum_pg_ts_config_cfgname 1
#define Anum_pg_ts_config_cfgnamespace 2
#define Anum_pg_ts_config_cfgowner 3
#define Anum_pg_ts_config_cfgparser 4
/* ----------------
* initial contents of pg_ts_config
* ----------------
*/
DATA(insert OID = 3748 ( simple PGNSP PGUID 3722 ));
DESCR("simple configuration");
#endif /* PG_TS_CONFIG_H */

View File

@ -0,0 +1,35 @@
#----------------------------------------------------------------------
#
# pg_ts_config_map.dat
# Initial contents of the pg_ts_config_map 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_ts_config_map.dat
#
#----------------------------------------------------------------------
[
{ mapcfg => '3748', maptokentype => '1', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '2', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '3', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '4', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '5', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '6', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '7', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '8', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '9', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '10', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '11', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '15', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '16', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '17', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '18', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '19', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '20', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '21', mapseqno => '1', mapdict => '3765' },
{ mapcfg => '3748', maptokentype => '22', mapseqno => '1', mapdict => '3765' },
]

View File

@ -10,11 +10,8 @@
* src/include/catalog/pg_ts_config_map.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,15 +19,14 @@
#define PG_TS_CONFIG_MAP_H
#include "catalog/genbki.h"
#include "catalog/pg_ts_config_map_d.h"
/* ----------------
* pg_ts_config_map definition. cpp turns this into
* typedef struct FormData_pg_ts_config_map
* ----------------
*/
#define TSConfigMapRelationId 3603
CATALOG(pg_ts_config_map,3603) BKI_WITHOUT_OIDS
CATALOG(pg_ts_config_map,3603,TSConfigMapRelationId) BKI_WITHOUT_OIDS
{
Oid mapcfg; /* OID of configuration owning this entry */
int32 maptokentype; /* token type from parser */
@ -40,39 +36,4 @@ CATALOG(pg_ts_config_map,3603) BKI_WITHOUT_OIDS
typedef FormData_pg_ts_config_map *Form_pg_ts_config_map;
/* ----------------
* compiler constants for pg_ts_config_map
* ----------------
*/
#define Natts_pg_ts_config_map 4
#define Anum_pg_ts_config_map_mapcfg 1
#define Anum_pg_ts_config_map_maptokentype 2
#define Anum_pg_ts_config_map_mapseqno 3
#define Anum_pg_ts_config_map_mapdict 4
/* ----------------
* initial contents of pg_ts_config_map
* ----------------
*/
DATA(insert ( 3748 1 1 3765 ));
DATA(insert ( 3748 2 1 3765 ));
DATA(insert ( 3748 3 1 3765 ));
DATA(insert ( 3748 4 1 3765 ));
DATA(insert ( 3748 5 1 3765 ));
DATA(insert ( 3748 6 1 3765 ));
DATA(insert ( 3748 7 1 3765 ));
DATA(insert ( 3748 8 1 3765 ));
DATA(insert ( 3748 9 1 3765 ));
DATA(insert ( 3748 10 1 3765 ));
DATA(insert ( 3748 11 1 3765 ));
DATA(insert ( 3748 15 1 3765 ));
DATA(insert ( 3748 16 1 3765 ));
DATA(insert ( 3748 17 1 3765 ));
DATA(insert ( 3748 18 1 3765 ));
DATA(insert ( 3748 19 1 3765 ));
DATA(insert ( 3748 20 1 3765 ));
DATA(insert ( 3748 21 1 3765 ));
DATA(insert ( 3748 22 1 3765 ));
#endif /* PG_TS_CONFIG_MAP_H */

View File

@ -0,0 +1,20 @@
#----------------------------------------------------------------------
#
# pg_ts_dict.dat
# Initial contents of the pg_ts_dict 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_ts_dict.dat
#
#----------------------------------------------------------------------
[
{ oid => '3765',
descr => 'simple dictionary: just lower case and check for stopword',
dictname => 'simple', dictnamespace => 'PGNSP', dictowner => 'PGUID',
dicttemplate => '3727', dictinitoption => '_null_' },
]

View File

@ -10,11 +10,8 @@
* src/include/catalog/pg_ts_dict.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,15 +19,14 @@
#define PG_TS_DICT_H
#include "catalog/genbki.h"
#include "catalog/pg_ts_dict_d.h"
/* ----------------
* pg_ts_dict definition. cpp turns this into
* typedef struct FormData_pg_ts_dict
* ----------------
*/
#define TSDictionaryRelationId 3600
CATALOG(pg_ts_dict,3600)
CATALOG(pg_ts_dict,3600,TSDictionaryRelationId)
{
NameData dictname; /* dictionary name */
Oid dictnamespace; /* name space */
@ -44,23 +40,4 @@ CATALOG(pg_ts_dict,3600)
typedef FormData_pg_ts_dict *Form_pg_ts_dict;
/* ----------------
* compiler constants for pg_ts_dict
* ----------------
*/
#define Natts_pg_ts_dict 5
#define Anum_pg_ts_dict_dictname 1
#define Anum_pg_ts_dict_dictnamespace 2
#define Anum_pg_ts_dict_dictowner 3
#define Anum_pg_ts_dict_dicttemplate 4
#define Anum_pg_ts_dict_dictinitoption 5
/* ----------------
* initial contents of pg_ts_dict
* ----------------
*/
DATA(insert OID = 3765 ( simple PGNSP PGUID 3727 _null_));
DESCR("simple dictionary: just lower case and check for stopword");
#endif /* PG_TS_DICT_H */

View File

@ -0,0 +1,20 @@
#----------------------------------------------------------------------
#
# pg_ts_parser.dat
# Initial contents of the pg_ts_parser 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_ts_parser.dat
#
#----------------------------------------------------------------------
[
{ oid => '3722', descr => 'default word parser',
prsname => 'default', prsstart => 'prsd_start', prstoken => 'prsd_nexttoken',
prsend => 'prsd_end', prsheadline => 'prsd_headline',
prslextype => 'prsd_lextype' },
]

View File

@ -10,11 +10,8 @@
* src/include/catalog/pg_ts_parser.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,46 +19,37 @@
#define PG_TS_PARSER_H
#include "catalog/genbki.h"
#include "catalog/pg_ts_parser_d.h"
/* ----------------
* pg_ts_parser definition. cpp turns this into
* typedef struct FormData_pg_ts_parser
* ----------------
*/
#define TSParserRelationId 3601
CATALOG(pg_ts_parser,3601)
CATALOG(pg_ts_parser,3601,TSParserRelationId)
{
NameData prsname; /* parser's name */
Oid prsnamespace; /* name space */
regproc prsstart; /* init parsing session */
regproc prstoken; /* return next token */
regproc prsend; /* finalize parsing session */
regproc prsheadline; /* return data for headline creation */
regproc prslextype; /* return descriptions of lexeme's types */
/* parser's name */
NameData prsname;
/* name space */
Oid prsnamespace BKI_DEFAULT(PGNSP);
/* init parsing session */
regproc prsstart BKI_LOOKUP(pg_proc);
/* return next token */
regproc prstoken BKI_LOOKUP(pg_proc);
/* finalize parsing session */
regproc prsend BKI_LOOKUP(pg_proc);
/* return data for headline creation */
regproc prsheadline BKI_LOOKUP(pg_proc);
/* return descriptions of lexeme's types */
regproc prslextype BKI_LOOKUP(pg_proc);
} FormData_pg_ts_parser;
typedef FormData_pg_ts_parser *Form_pg_ts_parser;
/* ----------------
* compiler constants for pg_ts_parser
* ----------------
*/
#define Natts_pg_ts_parser 7
#define Anum_pg_ts_parser_prsname 1
#define Anum_pg_ts_parser_prsnamespace 2
#define Anum_pg_ts_parser_prsstart 3
#define Anum_pg_ts_parser_prstoken 4
#define Anum_pg_ts_parser_prsend 5
#define Anum_pg_ts_parser_prsheadline 6
#define Anum_pg_ts_parser_prslextype 7
/* ----------------
* initial contents of pg_ts_parser
* ----------------
*/
DATA(insert OID = 3722 ( default PGNSP prsd_start prsd_nexttoken prsd_end prsd_headline prsd_lextype ));
DESCR("default word parser");
#endif /* PG_TS_PARSER_H */

View File

@ -0,0 +1,30 @@
#----------------------------------------------------------------------
#
# pg_ts_template.dat
# Initial contents of the pg_ts_template 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_ts_template.dat
#
#----------------------------------------------------------------------
[
{ oid => '3727',
descr => 'simple dictionary: just lower case and check for stopword',
tmplname => 'simple', tmplinit => 'dsimple_init',
tmpllexize => 'dsimple_lexize' },
{ oid => '3730', descr => 'synonym dictionary: replace word by its synonym',
tmplname => 'synonym', tmplinit => 'dsynonym_init',
tmpllexize => 'dsynonym_lexize' },
{ oid => '3733', descr => 'ispell dictionary',
tmplname => 'ispell', tmplinit => 'dispell_init',
tmpllexize => 'dispell_lexize' },
{ oid => '3742',
descr => 'thesaurus dictionary: phrase by phrase substitution',
tmplname => 'thesaurus', tmplinit => 'thesaurus_init',
tmpllexize => 'thesaurus_lexize' },
]

View File

@ -10,11 +10,8 @@
* src/include/catalog/pg_ts_template.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,46 +19,28 @@
#define PG_TS_TEMPLATE_H
#include "catalog/genbki.h"
#include "catalog/pg_ts_template_d.h"
/* ----------------
* pg_ts_template definition. cpp turns this into
* typedef struct FormData_pg_ts_template
* ----------------
*/
#define TSTemplateRelationId 3764
CATALOG(pg_ts_template,3764)
CATALOG(pg_ts_template,3764,TSTemplateRelationId)
{
NameData tmplname; /* template name */
Oid tmplnamespace; /* name space */
regproc tmplinit; /* initialization method of dict (may be 0) */
regproc tmpllexize; /* base method of dictionary */
/* template name */
NameData tmplname;
/* name space */
Oid tmplnamespace BKI_DEFAULT(PGNSP);
/* initialization method of dict (may be 0) */
regproc tmplinit BKI_LOOKUP(pg_proc);
/* base method of dictionary */
regproc tmpllexize BKI_LOOKUP(pg_proc);
} FormData_pg_ts_template;
typedef FormData_pg_ts_template *Form_pg_ts_template;
/* ----------------
* compiler constants for pg_ts_template
* ----------------
*/
#define Natts_pg_ts_template 4
#define Anum_pg_ts_template_tmplname 1
#define Anum_pg_ts_template_tmplnamespace 2
#define Anum_pg_ts_template_tmplinit 3
#define Anum_pg_ts_template_tmpllexize 4
/* ----------------
* initial contents of pg_ts_template
* ----------------
*/
DATA(insert OID = 3727 ( simple PGNSP dsimple_init dsimple_lexize ));
DESCR("simple dictionary: just lower case and check for stopword");
DATA(insert OID = 3730 ( synonym PGNSP dsynonym_init dsynonym_lexize ));
DESCR("synonym dictionary: replace word by its synonym");
DATA(insert OID = 3733 ( ispell PGNSP dispell_init dispell_lexize ));
DESCR("ispell dictionary");
DATA(insert OID = 3742 ( thesaurus PGNSP thesaurus_init thesaurus_lexize ));
DESCR("thesaurus dictionary: phrase by phrase substitution");
#endif /* PG_TS_TEMPLATE_H */

Some files were not shown because too many files have changed in this diff Show More