Expand description
The built-in functions: the input and output functions of the types, and the kernels of the functions, the operators and the casts of pg_proc.
A kernel is found by the prosrc of the function, as the fmgr of PostgreSQL finds the C function of an internal function. Many functions of the same kind, such as the comparisons and the arithmetic of the number types, share one kernel that reads the types of the call. A function that has no kernel here is an error 0A000 when the executor compiles the query, so a query never gives a wrong answer for a function that the engine does not have.
Structs§
- Advisory
Key - The key of an advisory lock, the fields 2 to 4 of its tag: the two halves of a
bigintkey withkind1, or twointegerkeys withkind2. The database of the session is the field 1. - Advisory
Lock - A request for an advisory lock: the key, the mode, which is
ShareLockwhenshareis true andExclusiveLockwhen it is false, and the level, which is the session whensessionis true and the transaction when it is false. - Auth
Match - A match of
auth_search. - Backend
- A row of the table of the sessions,
PgBackendStatus. - Call
- A call of a function.
- Interval
Sum IntervalAggState: the state ofsumandavgofinterval. The infinite values do not count incountandsum.- PathVar
- A value of the
PASSINGclause of a SQL/JSON query function: its name, its type and its value. - Randomness
- The random state of a session: the generator of
random, and the last time ofuuidv7in nanoseconds since 1970-01-01. - Relation
Counts - The counters of a relation in the statistics of the server, the part of
PgStat_StatTabEntrythat rupg keeps. - Sequences
- The cache of the sequences of a session,
seqhashtabandlast_used_seqofsequence.c. - Ssl
- The TLS of a session,
PgBackendSSLStatus. An empty text of the client certificate is null, as for a session with no client certificate. - Writes
- The rows that a transaction inserted, updated and deleted in one relation, as
pgstat_count_heap_insert,pgstat_count_heap_updateandpgstat_count_heap_deletecount them.
Enums§
- Backend
State - The state of a session,
BackendStateofbackend_status.h. - Client
- An end of the connection of a session.
- SqlJson
Item - An item that a SQL/JSON query function finds.
- Xact
State - The state of a transaction for
pg_xact_status, asTransactionIdIsInProgressandTransactionIdDidCommitgive it.
Constants§
- HASH_
PARTITION_ SEED HASH_PARTITION_SEED: the seed of the hashes of the keys ofPARTITION BY HASH.
Traits§
- Session
- The state of the session that the functions read.
Functions§
- auth_
compile regcomp_auth_token: compile a regular expression ofpg_hba.conforpg_ident.confwith the flagsREG_ADVANCED.- auth_
search regexec_auth_token: find the regular expressionpatternofauth_compileins. The result isNonewhen the pattern does not match.- base_
type - The type that holds the values of a type: the base type of a domain, or the type itself.
- char_
to_ encoding pg_char_to_encoding: the number of an encoding name or alias, or -1.- check_
execute - The
EXECUTEchecks ofExecInitFuncandExecInitAgg: an error for the first function that the current user cannot call. A superuser can call each function, and a function that does not exist is not checked. - check_
percentile - The check of a percentile of
percentile_discandpercentile_cont, aspercentile_disc_finalandsetup_pct_infodo it. - check_
permissions ExecCheckPermissions: an error for the first relation that the statement uses without the privileges that it needs. A relation of the query of a view counts as the owner of the view. A superuser has each privilege, and a relation that does not exist is not checked.- compare
- The order of two values that are not null.
leftandrightare their types: abpcharvalue compares without its trailing spaces. - deparse_
constant - The text of a stored constant, as
get_const_exprwithshowtype-1 shows it, for the detail of an error on the bound of a partition. - deparse_
expression deparse_expressionof a stored expression that has no column, such as the default of a domain intypdefault.- deparse_
relation_ expression deparse_expressionof a stored expression of the relationrelid, with the names of its columns, aspg_get_exprgives it. The relation 0 gives an expression with no columns, such as the check of a domain.- describe
getObjectDescriptionwithmissing_ok: the description of the object, orNonewhen it does not exist.- encoding
pg_char_to_encodingwith the name of the encoding: the canonical name of an encoding name or alias, without regard to case and to the characters that are not letters or digits.- encoding_
to_ char pg_encoding_to_char: the name of an encoding by its number, or an empty string for a number that has no encoding.- equal
- True when two values that are not null are equal.
- explain
- The output of
EXPLAINfor a plan, with the names and the expressions that the session shows. - extended_
hash - The extended hash of a value of the type
tywith the seed, as the support function 2 of the default hash operator class of the type gives it. - function_
body - The body of a function in SQL of the catalog of the session, as the analyzer reads it for a call with arguments of the types
inputs, with$1as the first argument.Nonefor a function that is not in the catalog of the session. - hash_
combine64 hash_combine64: the hashrowwith the hashoneadded to it.- index_
key_ columns pg_get_indexdef_columns(oid, true): the key columns and the expressions of the key of an index, as the detail of an error of a duplicate key shows them.- input
- The text input function of the type, with the typmod of the target.
- input_
soft - The text input function of the type, as
InputFunctionCallSafecalls it. The outer error is a hard error, such as a type that has no input function. The inner error is a soft error of the input function for a bad value, whichpg_input_is_validreports as false. The checks of a domain are not part of the input. - input_
supported - True when the engine has the text input function of the type.
- insert_
allowed ExecCheckOneRelPermsforINSERTinto the columnsattnums: true when the role hasINSERTon the table, or on each of the columns. With no columns,INSERTon any column is enough.- interval_
lerp interval_lerpoforderedsetaggs.c: the interval at the fractionpctof the way fromlotohi, forpercentile_cont.- is_json
ExecEvalJsonIsPredicate: true when the value is JSON of the kind of the predicate.base_typeistext,jsonorjsonb. The first token of atextor ajsonvalue gives its kind, and only atextvalue or a check of the keys parses all of the value.- is_
row_ type - True for
recordand for the row type of a system catalog, whichrecord_outandrecord_sendshow. The output of each field needs the output of its type, which the engine checks when it shows the row. - json_
ctor_ array json_build_array_workerandjsonb_build_array_workerforJSON_ARRAY: an array of the values.ABSENT ON NULLskips the null values.- json_
ctor_ object json_build_object_workerandjsonb_build_object_workerforJSON_OBJECT: an object of the keys and the values, one after the other.- json_
ctor_ parse JSONwithWITH UNIQUE KEYS: thejsonorjsonbvalue of a text that has no object with a key two times, asjson_validateandjsonb_from_textcheck it.- json_
ctor_ scalar datum_to_jsonanddatum_to_jsonbforJSON_SCALAR: the JSON value of a SQL value, or null for null.- json_
structured - True when the category of the type is an array or a composite, after which
json_aggputs a new line between the values. - json_
value - The text of a value, as
datum_to_json_internalwrites it. A key is always a string, and a key of an array, a composite or ajsontype is an error. - kernel
- The kernel of the function with this
pg_procOID, orNoneif the engine does not have it. - local_
time - The local time of the session for an instant in microseconds since 2000-01-01 UTC, and the offset east of UTC in seconds of the zone at that instant.
- lock_
table_ allowed LockTableAclCheck: true whenrolecan lock the relationrelidin the lock modemode, whereAccessShareLockis 1.MAINTAIN,UPDATE,DELETEandTRUNCATEallow each mode,SELECTallowsACCESS SHARE, andINSERTallows the modes up toROW EXCLUSIVE.- output
- The text output function of the type.
- output_
supported - True when the engine has the output and the send function of the type.
- partition_
hash compute_partition_hash_value: the hash of the key of a row of a table thatPARTITION BY HASHpartitions. Each value that is not null gets the extended hash of its type with the seedHASH_PARTITION_SEED, andhash_combine64adds it to the hash. A row goes in the partition whose remainder is this hash modulo its modulus.- partition_
key_ columns pg_get_partkeydef_columns(oid, true): the columns and the expressions of the partition key of a partitioned table, with no strategy, collations or operator classes, as the detail of an error of tuple routing shows them.- quote_
identifier quote_identifierofruleutils.c: the name in double quotes unless it is a simple name in lower case that is not a key word, or that is an unreserved key word.- range_
agg range_agg_finalfn: the multirange of the typemultirangethat has the values of the ranges. No range gives null.- receive
- The binary input function of the type.
numberis the number of the parameter, from 1, for the error of bytes that are left over. - sample_
rows BeginSampleScanof the two methods and the choice of the rows: the numbers of the rows, ofcount, that the sample keeps.seedis the value ofREPEATABLE. WithNone, the seed comes frompg_global_prng_state, as intablesample_init.- send
- The binary output function of the type.
- set_
kernel - The set kernel of the function with this
pg_procOID, orNoneif the engine does not have it. - sql_
json_ path executeJsonPathforJSON_EXISTS,JSON_QUERYandJSON_VALUE: whether the path on thejsonbvalue finds an item, and the items whenwantis true. The result isNonefor an error of the path whenthrowis false. The casts of the datetime values can use the zone of the session.- to_text
- The cast of a value to
text: the output function, with the casts ofpg_castthat differ from it.boolgivestrueandfalse, andbpcharloses its trailing spaces. - ts_
config_ setting check_default_text_search_config: the value thatdefault_text_search_configkeeps for the configuration with the name intext. The value is the name with its schema, so a later change ofsearch_pathdoes not change the configuration.Nonewhen no configuration has the name.- type_
error - The error of a type function as the session sends it.
- type_
message_ name format_type_be: the name of a type for a message, with its schema when the search path does not find it.- view_
statement - The text of a
CREATE VIEWstatement that makes the viewnameagain with the query and the names of its columns, aspg_get_viewdef_workergives the query. The catalog keeps the text of a view, and the text names the objects that the query reads, soALTER ... RENAMEwrites the text again from the query of the old names. - with_
datatype errdatatype: the error with the schema and the name of the typetyas the names of its object.- with_
domain_ constraint errdomainconstraint:with_datatypefor the domain and the name of the constraint.- with_
table errtable: the error with the schema and the name of the relationrelas the names of its object. An error for a relation that is not in the catalog does not change.- with_
table_ column errtablecol:with_tableand the name of the column.- with_
table_ constraint errtableconstraint:with_tableand the name of the constraint.- xml_
expr ExecEvalXmlExpr: the value of a SQL/XML function from the values of its named arguments and of its other arguments, in the order ofXmlExpr::children.- xml_
value map_sql_value_to_xml_value: the text of a value that is not null in XML. An array gives anelementfor each element that is not null. Aboolean, a date, a timestamp and abyteahave the forms of XML Schema. The other types give their output, which has the special characters escaped whenescapeis true, except forxml.
Type Aliases§
- Kernel
- The code of a function. It gets the values of the arguments. A strict function does not get a null value, because the executor gives null without the call.
- SetKernel
- The code of a set-returning function. It gets the values of the arguments and gives the rows of the result. A strict function does not get a null value, because the executor gives no rows without the call.