Skip to main content

postgres_static_analyzer_ddl_catalog_structs/
lib.rs

1//! Struct definitions for all the [postgres catalog tables](https://www.postgresql.org/docs/17/catalogs.html) that are [**DDL only**](https://en.wikipedia.org/wiki/Data_definition_language), meaning only the tables and columns that describe the "schema" of the database are included. No `oid`s, no transient server state or like clustering or tablespaces etc, and of course no actual table data.
2//!
3//! `oid`s pointing to other tables are translated to strings (as [`Str`]) representing their qualified name, using their ["reg" cast](https://www.postgresql.org/docs/17/datatype-oid.html) if they have one, or are constructed manually using `quote_ident` if not. Objects that are contained in a [namespace](https://www.postgresql.org/docs/17/catalog-pg-namespace.html) are prefixed with it, except for objects in the `pg_catalog` namespace due to the way `search_path` rules work.
4
5pub use smol_str::SmolStr as Str;
6pub use ordered_float;
7
8pub type Set<T> = hashbrown::HashSet<T>;
9pub type Map<T> = hashbrown::HashMap<Str, T>;
10// pub(crate) use hashbrown::HashMap;
11
12mod struct_gen;
13pub use struct_gen::*;
14
15/// [Access control items](https://www.postgresql.org/docs/17/ddl-priv.html), similar to what you'd get if you called [`aclexplode`](https://www.postgresql.org/docs/17/functions-info.html#FUNCTIONS-ACLITEM-FN-TABLE), except that grants are grouped by grantee/grantor pairs.
16#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd)]
17pub struct AclItem<G> {
18	/// `None` means the grants are for [`public`](https://www.postgresql.org/docs/17/ddl-schemas.html#DDL-SCHEMAS-PUBLIC)
19	pub grantee: Option<Str>,
20	/// The role who granted these grants
21	pub grantor: Str,
22	pub grants: Vec<Grant<G>>,
23}
24
25#[derive(Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd)]
26pub struct Grant<G> {
27	pub privilege: G,
28	/// Whether `grantee` can re-grant this grant
29	pub with_grant_option: bool,
30}
31
32// DATABASE	CTc	Tc	\l
33pub type DbAclItem = AclItem<DbAclPrivilege>;
34pub type DbGrant = Grant<DbAclPrivilege>;
35#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
36pub enum DbAclPrivilege { CREATE, TEMPORARY, CONNECT }
37
38// DOMAIN  U  U  \dD+
39
40// FUNCTION or PROCEDURE	X	X	\df+
41pub type FunctionAclItem = AclItem<FunctionAclPrivilege>;
42pub type FunctionGrant = Grant<FunctionAclPrivilege>;
43#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
44pub enum FunctionAclPrivilege { EXECUTE }
45
46// FOREIGN DATA WRAPPER	U	none	\dew+
47pub type ForeignDataWrapperAclItem = AclItem<ForeignDataWrapperAclPrivilege>;
48pub type ForeignDataWrapperGrant = Grant<ForeignDataWrapperAclPrivilege>;
49#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
50pub enum ForeignDataWrapperAclPrivilege { USAGE }
51
52// FOREIGN SERVER	U	none	\des+
53pub type ForeignServerAclItem = AclItem<ForeignServerAclPrivilege>;
54pub type ForeignServerGrant = Grant<ForeignServerAclPrivilege>;
55#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
56pub enum ForeignServerAclPrivilege { USAGE }
57
58// LANGUAGE	U	U	\dL+
59pub type LanguageAclItem = AclItem<LanguageAclPrivilege>;
60pub type LanguageGrant = Grant<LanguageAclPrivilege>;
61#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
62pub enum LanguageAclPrivilege { USAGE }
63
64// PARAMETER	sA	none	\dconfig+
65pub type ParameterAclItem = AclItem<ParameterAclPrivilege>;
66pub type ParameterGrant = Grant<ParameterAclPrivilege>;
67#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
68pub enum ParameterAclPrivilege {  SET, #[postgres(name = "ALTER SYSTEM")] ALTERSYSTEM  }
69
70// SCHEMA	UC	none	\dn+
71pub type SchemaAclItem = AclItem<SchemaAclPrivilege>;
72pub type SchemaGrant = Grant<SchemaAclPrivilege>;
73#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
74pub enum SchemaAclPrivilege { USAGE, CREATE }
75
76// SEQUENCE	rwU	none	\dp
77
78// TABLE (and table-like objects)	arwdDxtm	none	\dp
79pub type TableAclItem = AclItem<TableAclPrivilege>;
80pub type TableGrant = Grant<TableAclPrivilege>;
81#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
82pub enum TableAclPrivilege { INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, MAINTAIN, USAGE }
83
84// Table column	arwx	none	\dp
85pub type TableColumnAclItem = AclItem<TableColumnAclPrivilege>;
86pub type TableColumnGrant = Grant<TableColumnAclPrivilege>;
87#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
88pub enum TableColumnAclPrivilege { INSERT, SELECT, UPDATE, REFERENCES }
89
90// TYPE	U	U	\dT+
91pub type TypeAclItem = AclItem<TypeAclPrivilege>;
92pub type TypeGrant = Grant<TypeAclPrivilege>;
93#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
94pub enum TypeAclPrivilege { USAGE }
95
96pub type AclDefaultAclItem = AclItem<AclDefaultAclPrivilege>;
97pub type AclDefaultGrant = Grant<AclDefaultAclPrivilege>;
98#[derive(Copy, Debug, serde::Serialize, serde::Deserialize, Clone, PartialEq, Eq, Ord, PartialOrd, postgres_types::FromSql, postgres_types::ToSql)]
99pub enum AclDefaultAclPrivilege {
100	INSERT, SELECT, UPDATE, DELETE, TRUNCATE, REFERENCES, TRIGGER, MAINTAIN,
101	USAGE,
102	EXECUTE,
103}
104
105/// A large wrapper struct that holds the results of all the other reflections.
106/// Only includes information for the single [database](https://www.postgresql.org/docs/17/sql-createdatabase.html), which is why `pg_database` isn't a collection.
107/// Objects that are "cluster shared" such as roles are those for the entire cluster.
108#[derive(Debug, serde::Serialize, serde::Deserialize)]
109pub struct DbState {
110	pub pg_aggregate: Vec<PgAggregate>,
111	pub pg_am: Set<PgAm>,
112	pub pg_amop: Vec<PgAmop>,
113	pub pg_amproc: Vec<PgAmproc>,
114	pub pg_attrdef: Vec<PgAttrdef>,
115	pub pg_attribute: Vec<PgAttribute>,
116	pub pg_roles: Set<PgRoles>,
117	pub pg_auth_members: Vec<PgAuthMembers>,
118	pub pg_cast: Vec<PgCast>,
119	pub pg_class: Set<PgClass>,
120	pub pg_collation: Vec<PgCollation>,
121	pub pg_constraint: Vec<PgConstraint>,
122	pub pg_conversion: Vec<PgConversion>,
123	pub pg_database: PgDatabase,
124	pub pg_db_role_setting: Vec<PgDbRoleSetting>,
125	pub pg_default_acl: Vec<PgDefaultAcl>,
126	// pub pg_depend: PgDepend,
127	// pub pg_description: PgDescription,
128	pub pg_enum: Set<PgEnum>,
129	pub pg_event_trigger: Vec<PgEventTrigger>,
130	pub pg_extension: Vec<PgExtension>,
131	pub pg_foreign_data_wrapper: Vec<PgForeignDataWrapper>,
132	pub pg_foreign_server: Vec<PgForeignServer>,
133	pub pg_foreign_table: Vec<PgForeignTable>,
134	pub pg_index: Vec<PgIndex>,
135	pub pg_inherits: Vec<PgInherits>,
136	// pub pg_init_privs: Vec<PgInitPrivs>,
137	pub pg_language: Set<PgLanguage>,
138	pub pg_namespace: Set<PgNamespace>,
139	pub pg_opclass: Vec<PgOpclass>,
140	pub pg_operator: Set<PgOperator>,
141	pub pg_opfamily: Vec<PgOpfamily>,
142	pub pg_parameter_acl: Vec<PgParameterAcl>,
143	pub pg_partitioned_table: Vec<PgPartitionedTable>,
144	pub pg_policy: Vec<PgPolicy>,
145	pub pg_proc: Set<PgProc>,
146	pub pg_publication: Set<PgPublication>,
147	pub pg_publication_namespace: Vec<PgPublicationNamespace>,
148	pub pg_publication_rel: Vec<PgPublicationRel>,
149	pub pg_range: Vec<PgRange>,
150	// pub pg_replication_origin: Vec<PgReplicationOrigin>,
151	// pub pg_rewrite: Vec<PgRewrite>,
152	pub pg_rules: Vec<PgRules>,
153	pub pg_views: Vec<PgViews>,
154	pub pg_matviews: Vec<PgMatviews>,
155	// pub pg_seclabel: Vec<PgSeclabel>,
156	pub pg_sequence: Vec<PgSequence>,
157	// pub pg_shdepend: Vec<PgShdepend>,
158	// pub pg_shdescription: Vec<PgShdescription>,
159	// pub pg_shseclabel: Vec<PgShseclabel>,
160	pub pg_statistic_ext: Vec<PgStatisticExt>,
161	pub pg_subscription: Vec<PgSubscription>,
162	pub pg_transform: Vec<PgTransform>,
163	pub pg_trigger: Vec<PgTrigger>,
164	pub pg_ts_config: Set<PgTsConfig>,
165	pub pg_ts_config_map: Vec<PgTsConfigMap>,
166	pub pg_ts_dict: Set<PgTsDict>,
167	pub pg_ts_parser: Vec<PgTsParser>,
168	pub pg_ts_template: Vec<PgTsTemplate>,
169	pub pg_type: Set<PgType>,
170	pub pg_user_mappings: Vec<PgUserMappings>,
171}
172
173macro_rules! impl_hash_and_equivalent {
174	($type:ty, $field:ident) => {
175		impl std::hash::Hash for $type {
176			fn hash<H: std::hash::Hasher>(&self, state: &mut H) {
177				self.$field.hash(state);
178			}
179		}
180
181		impl hashbrown::Equivalent<$type> for str {
182			fn equivalent(&self, key: &$type) -> bool {
183				key.$field == *self
184			}
185		}
186
187		impl hashbrown::Equivalent<$type> for Str {
188			fn equivalent(&self, key: &$type) -> bool {
189				key.$field == *self
190			}
191		}
192	};
193}
194pub(crate) use impl_hash_and_equivalent;
195
196// macro_rules! impl_pg_from_str {
197// 	($type:ident, $($variant:ident),+ $(,)?) => {
198// 		impl $type {
199// 			fn pg_from_str(s: &str) -> $type {
200// 				match s {
201// 					$(stringify!($variant) => $type::$variant,)+
202// 					_ => panic!("Postgres returned unexpected {} variant: {}", stringify!($type), s),
203// 				}
204// 			}
205// 		}
206// 	};
207// }
208
209macro_rules! pg_char_enum {
210	($name:ident { $($char:literal => $variant:ident),* $(,)? }) => {
211		#[derive(Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone)]
212		pub enum $name {
213			$($variant),*
214		}
215
216		impl $name {
217			pub fn pg_from_char(c: i8) -> $name {
218				match c as u8 as char {
219					$($char => $name::$variant,)*
220					_ => panic!(
221						"unknown {} variant: {}",
222						stringify!($name),
223						c as u8 as char
224					),
225				}
226			}
227		}
228	};
229}
230pub(crate) use pg_char_enum;
231
232// `pg_aggregate`: https://www.postgresql.org/docs/17/catalog-pg-aggregate.html
233
234// `pg_am`: https://www.postgresql.org/docs/17/catalog-pg-am.html
235
236// `pg_amop`: https://www.postgresql.org/docs/17/catalog-pg-amop.html
237
238// `pg_amproc`: https://www.postgresql.org/docs/17/catalog-pg-amproc.html
239
240// `pg_attrdef`: https://www.postgresql.org/docs/17/catalog-pg-attrdef.html
241
242// `pg_attribute`: https://www.postgresql.org/docs/17/catalog-pg-attribute.html
243
244// `pg_authid`: https://www.postgresql.org/docs/17/catalog-pg-authid.html
245// `pg_roles`: https://www.postgresql.org/docs/17/view-pg-roles.html
246
247// `pg_auth_members`: https://www.postgresql.org/docs/17/catalog-pg-auth-members.html
248
249// `pg_cast`: https://www.postgresql.org/docs/17/catalog-pg-cast.html
250
251// `pg_class`: https://www.postgresql.org/docs/17/catalog-pg-class.html
252
253// `pg_collation`: https://www.postgresql.org/docs/17/catalog-pg-collation.html
254
255// `pg_constraint`: https://www.postgresql.org/docs/17/catalog-pg-constraint.html
256
257// `pg_conversion`: https://www.postgresql.org/docs/17/catalog-pg-conversion.html
258
259// `pg_database`: https://www.postgresql.org/docs/17/catalog-pg-database.html
260
261/// The DDL-only contents of [`pg_db_role_setting`](https://www.postgresql.org/docs/17/catalog-pg-db-role-setting.html)
262#[derive(Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone)]
263pub struct PgDbRoleSetting {
264	/// `oid` (references pg_database.oid) The OID of the database the setting is applicable to, or zero if not database-specific
265	pub setdatabase: Option<()>,
266	/// `oid` `(references pg_authid.oid)` The OID of the role the setting is applicable to, or zero if not role-specific
267	pub setrole: Option<Str>,
268	/// `text[]`  Defaults for run-time configuration variables
269	pub setconfig: Option<Vec<Str>>,
270}
271
272// `pg_default_acl`: https://www.postgresql.org/docs/17/catalog-pg-default-acl.html
273
274// `pg_depend`: https://www.postgresql.org/docs/17/catalog-pg-depend.html
275
276// `pg_description`: https://www.postgresql.org/docs/17/catalog-pg-description.html
277
278/// The DDL-only contents of [`pg_enum`](https://www.postgresql.org/docs/17/catalog-pg-enum.html)
279#[derive(Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone)]
280pub struct PgEnum {
281	// `oid`  Row identifier
282	/// enumtypid `oid` `(references pg_type.oid)` The OID of the pg_type entry owning this enum value
283	pub enumtypid: Str,
284	/// enumlabel `name`  The textual label for this enum value
285	pub enumlabels: Vec<Str>,
286	// enumsortorder `float4`  The sort position of this enum value within its enum type
287}
288impl_hash_and_equivalent!(PgEnum, enumtypid);
289
290// `pg_event_trigger`: https://www.postgresql.org/docs/17/catalog-pg-event-trigger.html
291
292// `pg_extension`: https://www.postgresql.org/docs/17/catalog-pg-extension.html
293
294// `pg_foreign_data_wrapper`: https://www.postgresql.org/docs/17/catalog-pg-foreign-data-wrapper.html
295
296// `pg_foreign_server`: https://www.postgresql.org/docs/17/catalog-pg-foreign-server.html
297
298// `pg_foreign_table`: https://www.postgresql.org/docs/17/catalog-pg-foreign-table.html
299
300// `pg_index`: https://www.postgresql.org/docs/17/catalog-pg-index.html
301
302// `pg_inherits`: https://www.postgresql.org/docs/17/catalog-pg-inherits.html
303
304// `pg_init_privs`: https://www.postgresql.org/docs/17/catalog-pg-init-privs.html
305
306// `pg_language`: https://www.postgresql.org/docs/17/catalog-pg-language.html
307
308// `pg_namespace`: https://www.postgresql.org/docs/17/catalog-pg-namespace.html
309
310// `pg_opclass`: https://www.postgresql.org/docs/17/catalog-pg-opclass.html
311
312// `pg_operator`: https://www.postgresql.org/docs/17/catalog-pg-operator.html
313
314// `pg_opfamily`: https://www.postgresql.org/docs/17/catalog-pg-opfamily.html
315
316// `pg_parameter_acl`: https://www.postgresql.org/docs/17/catalog-pg-parameter-acl.html
317
318// `pg_partitioned_table`: https://www.postgresql.org/docs/17/catalog-pg-partitioned-table.html
319
320// `pg_policy`: https://www.postgresql.org/docs/17/catalog-pg-policy.html
321
322/// The DDL-only contents of [`pg_proc`](https://www.postgresql.org/docs/17/catalog-pg-proc.html)
323#[derive(Debug, serde::Serialize, serde::Deserialize, PartialEq, Eq, Clone)]
324pub struct PgProc {
325	/// `oid`  Row identifier
326	pub oid: Str,
327	/// `name`  Name of the function
328	pub proname: Str,
329	/// `oid` `(references pg_namespace.oid)` The OID of the namespace that contains this function
330	pub pronamespace: Str,
331	/// `oid` `(references pg_authid.oid)` Owner of the function
332	pub proowner: Str,
333	/// `oid` `(references pg_language.oid)` Implementation language or call interface of this function
334	pub prolang: Str,
335	/// `float4`  Estimated execution cost (in units of cpu_operator_cost); if proretset, this is cost per row returned
336	pub procost: Option<ordered_float::NotNan<f32>>,
337	/// `float4`  Estimated number of result rows (zero if not proretset)
338	pub prorows: Option<ordered_float::NotNan<f32>>,
339	/// `oid` `(references pg_type.oid)` Data type of the variadic array parameter's elements, or zero if the function does not have a variadic parameter
340	pub provariadic: Option<Str>,
341	/// `regproc` `(references pg_proc.oid)` Planner support function for this function (see Section 36.11), or zero if none
342	pub prosupport: Option<Str>,
343	/// `char`  f for a normal function, p for a procedure, a for an aggregate function, or w for a window function
344	pub prokind: PgProcProkind,
345	/// `bool`  Function is a security definer (i.e., a “setuid” function)
346	pub prosecdef: bool,
347	/// `bool`  The function has no side effects. No information about the arguments is conveyed except via the return value. Any function that might throw an error depending on the values of its arguments is not leak-proof.
348	pub proleakproof: bool,
349	/// `bool`  Function returns null if any call argument is null. In that case the function won't actually be called at all. Functions that are not “strict” must be prepared to handle null inputs.
350	pub proisstrict: bool,
351	/// `bool`  Function returns a set (i.e., multiple values of the specified data type)
352	pub proretset: bool,
353	/// `char`  provolatile tells whether the function's result depends only on its input arguments, or is affected by outside factors. It is i for “immutable” functions, which always deliver the same result for the same inputs. It is s for “stable” functions, whose results (for fixed inputs) do not change within a scan. It is v for “volatile” functions, whose results might change at any time. (Use v also for functions with side-effects, so that calls to them cannot get optimized away.)
354	pub provolatile: PgProcProvolatile,
355	/// `char`  proparallel tells whether the function can be safely run in parallel mode. It is s for functions which are safe to run in parallel mode without restriction. It is r for functions which can be run in parallel mode, but their execution is restricted to the parallel group leader; parallel worker processes cannot invoke these functions. It is u for functions which are unsafe in parallel mode; the presence of such a function forces a serial execution plan.
356	pub proparallel: PgProcProparallel,
357	/// `int2`  Number of input arguments
358	pub pronargs: u16,
359	/// `int2`  Number of arguments that have defaults
360	pub pronargdefaults: u16,
361	/// `oid` `(references pg_type.oid)` Data type of the return value
362	pub prorettype: Str,
363	// `oidvector` `(references pg_type.oid)` An array of the data types of the function arguments. This includes only input arguments (including INOUT and VARIADIC arguments), and thus represents the call signature of the function.
364	pub proargtypes: Vec<Str>,
365	/// `oid[]` `(references pg_type.oid)` An array of the data types of the function arguments. This includes all arguments (including OUT and INOUT arguments); however, if all the arguments are IN arguments, this field will be null. Note that subscripting is 1-based, whereas for historical reasons proargtypes is subscripted from 0.
366	pub proallargtypes: Option<Vec<Str>>,
367	/// `char[]`  An array of the modes of the function arguments, encoded as i for IN arguments, o for OUT arguments, b for INOUT arguments, v for VARIADIC arguments, t for TABLE arguments. If all the arguments are IN arguments, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes.
368	pub proargmodes: Option<Vec<PgProcProargmodes>>,
369	/// `text[]`  An array of the names of the function arguments. Arguments without a name are set to empty strings in the array. If none of the arguments have a name, this field will be null. Note that subscripts correspond to positions of proallargtypes not proargtypes.
370	pub proargnames: Option<Vec<Str>>,
371	/// `pg_node_tree`  Expression trees (in nodeToString() representation) for default values. This is a list with pronargdefaults elements, corresponding to the last N input arguments (i.e., the last N proargtypes positions). If none of the arguments have defaults, this field will be null.
372	pub proargdefaults: Option<Vec<Option<Str>>>,
373	/// `oid[]` `(references pg_type.oid)` An array of the argument/result data type(s) for which to apply transforms (from the function's TRANSFORM clause). Null if none.
374	pub protrftypes: Option<Vec<Str>>,
375	/// `text`  This tells the function handler how to invoke the function. It might be the actual source code of the function for interpreted languages, a link symbol, a file name, or just about anything else, depending on the implementation language/call convention.
376	pub prosrc: Option<Str>,
377	/// `text`  Additional information about how to invoke the function. Again, the interpretation is language-specific.
378	pub probin: Option<Str>,
379	/// pg_node_tree  Pre-parsed SQL function body. This is used for SQL-language functions when the body is given in SQL-standard notation rather than as a string literal. It's null in other cases.
380	pub prosqlbody: Option<Str>,
381	/// `text[]`  Function's local settings for run-time configuration variables
382	pub proconfig: Option<Vec<Str>>,
383	/// `aclitem[]`  Access privileges; see Section 5.8 for details
384	pub proacl: Option<Vec<FunctionAclItem>>,
385	/// `text`  The comment from pg_description
386	pub description: Option<Str>,
387}
388impl_hash_and_equivalent!(PgProc, oid);
389
390// f for a normal function, p for a procedure, a for an aggregate function, or w for a window function
391pg_char_enum!(PgProcProkind { 'f' => NormalFunction, 'p' => Procedure, 'a' => AggregateFunction, 'w' => WindowFunction });
392// It is i for “immutable” functions, which always deliver the same result for the same inputs. It is s for “stable” functions, whose results (for fixed inputs) do not change within a scan. It is v for “volatile” functions, whose results might change at any time
393pg_char_enum!(PgProcProvolatile { 'i' => Immutable, 's' => Stable, 'v' => Volatile });
394// It is s for functions which are safe to run in parallel mode without restriction. It is r for functions which can be run in parallel mode, but their execution is restricted to the parallel group leader; parallel worker processes cannot invoke these functions. It is u for functions which are unsafe in parallel mode; the presence of such a function forces a serial execution plan.
395pg_char_enum!(PgProcProparallel { 's' => SafeWithoutRestriction, 'r' => RestrictedToGroupLeader, 'u' => Unsafe });
396// i for IN arguments, o for OUT arguments, b for INOUT arguments, v for VARIADIC arguments, t for TABLE arguments
397pg_char_enum!(PgProcProargmodes { 'i' => In, 'o' => Out, 'b' => Inout, 'v' => Variadic, 't' => Table });
398
399// `pg_publication`: https://www.postgresql.org/docs/17/catalog-pg-publication.html
400
401// `pg_publication_namespace`: https://www.postgresql.org/docs/17/catalog-pg-publication-namespace.html
402
403// `pg_publication_rel`: https://www.postgresql.org/docs/17/catalog-pg-publication-rel.html
404
405// `pg_range`: https://www.postgresql.org/docs/17/catalog-pg-range.html
406
407// `pg_replication_origin`: https://www.postgresql.org/docs/17/catalog-pg-replication-origin.html
408
409// `pg_rewrite`: https://www.postgresql.org/docs/17/catalog-pg-rewrite.html
410
411// `pg_rules`: https://www.postgresql.org/docs/17/view-pg-rules.html
412// `pg_views`: https://www.postgresql.org/docs/17/view-pg-views.html
413// `pg_matviews`: https://www.postgresql.org/docs/17/view-pg-matviews.html
414
415// `pg_seclabel`: https://www.postgresql.org/docs/17/catalog-pg-seclabel.html
416
417// `pg_sequence`: https://www.postgresql.org/docs/17/catalog-pg-sequence.html
418
419// `pg_shdepend`: https://www.postgresql.org/docs/17/catalog-pg-shdepend.html
420
421// `pg_shdescription`: https://www.postgresql.org/docs/17/catalog-pg-shdescription.html
422
423// `pg_shseclabel`: https://www.postgresql.org/docs/17/catalog-pg-shseclabel.html
424
425// `pg_statistic_ext`: https://www.postgresql.org/docs/17/catalog-pg-statistic-ext.html
426
427// `pg_subscription`: https://www.postgresql.org/docs/17/catalog-pg-subscription.html
428
429// `pg_transform`: https://www.postgresql.org/docs/17/catalog-pg-transform.html
430
431// `pg_trigger`: https://www.postgresql.org/docs/17/catalog-pg-trigger.html
432
433// `pg_ts_config`: https://www.postgresql.org/docs/17/catalog-pg-ts-config.html
434
435// `pg_ts_config_map`: https://www.postgresql.org/docs/17/catalog-pg-ts-config-map.html
436
437// `pg_ts_dict`: https://www.postgresql.org/docs/17/catalog-pg-ts-dict.html
438
439// `pg_ts_parser`: https://www.postgresql.org/docs/17/catalog-pg-ts-parser.html
440
441// `pg_ts_template`: https://www.postgresql.org/docs/17/catalog-pg-ts-template.html
442
443// `pg_type`: https://www.postgresql.org/docs/17/catalog-pg-type.html
444
445// `pg_user_mappings`: https://www.postgresql.org/docs/17/catalog-pg-user-mapping.html