Skip to content

Commit

Permalink
Update codegen sources to 13.1
Browse files Browse the repository at this point in the history
  • Loading branch information
sfackler committed Dec 26, 2020
1 parent 6e9ee0f commit 316c6dc
Show file tree
Hide file tree
Showing 5 changed files with 410 additions and 297 deletions.
3 changes: 2 additions & 1 deletion codegen/src/errcodes.txt
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
# errcodes.txt
# PostgreSQL error codes
#
# Copyright (c) 2003-2019, PostgreSQL Global Development Group
# Copyright (c) 2003-2020, PostgreSQL Global Development Group
#
# This list serves as the basis for generating source files containing error
# codes. It is kept in a common format to make sure all these source files have
Expand Down Expand Up @@ -207,6 +207,7 @@ Section: Class 22 - Data Exception
2200S E ERRCODE_INVALID_XML_COMMENT invalid_xml_comment
2200T E ERRCODE_INVALID_XML_PROCESSING_INSTRUCTION invalid_xml_processing_instruction
22030 E ERRCODE_DUPLICATE_JSON_OBJECT_KEY_VALUE duplicate_json_object_key_value
22031 E ERRCODE_INVALID_ARGUMENT_FOR_SQL_JSON_DATETIME_FUNCTION invalid_argument_for_sql_json_datetime_function
22032 E ERRCODE_INVALID_JSON_TEXT invalid_json_text
22033 E ERRCODE_INVALID_SQL_JSON_SUBSCRIPT invalid_sql_json_subscript
22034 E ERRCODE_MORE_THAN_ONE_SQL_JSON_ITEM more_than_one_sql_json_item
Expand Down
2 changes: 1 addition & 1 deletion codegen/src/pg_range.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# pg_range.dat
# Initial contents of the pg_range system catalog.
#
# Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
# Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# src/include/catalog/pg_range.dat
Expand Down
53 changes: 44 additions & 9 deletions codegen/src/pg_type.dat
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
# pg_type.dat
# Initial contents of the pg_type system catalog.
#
# Portions Copyright (c) 1996-2019, PostgreSQL Global Development Group
# Portions Copyright (c) 1996-2020, PostgreSQL Global Development Group
# Portions Copyright (c) 1994, Regents of the University of California
#
# src/include/catalog/pg_type.dat
Expand Down Expand Up @@ -177,6 +177,10 @@
typtype => 'p', typcategory => 'P', typinput => 'pg_ddl_command_in',
typoutput => 'pg_ddl_command_out', typreceive => 'pg_ddl_command_recv',
typsend => 'pg_ddl_command_send', typalign => 'ALIGNOF_POINTER' },
{ oid => '5069', array_type_oid => '271', descr => 'full transaction id',
typname => 'xid8', typlen => '8', typbyval => 'FLOAT8PASSBYVAL',
typcategory => 'U', typinput => 'xid8in', typoutput => 'xid8out',
typreceive => 'xid8recv', typsend => 'xid8send', typalign => 'd' },

# OIDS 600 - 699

Expand Down Expand Up @@ -215,9 +219,9 @@

{ oid => '700', array_type_oid => '1021',
descr => 'single-precision floating point number, 4-byte storage',
typname => 'float4', typlen => '4', typbyval => 'FLOAT4PASSBYVAL',
typcategory => 'N', typinput => 'float4in', typoutput => 'float4out',
typreceive => 'float4recv', typsend => 'float4send', typalign => 'i' },
typname => 'float4', typlen => '4', typbyval => 't', typcategory => 'N',
typinput => 'float4in', typoutput => 'float4out', typreceive => 'float4recv',
typsend => 'float4send', typalign => 'i' },
{ oid => '701', array_type_oid => '1022',
descr => 'double-precision floating point number, 8-byte storage',
typname => 'float8', typlen => '8', typbyval => 'FLOAT8PASSBYVAL',
Expand Down Expand Up @@ -379,6 +383,11 @@
typname => 'regclass', typlen => '4', typbyval => 't', typcategory => 'N',
typinput => 'regclassin', typoutput => 'regclassout',
typreceive => 'regclassrecv', typsend => 'regclasssend', typalign => 'i' },
{ oid => '4191', array_type_oid => '4192', descr => 'registered collation',
typname => 'regcollation', typlen => '4', typbyval => 't', typcategory => 'N',
typinput => 'regcollationin', typoutput => 'regcollationout',
typreceive => 'regcollationrecv', typsend => 'regcollationsend',
typalign => 'i' },
{ oid => '2206', array_type_oid => '2211', descr => 'registered type',
typname => 'regtype', typlen => '4', typbyval => 't', typcategory => 'N',
typinput => 'regtypein', typoutput => 'regtypeout',
Expand Down Expand Up @@ -451,6 +460,11 @@
typcategory => 'U', typinput => 'txid_snapshot_in',
typoutput => 'txid_snapshot_out', typreceive => 'txid_snapshot_recv',
typsend => 'txid_snapshot_send', typalign => 'd', typstorage => 'x' },
{ oid => '5038', array_type_oid => '5039', descr => 'snapshot',
typname => 'pg_snapshot', typlen => '-1', typbyval => 'f', typcategory => 'U',
typinput => 'pg_snapshot_in', typoutput => 'pg_snapshot_out',
typreceive => 'pg_snapshot_recv', typsend => 'pg_snapshot_send',
typalign => 'd', typstorage => 'x' },

