Skip to main content

PgProc

Struct PgProc 

Source
pub struct PgProc {
Show 31 fields pub oid: SmolStr, pub proname: SmolStr, pub pronamespace: SmolStr, pub proowner: SmolStr, pub prolang: SmolStr, pub procost: Option<NotNan<f32>>, pub prorows: Option<NotNan<f32>>, pub provariadic: Option<SmolStr>, pub prosupport: Option<SmolStr>, pub prokind: PgProcProkind, pub prosecdef: bool, pub proleakproof: bool, pub proisstrict: bool, pub proretset: bool, pub provolatile: PgProcProvolatile, pub proparallel: PgProcProparallel, pub pronargs: u16, pub pronargdefaults: u16, pub prorettype: SmolStr, pub proargtypes: Vec<SmolStr>, pub proallargtypes: Option<Vec<SmolStr>>, pub proargmodes: Option<Vec<PgProcProargmodes>>, pub proargnames: Option<Vec<SmolStr>>, pub proargdefaults: Option<Vec<Option<SmolStr>>>, pub protrftypes: Option<Vec<SmolStr>>, pub prosrc: Option<SmolStr>, pub probin: Option<SmolStr>, pub prosqlbody: Option<SmolStr>, pub proconfig: Option<Vec<SmolStr>>, pub proacl: Option<Vec<AclItem<FunctionAclPrivilege>>>, pub description: Option<SmolStr>,
}
Expand description

The DDL-only contents of pg_proc

Fields§

§oid: SmolStr

oid Row identifier

§proname: SmolStr

name Name of the function

§pronamespace: SmolStr

oid (references pg_namespace.oid) The OID of the namespace that contains this function

§proowner: SmolStr

oid (references pg_authid.oid) Owner of the function

§prolang: SmolStr

oid (references pg_language.oid) Implementation language or call interface of this function

§procost: Option<NotNan<f32>>

float4 Estimated execution cost (in units of cpu_operator_cost); if proretset, this is cost per row returned

§prorows: Option<NotNan<f32>>

float4 Estimated number of result rows (zero if not proretset)

§provariadic: Option<SmolStr>

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

§prosupport: Option<SmolStr>

regproc (references pg_proc.oid) Planner support function for this function (see Section 36.11), or zero if none

§prokind: PgProcProkind

char f for a normal function, p for a procedure, a for an aggregate function, or w for a window function

§prosecdef: bool

bool Function is a security definer (i.e., a “setuid” function)

§proleakproof: bool

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.

§proisstrict: bool

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.

§proretset: bool

bool Function returns a set (i.e., multiple values of the specified data type)

§provolatile: PgProcProvolatile

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

§proparallel: PgProcProparallel

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.

§pronargs: u16

int2 Number of input arguments

§pronargdefaults: u16

int2 Number of arguments that have defaults

§prorettype: SmolStr

oid (references pg_type.oid) Data type of the return value

§proargtypes: Vec<SmolStr>§proallargtypes: Option<Vec<SmolStr>>

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.

§proargmodes: Option<Vec<PgProcProargmodes>>

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.

§proargnames: Option<Vec<SmolStr>>

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.

§proargdefaults: Option<Vec<Option<SmolStr>>>

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.

§protrftypes: Option<Vec<SmolStr>>

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.

§prosrc: Option<SmolStr>

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.

§probin: Option<SmolStr>

text Additional information about how to invoke the function. Again, the interpretation is language-specific.

§prosqlbody: Option<SmolStr>

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.

§proconfig: Option<Vec<SmolStr>>

text[] Function’s local settings for run-time configuration variables

§proacl: Option<Vec<AclItem<FunctionAclPrivilege>>>

aclitem[] Access privileges; see Section 5.8 for details

§description: Option<SmolStr>

text The comment from pg_description

Trait Implementations§

Source§

impl Clone for PgProc

Source§

fn clone(&self) -> PgProc

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for PgProc

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result<(), Error>

Formats the value using the given formatter. Read more
Source§

impl<'de> Deserialize<'de> for PgProc

Source§

fn deserialize<__D>( __deserializer: __D, ) -> Result<PgProc, <__D as Deserializer<'de>>::Error>
where __D: Deserializer<'de>,

Deserialize this value from the given Serde deserializer. Read more
Source§

impl Equivalent<PgProc> for SmolStr

Source§

fn equivalent(&self, key: &PgProc) -> bool

Compare self to key and return true if they are equal.
Source§

impl Equivalent<PgProc> for str

Source§

fn equivalent(&self, key: &PgProc) -> bool

Compare self to key and return true if they are equal.
Source§

impl Hash for PgProc

Source§

fn hash<H>(&self, state: &mut H)
where H: Hasher,

Feeds this value into the given Hasher. Read more
1.3.0 · Source§

fn hash_slice<H>(data: &[Self], state: &mut H)
where H: Hasher, Self: Sized,

Feeds a slice of this type into the given Hasher. Read more
Source§

impl PartialEq for PgProc

Source§

fn eq(&self, other: &PgProc) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl Serialize for PgProc

Source§

fn serialize<__S>( &self, __serializer: __S, ) -> Result<<__S as Serializer>::Ok, <__S as Serializer>::Error>
where __S: Serializer,

Serialize this value into the given Serde serializer. Read more
Source§

impl Eq for PgProc

Source§

impl StructuralPartialEq for PgProc

Auto Trait Implementations§

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<Q, K> Equivalent<K> for Q
where Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,

Source§

fn equivalent(&self, key: &K) -> bool

Compare self to key and return true if they are equal.
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,