# range types
{ oid => '3904', array_type_oid => '3905', descr => 'range of integers',
Expand Down Expand Up @@ -546,10 +560,6 @@
typtype => 'p', typcategory => 'P', typinput => 'internal_in',
typoutput => 'internal_out', typreceive => '-', typsend => '-',
typalign => 'ALIGNOF_POINTER' },
{ oid => '2282', descr => 'obsolete, deprecated pseudo-type',
typname => 'opaque', typlen => '4', typbyval => 't', typtype => 'p',
typcategory => 'P', typinput => 'opaque_in', typoutput => 'opaque_out',
typreceive => '-', typsend => '-', typalign => 'i' },
{ oid => '2283', descr => 'pseudo-type representing a polymorphic base type',
typname => 'anyelement', typlen => '4', typbyval => 't', typtype => 'p',
typcategory => 'P', typinput => 'anyelement_in',
Expand Down Expand Up @@ -590,9 +600,34 @@
typoutput => 'table_am_handler_out', typreceive => '-', typsend => '-',
typalign => 'i' },
{ oid => '3831',
descr => 'pseudo-type representing a polymorphic base type that is a range',
descr => 'pseudo-type representing a range over a polymorphic base type',
typname => 'anyrange', typlen => '-1', typbyval => 'f', typtype => 'p',
typcategory => 'P', typinput => 'anyrange_in', typoutput => 'anyrange_out',
typreceive => '-', typsend => '-', typalign => 'd', typstorage => 'x' },
{ oid => '5077',
descr => 'pseudo-type representing a polymorphic common type',
typname => 'anycompatible', typlen => '4', typbyval => 't', typtype => 'p',
typcategory => 'P', typinput => 'anycompatible_in',
typoutput => 'anycompatible_out', typreceive => '-', typsend => '-',
typalign => 'i' },
{ oid => '5078',
descr => 'pseudo-type representing an array of polymorphic common type elements',
typname => 'anycompatiblearray', typlen => '-1', typbyval => 'f',
typtype => 'p', typcategory => 'P', typinput => 'anycompatiblearray_in',
typoutput => 'anycompatiblearray_out',
typreceive => 'anycompatiblearray_recv', typsend => 'anycompatiblearray_send',
typalign => 'd', typstorage => 'x' },
{ oid => '5079',
descr => 'pseudo-type representing a polymorphic common type that is not an array',
typname => 'anycompatiblenonarray', typlen => '4', typbyval => 't',
typtype => 'p', typcategory => 'P', typinput => 'anycompatiblenonarray_in',
typoutput => 'anycompatiblenonarray_out', typreceive => '-', typsend => '-',
typalign => 'i' },
{ oid => '5080',
descr => 'pseudo-type representing a range over a polymorphic common type',
typname => 'anycompatiblerange', typlen => '-1', typbyval => 'f',
typtype => 'p', typcategory => 'P', typinput => 'anycompatiblerange_in',
typoutput => 'anycompatiblerange_out', typreceive => '-', typsend => '-',
typalign => 'd', typstorage => 'x' },

]
90 changes: 81 additions & 9 deletions postgres-types/src/type_gen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ pub enum Inner {
PgNodeTree,
JsonArray,
TableAmHandler,
Xid8Array,
IndexAmHandler,
Point,
Lseg,
Expand Down Expand Up @@ -125,7 +126,6 @@ pub enum Inner {
Trigger,
LanguageHandler,
Internal,
Opaque,
Anyelement,
RecordArray,
Anynonarray,
Expand Down Expand Up @@ -172,7 +172,16 @@ pub enum Inner {
RegnamespaceArray,
Regrole,
RegroleArray,
Regcollation,
RegcollationArray,
PgMcvList,
PgSnapshot,
PgSnapshotArray,
Xid8,
Anycompatible,
Anycompatiblearray,
Anycompatiblenonarray,
AnycompatibleRange,
Other(Arc<Other>),
}

Expand Down Expand Up @@ -201,6 +210,7 @@ impl Inner {
194 => Some(Inner::PgNodeTree),
199 => Some(Inner::JsonArray),
269 => Some(Inner::TableAmHandler),
271 => Some(Inner::Xid8Array),
325 => Some(Inner::IndexAmHandler),
600 => Some(Inner::Point),
601 => Some(Inner::Lseg),
Expand Down Expand Up @@ -291,7 +301,6 @@ impl Inner {
2279 => Some(Inner::Trigger),
2280 => Some(Inner::LanguageHandler),
2281 => Some(Inner::Internal),
2282 => Some(Inner::Opaque),
2283 => Some(Inner::Anyelement),
2287 => Some(Inner::RecordArray),
2776 => Some(Inner::Anynonarray),
Expand Down Expand Up @@ -338,7 +347,16 @@ impl Inner {
4090 => Some(Inner::RegnamespaceArray),
4096 => Some(Inner::Regrole),
4097 => Some(Inner::RegroleArray),
4191 => Some(Inner::Regcollation),
4192 => Some(Inner::RegcollationArray),
5017 => Some(Inner::PgMcvList),
5038 => Some(Inner::PgSnapshot),
5039 => Some(Inner::PgSnapshotArray),
5069 => Some(Inner::Xid8),
5077 => Some(Inner::Anycompatible),
5078 => Some(Inner::Anycompatiblearray),
5079 => Some(Inner::Anycompatiblenonarray),
5080 => Some(Inner::AnycompatibleRange),
_ => None,
}
}
Expand Down Expand Up @@ -367,6 +385,7 @@ impl Inner {
Inner::PgNodeTree => 194,
Inner::JsonArray => 199,
Inner::TableAmHandler => 269,
Inner::Xid8Array => 271,
Inner::IndexAmHandler => 325,
Inner::Point => 600,
Inner::Lseg => 601,
Expand Down Expand Up @@ -457,7 +476,6 @@ impl Inner {
Inner::Trigger => 2279,
Inner::LanguageHandler => 2280,
Inner::Internal => 2281,
Inner::Opaque => 2282,
Inner::Anyelement => 2283,
Inner::RecordArray => 2287,
Inner::Anynonarray => 2776,
Expand Down Expand Up @@ -504,7 +522,16 @@ impl Inner {
Inner::RegnamespaceArray => 4090,
Inner::Regrole => 4096,
Inner::RegroleArray => 4097,
Inner::Regcollation => 4191,
Inner::RegcollationArray => 4192,
Inner::PgMcvList => 5017,
Inner::PgSnapshot => 5038,
Inner::PgSnapshotArray => 5039,
Inner::Xid8 => 5069,
Inner::Anycompatible => 5077,
Inner::Anycompatiblearray => 5078,
Inner::Anycompatiblenonarray => 5079,
Inner::AnycompatibleRange => 5080,
Inner::Other(ref u) => u.oid,
}
}
Expand Down Expand Up @@ -533,6 +560,7 @@ impl Inner {
Inner::PgNodeTree => &Kind::Simple,
Inner::JsonArray => &Kind::Array(Type(Inner::Json)),
Inner::TableAmHandler => &Kind::Pseudo,
Inner::Xid8Array => &Kind::Array(Type(Inner::Xid8)),
Inner::IndexAmHandler => &Kind::Pseudo,
Inner::Point => &Kind::Simple,
Inner::Lseg => &Kind::Simple,
Expand Down Expand Up @@ -623,7 +651,6 @@ impl Inner {
Inner::Trigger => &Kind::Pseudo,
Inner::LanguageHandler => &Kind::Pseudo,
Inner::Internal => &Kind::Pseudo,
Inner::Opaque => &Kind::Pseudo,
Inner::Anyelement => &Kind::Pseudo,
Inner::RecordArray => &Kind::Pseudo,
Inner::Anynonarray => &Kind::Pseudo,
Expand Down Expand Up @@ -670,7 +697,16 @@ impl Inner {
Inner::RegnamespaceArray => &Kind::Array(Type(Inner::Regnamespace)),
Inner::Regrole => &Kind::Simple,
Inner::RegroleArray => &Kind::Array(Type(Inner::Regrole)),
Inner::Regcollation => &Kind::Simple,
Inner::RegcollationArray => &Kind::Array(Type(Inner::Regcollation)),
Inner::PgMcvList => &Kind::Simple,
Inner::PgSnapshot => &Kind::Simple,
Inner::PgSnapshotArray => &Kind::Array(Type(Inner::PgSnapshot)),
Inner::Xid8 => &Kind::Simple,
Inner::Anycompatible => &Kind::Pseudo,
Inner::Anycompatiblearray => &Kind::Pseudo,
Inner::Anycompatiblenonarray => &Kind::Pseudo,
Inner::AnycompatibleRange => &Kind::Pseudo,
Inner::Other(ref u) => &u.kind,
}
}
Expand Down Expand Up @@ -699,6 +735,7 @@ impl Inner {
Inner::PgNodeTree => "pg_node_tree",
Inner::JsonArray => "_json",
Inner::TableAmHandler => "table_am_handler",
Inner::Xid8Array => "_xid8",
Inner::IndexAmHandler => "index_am_handler",
Inner::Point => "point",
Inner::Lseg => "lseg",
Expand Down Expand Up @@ -789,7 +826,6 @@ impl Inner {
Inner::Trigger => "trigger",
Inner::LanguageHandler => "language_handler",
Inner::Internal => "internal",
Inner::Opaque => "opaque",
Inner::Anyelement => "anyelement",
Inner::RecordArray => "_record",
Inner::Anynonarray => "anynonarray",
Expand Down Expand Up @@ -836,7 +872,16 @@ impl Inner {
Inner::RegnamespaceArray => "_regnamespace",
Inner::Regrole => "regrole",
Inner::RegroleArray => "_regrole",
Inner::Regcollation => "regcollation",
Inner::RegcollationArray => "_regcollation",
Inner::PgMcvList => "pg_mcv_list",
Inner::PgSnapshot => "pg_snapshot",
Inner::PgSnapshotArray => "_pg_snapshot",
Inner::Xid8 => "xid8",
Inner::Anycompatible => "anycompatible",
Inner::Anycompatiblearray => "anycompatiblearray",
Inner::Anycompatiblenonarray => "anycompatiblenonarray",
Inner::AnycompatibleRange => "anycompatiblerange",
Inner::Other(ref u) => &u.name,
}
}
Expand Down Expand Up @@ -908,6 +953,9 @@ impl Type {
/// TABLE_AM_HANDLER
pub const TABLE_AM_HANDLER: Type = Type(Inner::TableAmHandler);

/// XID8&#91;&#93;
pub const XID8_ARRAY: Type = Type(Inner::Xid8Array);

/// INDEX_AM_HANDLER - pseudo-type for the result of an index AM handler function
pub const INDEX_AM_HANDLER: Type = Type(Inner::IndexAmHandler);

Expand Down Expand Up @@ -1178,9 +1226,6 @@ impl Type {
/// INTERNAL - pseudo-type representing an internal data structure
pub const INTERNAL: Type = Type(Inner::Internal);

/// OPAQUE - obsolete, deprecated pseudo-type
pub const OPAQUE: Type = Type(Inner::Opaque);

/// ANYELEMENT - pseudo-type representing a polymorphic base type
pub const ANYELEMENT: Type = Type(Inner::Anyelement);

Expand Down Expand Up @@ -1259,7 +1304,7 @@ impl Type {
/// JSONB&#91;&#93;
pub const JSONB_ARRAY: Type = Type(Inner::JsonbArray);

/// ANYRANGE - pseudo-type representing a polymorphic base type that is a range
/// ANYRANGE - pseudo-type representing a range over a polymorphic base type
pub const ANY_RANGE: Type = Type(Inner::AnyRange);

/// EVENT_TRIGGER - pseudo-type for the result of an event trigger function
Expand Down Expand Up @@ -1319,6 +1364,33 @@ impl Type {
/// REGROLE&#91;&#93;
pub const REGROLE_ARRAY: Type = Type(Inner::RegroleArray);

/// REGCOLLATION - registered collation
pub const REGCOLLATION: Type = Type(Inner::Regcollation);

/// REGCOLLATION&#91;&#93;
pub const REGCOLLATION_ARRAY: Type = Type(Inner::RegcollationArray);

/// PG_MCV_LIST - multivariate MCV list
pub const PG_MCV_LIST: Type = Type(Inner::PgMcvList);

/// PG_SNAPSHOT - snapshot
pub const PG_SNAPSHOT: Type = Type(Inner::PgSnapshot);

/// PG_SNAPSHOT&#91;&#93;
pub const PG_SNAPSHOT_ARRAY: Type = Type(Inner::PgSnapshotArray);

/// XID8 - full transaction id
pub const XID8: Type = Type(Inner::Xid8);

/// ANYCOMPATIBLE - pseudo-type representing a polymorphic common type
pub const ANYCOMPATIBLE: Type = Type(Inner::Anycompatible);

/// ANYCOMPATIBLEARRAY - pseudo-type representing an array of polymorphic common type elements
pub const ANYCOMPATIBLEARRAY: Type = Type(Inner::Anycompatiblearray);

/// ANYCOMPATIBLENONARRAY - pseudo-type representing a polymorphic common type that is not an array
pub const ANYCOMPATIBLENONARRAY: Type = Type(Inner::Anycompatiblenonarray);

/// ANYCOMPATIBLERANGE - pseudo-type representing a range over a polymorphic common type
pub const ANYCOMPATIBLE_RANGE: Type = Type(Inner::AnycompatibleRange);
}
Loading

0 comments on commit 316c6dc

Please sign in to comment.