Class PostgresFunctions
PostgreSQL-only SQL surface: arrays, native JSON, the extended scalar library, the
PostgreSQL-only aggregates and the generate_series/unnest table functions.
Exposed through Postgres; every member is gated by a capability flag and
rejected by providers that do not opt in.
public sealed class PostgresFunctions : CommonFunctions
- Inheritance
-
PostgresFunctions
- Inherited Members
- Extension Methods
Methods
acos(double?)
Arccosine.
public double? acos(double? x)
Parameters
xdouble?
Returns
acosd(double?)
Arccosine in degrees (acosd). A NULL argument yields NULL. Gated per name by Supports(string).
public double? acosd(double? x)
Parameters
xdouble?
Returns
acosh(double?)
Inverse hyperbolic cosine.
public double? acosh(double? x)
Parameters
xdouble?
Returns
age(DateTime?, DateTime?)
The interval between two timestamps, subtracting b from
a (age). PostgreSQL's age returns an interval that can
carry whole months, which a TimeSpan cannot represent: on the mapped-column path
the mapper rejects a returned interval with a non-zero month component (either sign) through
InvalidCastException naming calendar months, and a month is never read back as 30
days. A zero-month value converts exactly. Other materialisation paths are not covered.
public TimeSpan? age(DateTime? a, DateTime? b)
Parameters
Returns
all<T>(T, T[])
column = all(array): true when column equals every element of values.
public bool all<T>(T column, T[] values)
Parameters
columnTvaluesT[]
Returns
Type Parameters
T
all<T>(T[])
The all(array) quantifier as the right-hand side of a comparison.
public T all<T>(T[] values)
Parameters
valuesT[]
Returns
- T
Type Parameters
T
any_value<T>(T?)
An arbitrary value of the group (any_value, PostgreSQL 16+). The aggregate's
argument and result are anyelement, so the CLR result type is the argument's own
type; a group whose values are all NULL yields NULL, and — because this is an aggregate —
an empty input still produces one row with NULL. Only single-column CLR types (the
primitives, strings, dates, decimal, Guid, byte
arrays and their nullable forms) can be read back; any other type argument is refused
before SQL is emitted. This is the PostgreSQL 17 any_value pg_proc aggregate,
distinct from the portable any_agg<T>(T?) member, whose
ANY_VALUE/any spellings PostgreSQL does not advertise.
public T? any_value<T>(T? value)
Parameters
valueTThe value to sample.
Returns
- T
Type Parameters
T
any<T>(T, T[])
column = any(array): true when column equals any element of
values. The whole array is bound as a single parameter, so the SQL text
does not depend on the number of elements.
public bool any<T>(T column, T[] values)
Parameters
columnTvaluesT[]
Returns
Type Parameters
T
any<T>(T[])
The any(array) quantifier as the right-hand side of a comparison:
x.Id == SqlFunctions.Sql.any(values) renders id = any(@values).
public T any<T>(T[] values)
Parameters
valuesT[]
Returns
- T
Type Parameters
T
array_agg<T>(T?)
array_agg(value): aggregates the values of a group into an array. Requires a provider
that supports it (see SupportsStringArrayAggregates).
public T[]? array_agg<T>(T? value)
Parameters
valueT
Returns
- T[]
Type Parameters
T
array_agg<T>(T?, Expression<Func<bool>>)
Filtered array_agg(value) filter (where ...).
public T[]? array_agg<T>(T? value, Expression<Func<bool>> filter)
Parameters
valueTfilterExpression<Func<bool>>
Returns
- T[]
Type Parameters
T
array_append<T>(T[], T)
Appends element to array (array_append).
public T[] array_append<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
- T[]
Type Parameters
T
array_cat<T>(T[], T[])
Concatenates two arrays (array_cat).
public T[] array_cat<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
- T[]
Type Parameters
T
array_concat<T>(T[], T[])
array || other: concatenates two arrays.
public T[] array_concat<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
- T[]
Type Parameters
T
array_contained_by<T>(T[], T[])
array <@ other: true when every element of array is contained in other.
public bool array_contained_by<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
Type Parameters
T
array_contains<T>(T[], T[])
array @> other: true when array contains every element of other.
public bool array_contains<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
Type Parameters
T
array_dims<T>(T[])
A textual representation of the array dimensions (for example [1:3]).
public string? array_dims<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
array_fill<T>(T, params int[])
Builds an array filled with value and the given dimensions.
public T[] array_fill<T>(T value, params int[] dimensions)
Parameters
valueTdimensionsint[]
Returns
- T[]
Type Parameters
T
array_length<T>(T[], int)
Length of the dimension of array (1-based), or null.
public int? array_length<T>(T[] array, int dimension)
Parameters
arrayT[]dimensionint
Returns
- int?
Type Parameters
T
array_lower<T>(T[], int)
Lower bound of the dimension of array (1-based).
public int? array_lower<T>(T[] array, int dimension)
Parameters
arrayT[]dimensionint
Returns
- int?
Type Parameters
T
array_ndims<T>(T[])
Number of dimensions of array, or null for an empty array.
public int? array_ndims<T>(T[] array)
Parameters
arrayT[]
Returns
- int?
Type Parameters
T
array_overlaps<T>(T[], T[])
array && other: true when array and other share at least one element.
public bool array_overlaps<T>(T[] array, T[] other)
Parameters
arrayT[]otherT[]
Returns
Type Parameters
T
array_position<T>(T[], T)
One-based position of element in array, or null.
public int? array_position<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
- int?
Type Parameters
T
array_positions<T>(T[], T)
All 1-based positions of element in array.
public int[]? array_positions<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
- int[]
Type Parameters
T
array_prepend<T>(T, T[])
Prepends element to array (array_prepend).
public T[] array_prepend<T>(T element, T[] array)
Parameters
elementTarrayT[]
Returns
- T[]
Type Parameters
T
array_remove<T>(T[], T)
Removes every occurrence of element from array.
public T[] array_remove<T>(T[] array, T element)
Parameters
arrayT[]elementT
Returns
- T[]
Type Parameters
T
array_replace<T>(T[], T, T)
Replaces every occurrence of from in array with to.
public T[] array_replace<T>(T[] array, T from, T to)
Parameters
arrayT[]fromTtoT
Returns
- T[]
Type Parameters
T
array_reverse<T>(T[])
Reverses the elements of array. No current PostgreSQL release provides
array_reverse, so the PostgreSQL provider refuses the call at preparation with
NotSupportedException and never emits the function; no fallback (a
null array or an unchanged array) is substituted.
public T[] array_reverse<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_sample<T>(T[], int)
Returns n randomly selected elements of array (array_sample, PostgreSQL 16+).
public T[] array_sample<T>(T[] array, int n)
Parameters
arrayT[]nint
Returns
- T[]
Type Parameters
T
array_shuffle<T>(T[])
Returns a randomly shuffled copy of array (array_shuffle, PostgreSQL 16+).
public T[] array_shuffle<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_sort<T>(T[])
Sorts the elements of array (array_sort, PostgreSQL 18+). The
PostgreSQL provider renders it only for an explicit server version 18 or later; a version
below 18 and an unset version refuse the call at preparation with
NotSupportedException.
public T[] array_sort<T>(T[] array)
Parameters
arrayT[]
Returns
- T[]
Type Parameters
T
array_to_json<T>(T[])
Converts an array to a JSON array (array_to_json).
public string? array_to_json<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
array_to_string<T>(T[], string)
Joins the elements of array using delimiter.
public string? array_to_string<T>(T[] array, string delimiter)
Parameters
arrayT[]delimiterstring
Returns
Type Parameters
T
array_to_tsvector(string?[])
Builds a tsvector from words (array_to_tsvector). The result is
a tsvector, which the driver reads as text. PostgreSQL refuses an array holding a NULL,
so every element must be a non-NULL lexeme; positions are not assigned.
public string? array_to_tsvector(string?[] words)
Parameters
wordsstring[]The lexemes; an empty array yields an empty
tsvector.
Returns
array_upper<T>(T[], int)
Upper bound of the dimension of array (1-based).
public int? array_upper<T>(T[] array, int dimension)
Parameters
arrayT[]dimensionint
Returns
- int?
Type Parameters
T
asin(double?)
Arcsine. Requires a provider that supports the extended scalar function library.
public double? asin(double? x)
Parameters
xdouble?
Returns
asind(double?)
Arcsine in degrees (asind). A NULL argument yields NULL. Gated per name by Supports(string).
public double? asind(double? x)
Parameters
xdouble?
Returns
asinh(double?)
Inverse hyperbolic sine.
public double? asinh(double? x)
Parameters
xdouble?
Returns
atan(double?)
Arctangent.
public double? atan(double? x)
Parameters
xdouble?
Returns
atan2(double?, double?)
Arctangent of y/x, using the signs of both arguments.
public double? atan2(double? y, double? x)
Parameters
Returns
atan2d(double?, double?)
Arctangent of y/x in degrees, using the signs of both arguments (atan2d). A NULL argument yields NULL.
public double? atan2d(double? y, double? x)
Parameters
Returns
atand(double?)
Arctangent in degrees (atand). A NULL argument yields NULL. Gated per name by Supports(string).
public double? atand(double? x)
Parameters
xdouble?
Returns
atanh(double?)
Inverse hyperbolic tangent.
public double? atanh(double? x)
Parameters
xdouble?
Returns
bit_and<T>(T?)
bit_and(property): the bitwise AND of all non-null values.
public T? bit_and<T>(T? property)
Parameters
propertyT
Returns
- T
Type Parameters
T
bit_count(byte[]?)
The number of set bits in bytes (bit_count(bytea)), as a
bigint. A NULL argument yields NULL. Gated per name by
Supports(string).
public long? bit_count(byte[]? bytes)
Parameters
bytesbyte[]
Returns
- long?
bit_or<T>(T?)
bit_or(property): the bitwise OR of all non-null values.
public T? bit_or<T>(T? property)
Parameters
propertyT
Returns
- T
Type Parameters
T
bit_xor<T>(T?)
bit_xor(property): the bitwise XOR of all non-null values.
public T? bit_xor<T>(T? property)
Parameters
propertyT
Returns
- T
Type Parameters
T
bool_and<T>(T?)
bool_and(property): true when every non-null value is true. Requires a provider that supports it.
public T? bool_and<T>(T? property)
Parameters
propertyT
Returns
- T
Type Parameters
T
bool_or<T>(T?)
bool_or(property): true when at least one non-null value is true.
public T? bool_or<T>(T? property)
Parameters
propertyT
Returns
- T
Type Parameters
T
btrim(byte[]?, byte[]?)
The bytea form of btrim(string?, string?): removes the leading and
trailing bytes that occur in bytesToTrim. A NULL argument yields NULL.
Gated per name by Supports(string).
public byte[]? btrim(byte[]? value, byte[]? bytesToTrim)
Parameters
Returns
- byte[]
btrim(string?)
Removes the longest string containing only whitespace from both ends of
value (btrim, the one-argument form). A NULL argument yields NULL.
Gated per name by Supports(string).
public string? btrim(string? value)
Parameters
valuestring
Returns
btrim(string?, string?)
Removes the longest string containing only the characters of characters
from both ends of value (btrim, two-argument form). The second
argument is a character set, not a substring. A NULL argument yields NULL. Gated per name by
Supports(string).
public string? btrim(string? value, string? characters)
Parameters
Returns
cardinality<T>(T[])
Number of elements in array (cardinality).
public int cardinality<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
casefold(string?)
casefold(text) is refused: it was introduced in PostgreSQL 18 and does not exist on
the pinned 17.11 server (absent from pg_proc; the name fails with 42883), so
any SQL emitted for it would be rejected by the target server.
public string? casefold(string? value)
Parameters
valuestring
Returns
- string
Never returns; the call is refused when the query is translated.
cbrt(double?)
Cube root.
public double? cbrt(double? x)
Parameters
xdouble?
Returns
clock_timestamp()
The actual current time at the instant of the call (clock_timestamp), as a
timestamp with time zone. Unlike statement_timestamp and
transaction_timestamp it advances within a statement. Gated per name by
Supports(string).
public DateTime? clock_timestamp()
Returns
convert_from(byte[]?, string?)
Converts bytes from the named encoding into the database encoding
(convert_from). A value that is not valid in that encoding raises on the server rather
than being replaced. A NULL argument yields NULL. Gated per name by
Supports(string).
public string? convert_from(byte[]? bytes, string? encoding)
Parameters
Returns
convert_to(string?, string?)
Converts value from the database encoding into the named encoding
(convert_to), returning bytea. A NULL argument yields NULL. Gated per name by
Supports(string).
public byte[]? convert_to(string? value, string? encoding)
Parameters
Returns
- byte[]
cosd(double?)
Cosine in degrees (cosd). A NULL argument yields NULL. Gated per name by Supports(string).
public double? cosd(double? x)
Parameters
xdouble?
Returns
cosh(double?)
Hyperbolic cosine.
public double? cosh(double? x)
Parameters
xdouble?
Returns
cotd(double?)
Cotangent in degrees (cotd). A NULL argument yields NULL. Gated per name by Supports(string).
public double? cotd(double? x)
Parameters
xdouble?
Returns
crc32(byte[]?)
crc32(bytea) is refused: it was introduced in PostgreSQL 18 and does not exist on the
pinned 17.11 server (absent from pg_proc; the name fails with 42883), so no SQL
that executes on the target server can be emitted.
public int? crc32(byte[]? bytes)
Parameters
bytesbyte[]
Returns
- int?
Never returns; the call is refused when the query is translated.
crc32c(byte[]?)
crc32c(bytea) is refused for the same reason as crc32(byte[]?): it is a
PostgreSQL 18 function absent from the pinned 17.11 server.
public int? crc32c(byte[]? bytes)
Parameters
bytesbyte[]
Returns
- int?
Never returns; the call is refused when the query is translated.
current_catalog()
The name of the current database (current_catalog), read as a name. A bare SQL
keyword rather than a call, so PostgreSQL renders it unparenthesised; other providers and the
in-memory provider refuse the name.
public string? current_catalog()
Returns
current_date()
The current date.
public DateTime? current_date()
Returns
current_role()
The current role (current_role), normally the session user; the value is read as a
name. A bare SQL keyword rather than a call, so PostgreSQL renders it unparenthesised;
other providers and the in-memory provider refuse the name.
public string? current_role()
Returns
current_schemas(bool?)
The names of the schemas on the search path (current_schemas(include_implicit)), most
significant first; with includeImplicit true the implicit system schemas are
included. The result is a name[], read as a string array. Gated per name
by Supports(string).
public string?[] current_schemas(bool? includeImplicit)
Parameters
includeImplicitbool?
Returns
- string[]
current_setting(string?)
The current value of the run-time setting name (current_setting).
public string? current_setting(string? name)
Parameters
namestring
Returns
current_setting(string?, bool)
The current value of the run-time setting name, or null when it does not
exist if missingOk is true (current_setting(name, missing_ok)).
public string? current_setting(string? name, bool missingOk)
Parameters
Returns
current_time()
The current time of day with time zone.
public TimeSpan? current_time()
Returns
currval(string?)
The current value of sequence for this session (currval).
public long? currval(string? sequence)
Parameters
sequencestring
Returns
- long?
date_bin(string?, DateTime?, DateTime?)
Binaries source into buckets of stride aligned to
origin (date_bin). The stride is an interval literal such as
"15 minutes"; it is cast to interval in SQL.
public DateTime? date_bin(string? stride, DateTime? source, DateTime? origin)
Parameters
Returns
date_subtract(DateTime?, TimeSpan?)
Subtracts interval from value (date_subtract with
timestamp with time zone). The result is a timestamp with time zone; a NULL
argument yields NULL. Gated per name by Supports(string).
public DateTime? date_subtract(DateTime? value, TimeSpan? interval)
Parameters
Returns
date_subtract(DateTime?, TimeSpan?, string?)
Subtracts interval from value in the named
zone (date_subtract(timestamp with time zone, interval, text)). A
NULL argument yields NULL. Gated per name by Supports(string).
public DateTime? date_subtract(DateTime? value, TimeSpan? interval, string? zone)
Parameters
Returns
daterange(DateOnly?, DateOnly?)
Builds daterange(lower, upper) with the default [) bounds.
public Range<DateOnly> daterange(DateOnly? lower, DateOnly? upper)
Parameters
lowerDateOnly?The lower bound, or null for an unbounded side.
upperDateOnly?The upper bound, or null for an unbounded side.
Returns
daterange(DateOnly?, DateOnly?, string)
Builds daterange(lower, upper, bounds).
public Range<DateOnly> daterange(DateOnly? lower, DateOnly? upper, string bounds)
Parameters
lowerDateOnly?The lower bound, or null for an unbounded side.
upperDateOnly?The upper bound, or null for an unbounded side.
boundsstringThe bound characters, for example
[),[],()or(].
Returns
decode(string?, string?)
Decodes the textual value written in format
(decode: base64, hex or escape) back into bytea. Malformed
input raises on the server. A NULL argument yields NULL. Gated per name by
Supports(string).
public byte[]? decode(string? value, string? format)
Parameters
Returns
- byte[]
digest(byte[]?, string?)
The binary hash of the data bytes using the algorithm named by
type. Requires a provider that supports it (see
SupportsCryptoFunctions; PostgreSQL) and the pgcrypto
extension installed on the server.
public byte[]? digest(byte[]? data, string? type)
Parameters
Returns
- byte[]
digest(string?, string?)
The binary hash of data using the algorithm named by
type (md5, sha1, sha224, sha256,
sha384, sha512). Requires a provider that supports it (see
SupportsCryptoFunctions; PostgreSQL) and the pgcrypto
extension installed on the server.
public byte[]? digest(string? data, string? type)
Parameters
Returns
- byte[]
div(decimal?, decimal?)
Integer division truncating toward zero (div(y, x)) on numeric operands, so
div(7, 2) is 3 and div(-7, 2) is -3. Division by zero raises on
the server. A NULL argument yields NULL. Gated per name by
Supports(string).
public decimal? div(decimal? y, decimal? x)
Parameters
Returns
empty_range<T>()
The empty range of T, rendered as the PostgreSQL
'empty'::<range type> literal. When the value is supplied as a parameter, use
Empty instead.
public Range<T> empty_range<T>() where T : struct, IComparable<T>
Returns
- Range<T>
The empty range.
Type Parameters
TThe bound type that selects the PostgreSQL range type.
encode(byte[]?, string?)
Encodes bytes into a textual form named by format
(encode): base64, hex or escape. A NULL argument yields NULL.
Gated per name by Supports(string).
public string? encode(byte[]? bytes, string? format)
Parameters
Returns
erf(double?)
The error function erf(x) of x, in the range -1..1. A NULL argument
yields NULL. Gated per name by Supports(string).
public double? erf(double? x)
Parameters
xdouble?
Returns
erfc(double?)
The complementary error function erfc(x) = 1 - erf(x), in the range 0..2. A
NULL argument yields NULL. Gated per name by Supports(string).
public double? erfc(double? x)
Parameters
xdouble?
Returns
every<T>(T?)
every(property): a synonym of bool_and.
public T? every<T>(T? property)
Parameters
propertyT
Returns
- T
Type Parameters
T
factorial<T>(T?)
The factorial.
public T? factorial<T>(T? n)
Parameters
nT
Returns
- T
Type Parameters
T
format(string?, params object?[])
Formats the arguments with a printf-style format string.
public string? format(string? formatString, params object?[] args)
Parameters
Returns
gamma(double?)
gamma(x) is refused: it does not exist on the pinned PostgreSQL 17.11 server (absent
from pg_proc, absent from the PG17 mathematical-functions table, and the name fails
with 42883), so any SQL emitted for it would be rejected by the target server.
public double? gamma(double? x)
Parameters
xdouble?
Returns
- double?
Never returns; the call is refused when the query is translated.
gcd<T>(T?, T?)
The greatest common divisor.
public T? gcd<T>(T? a, T? b)
Parameters
aTbT
Returns
- T
Type Parameters
T
generate_series(long, long)
generate_series(start, stop) as a FROM source; select
Value. Use through
ctx.From(() => ...).
public TvfEntityBuilder<SqlFunctions.IGenerateSeriesRow> generate_series(long start, long stop)
Parameters
Returns
generate_series(long, long, long)
generate_series(start, stop, step) as a FROM source.
public TvfEntityBuilder<SqlFunctions.IGenerateSeriesRow> generate_series(long start, long stop, long step)
Parameters
Returns
generate_subscripts<T>(T[], int?)
generate_subscripts(array, dimension) as a FROM source: one row per valid subscript of
the requested dimension (see SqlFunctions.IGenerateSubscriptsRow). PostgreSQL
numbers dimensions from one, and an empty or SQL-NULL array yields no rows.
public TvfEntityBuilder<SqlFunctions.IGenerateSubscriptsRow> generate_subscripts<T>(T[] array, int? dimension)
Parameters
arrayT[]The array whose subscripts are generated.
dimensionint?The one-based array dimension.
Returns
Type Parameters
TThe element type of the array.
generate_subscripts<T>(T[], int?, bool?)
generate_subscripts(array, dimension, reverse) as a FROM source: the same subscripts in
descending order when reverse is true.
public TvfEntityBuilder<SqlFunctions.IGenerateSubscriptsRow> generate_subscripts<T>(T[] array, int? dimension, bool? reverse)
Parameters
arrayT[]The array whose subscripts are generated.
dimensionint?The one-based array dimension.
reversebool?Whether to generate the subscripts in descending order; null is not reversed.
Returns
Type Parameters
TThe element type of the array.
get_bit(byte[]?, long?)
The index-th bit of the bytea bytes (0 = least
significant bit of the first byte), as 0 or 1 (get_bit(bytea, bigint)). A NULL or
out-of-range argument raises on the server. Gated per name by
Supports(string).
public int? get_bit(byte[]? bytes, long? index)
Parameters
Returns
- int?
get_byte(byte[]?, int?)
The index-th byte of bytes (0-based), as an integer
(get_byte(bytea, integer)). A NULL or out-of-range argument raises on the server. Gated
per name by Supports(string).
public int? get_byte(byte[]? bytes, int? index)
Parameters
Returns
- int?
get_current_ts_config()
The text-search configuration the current session resolves by default
(get_current_ts_config), e.g. english. The server returns a regconfig,
which the driver reads as text.
public string? get_current_ts_config()
Returns
grouping<T>(T?)
One bit of the super-aggregate identity of the current row (grouping, a parser-level
grouping function with no pg_proc row): 0 when column is
grouped in this row, 1 when the row is a super-aggregate that aggregated it away.
The argument must be a grouping expression of the query's own grouping list — anything else
is 42803 — and the function is only useful with
GROUP BY ROLLUP/CUBE/GROUPING SETS (see GroupByRollup,
GroupByCube and GroupByGroupingSets); in a plain GROUP BY it is legal and
always 0. The zero-argument spelling grouping() is a syntax error
(42601), and the result is integer (read back as int). All
measured on 17.11.
public int? grouping<T>(T? column)
Parameters
columnTA column of the query's grouping list.
Returns
- int?
Type Parameters
T
initcap(string?)
Capitalises the first letter of each word.
public string? initcap(string? value)
Parameters
valuestring
Returns
int4range(int?, int?)
Builds int4range(lower, upper) with the default [) bounds.
public Range<int> int4range(int? lower, int? upper)
Parameters
lowerint?The lower bound, or null for an unbounded side.
upperint?The upper bound, or null for an unbounded side.
Returns
int4range(int?, int?, string)
Builds int4range(lower, upper, bounds).
public Range<int> int4range(int? lower, int? upper, string bounds)
Parameters
lowerint?The lower bound, or null for an unbounded side.
upperint?The upper bound, or null for an unbounded side.
boundsstringThe bound characters, for example
[),[],()or(].
Returns
int8range(long?, long?)
Builds int8range(lower, upper) with the default [) bounds.
public Range<long> int8range(long? lower, long? upper)
Parameters
lowerlong?The lower bound, or null for an unbounded side.
upperlong?The upper bound, or null for an unbounded side.
Returns
int8range(long?, long?, string)
Builds int8range(lower, upper, bounds).
public Range<long> int8range(long? lower, long? upper, string bounds)
Parameters
lowerlong?The lower bound, or null for an unbounded side.
upperlong?The upper bound, or null for an unbounded side.
boundsstringThe bound characters, for example
[),[],()or(].
Returns
isempty<T>(Range<T>)
isempty(range): true when the range contains no point.
public bool isempty<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to test.
Returns
Type Parameters
TThe bound type of the range.
isempty<T>(Range<T>[])
isempty(multirange): true when the multirange contains no range.
public bool isempty<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to test.
Returns
Type Parameters
TThe bound type of the multirange.
isfinite(DateOnly?)
True when the date value is finite — that is, not
infinity/-infinity (isfinite(date)). A NULL argument yields NULL. Gated
per name by Supports(string).
public bool? isfinite(DateOnly? value)
Parameters
valueDateOnly?
Returns
- bool?
isfinite(DateTime?)
True when the timestamp value is finite — that is, not
infinity/-infinity (isfinite(timestamp)). A NULL argument yields NULL.
Gated per name by Supports(string).
public bool? isfinite(DateTime? value)
Parameters
valueDateTime?
Returns
- bool?
isfinite(TimeSpan?)
True when the interval value is finite (isfinite(interval)).
A NULL argument yields NULL. Gated per name by Supports(string).
public bool? isfinite(TimeSpan? value)
Parameters
valueTimeSpan?
Returns
- bool?
json_agg_strict<T>(T?)
Aggregates the values of property into a JSON array, ignoring the NULL
values (json_agg_strict, PostgreSQL 16+). Unlike json_agg a group
whose values are all NULL yields an empty array ([], measured), not an array of nulls;
an empty input still produces one NULL row. The result is json, read back as a string.
public string? json_agg_strict<T>(T? property)
Parameters
propertyTThe value to aggregate.
Returns
Type Parameters
T
json_agg<T>(T?)
Aggregates the values of property into a JSON array (json_agg).
public string? json_agg<T>(T? property)
Parameters
propertyT
Returns
Type Parameters
T
json_array(params object?[])
Builds a JSON array with the SQL/JSON constructor (json_array).
public string json_array(params object?[] values)
Parameters
valuesobject[]
Returns
json_array_elements(string?)
json_array_elements(json) as a FROM source: one row per array element of the json
document, the single value column is the element as a json value (see
SqlFunctions.IJsonArrayElementsRow). The document is a JSON text: the
argument is cast to json in the emitted SQL, because a text parameter does not resolve to
the function. An empty array yields no rows.
public TvfEntityBuilder<SqlFunctions.IJsonArrayElementsRow> json_array_elements(string? json)
Parameters
jsonstring
Returns
json_array_elements_text(string?)
json_array_elements_text(json) as a FROM source: one row per array element, the
value column is text (null for a JSON null element).
public TvfEntityBuilder<SqlFunctions.IJsonArrayElementsRow> json_array_elements_text(string? json)
Parameters
jsonstring
Returns
json_array_length(object?)
Number of elements in a top-level JSON array (json_array_length).
public int? json_array_length(object? json)
Parameters
jsonobject
Returns
- int?
json_arrayagg<T>(T?)
Aggregates the values of a group into a SQL/JSON array (json_arrayagg, PostgreSQL 17+; a
parser-level aggregate construct with no pg_proc row). The emitted form is the plain
json_arrayagg(<arg>), whose measured default is ABSENT ON NULL: NULL values
are dropped, a group whose values are all NULL yields [], and an empty input still
produces one NULL row. The PostgreSQL grammar also accepts
[ORDER BY …] [ABSENT|NULL ON NULL] [RETURNING json|jsonb] inside the call, but the
builder has no clause slot for an aggregate's internal argument list, so those modifiers are
not exposed: RETURNING jsonb has its own member (jsonb_arrayagg<T>(T?)) and
the DISTINCT spelling is a syntax error on 17.11 (42601, measured). The result
is json, read back as a string.
public string? json_arrayagg<T>(T? property)
Parameters
propertyTThe value to aggregate.
Returns
Type Parameters
T
json_build_array(params object?[])
Builds a JSON array from the arguments (json_build_array).
public string json_build_array(params object?[] args)
Parameters
argsobject[]
Returns
json_build_object(params object?[])
Builds a JSON object from alternating key/value arguments (json_build_object).
public string json_build_object(params object?[] args)
Parameters
argsobject[]
Returns
json_cast(object?)
Parses a text value (for example a string parameter) as jsonb:
cast(value as jsonb). Use this when the JSON is supplied as a plain string rather
than as a JsonDocument/JsonElement/JsonNode (which Npgsql already binds
as jsonb).
public string json_cast(object? value)
Parameters
valueobject
Returns
json_concat(object?, object?)
json || other: concatenates two JSON values.
public string? json_concat(object? json, object? other)
Parameters
Returns
json_contains(object?, object?)
json @> other: true when json contains other.
public bool json_contains(object? json, object? other)
Parameters
Returns
json_each(string?)
json_each(json) as a FROM source: one row per top-level object property, the
key (text) and value (a json value) columns (see
SqlFunctions.IJsonbEachRow; PostgreSQL 17 returns exactly two columns). An empty
object yields no rows.
public TvfEntityBuilder<SqlFunctions.IJsonbEachRow> json_each(string? json)
Parameters
jsonstring
Returns
json_each_text(string?)
json_each_text(json) as a FROM source: one row per property, key/value are text.
public TvfEntityBuilder<SqlFunctions.IJsonbEachRow> json_each_text(string? json)
Parameters
jsonstring
Returns
json_exists(object?, string?)
json ? key: true when key exists at the top level of json.
public bool json_exists(object? json, string? key)
Parameters
Returns
json_exists(object?, string?, bool)
SQL/JSON json_exists(json, jsonpath): true when path yields at
least one item. The path is cast to jsonpath. The two-argument
json_exists(object?, string?) is the top-level ? operator, so the
SQL/JSON overload carries an extra discriminator that is not rendered into SQL.
public bool json_exists(object? json, string? path, bool fromJsonPath)
Parameters
jsonobjectThe JSON document.
pathstringThe SQL/JSON path expression.
fromJsonPathboolSelects the SQL/JSON overload; it is not rendered into SQL.
Returns
json_exists_all(object?, string?[])
json ?& keys: true when all of keys exist in json.
public bool json_exists_all(object? json, string?[] keys)
Parameters
Returns
json_exists_any(object?, string?[])
json ?| keys: true when any of keys exists in json.
public bool json_exists_any(object? json, string?[] keys)
Parameters
Returns
json_extract_path(string?, string?[])
json_extract_path(json, path): the json element at the key/index
path. The document is a JSON text (the argument is cast to
json in the emitted SQL); the path is passed to the variadic parameter as one
text[]. An absent path, a JSON null element and a SQL NULL path all yield SQL
NULL; an empty path returns the document itself.
public string? json_extract_path(string? json, string?[] path)
Parameters
Returns
json_extract_path_text(string?, string?[])
json_extract_path_text(json, path): the element at path as text (SQL NULL when absent).
public string? json_extract_path_text(string? json, string?[] path)
Parameters
Returns
json_get(object?, int)
json -> index: the JSON element at the given array index.
public string? json_get(object? json, int index)
Parameters
Returns
json_get(object?, string?)
json -> key: the JSON element for key (or null).
public string? json_get(object? json, string? key)
Parameters
Returns
json_get_path(object?, string?[])
json #> path: the JSON element at path.
public string? json_get_path(object? json, string?[] path)
Parameters
Returns
json_get_path_text(object?, string?[])
json #>> path: the JSON element at path as text.
public string? json_get_path_text(object? json, string?[] path)
Parameters
Returns
json_get_text(object?, int)
json ->> index: the JSON element at the given array index as text.
public string? json_get_text(object? json, int index)
Parameters
Returns
json_get_text(object?, string?)
json ->> key: the JSON element for key as text.
public string? json_get_text(object? json, string? key)
Parameters
Returns
json_object_agg_unique_strict<TKey, TValue>(TKey?, TValue?)
Aggregates the key/value pairs of a group into a JSON object, skipping the pairs whose value is
NULL and rejecting a duplicate key (json_object_agg_unique_strict, PostgreSQL 16+). A
pair whose value is NULL is dropped from the object (measured), a duplicate key (22030)
and a NULL key (22004) raise on execution — both measured on 17.11. An empty input still
produces one NULL row, and the result is json, read back as a string.
public string? json_object_agg_unique_strict<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyThe object key.
valueTValueThe value stored under the key.
Returns
Type Parameters
TKeyTValue
json_object_agg_unique<TKey, TValue>(TKey?, TValue?)
Aggregates the key/value pairs of a group into a JSON object and rejects a duplicate key
(json_object_agg_unique, PostgreSQL 16+). A NULL value is kept as null, while a
duplicate key (22030) and a NULL key (22004) raise on execution — both measured on
17.11. An empty input still produces one NULL row, and the result is json, read back as a
string.
public string? json_object_agg_unique<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyThe object key.
valueTValueThe value stored under the key.
Returns
Type Parameters
TKeyTValue
json_object_agg<TKey, TValue>(TKey?, TValue?)
Aggregates key/value pairs into a JSON object (json_object_agg).
public string? json_object_agg<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyvalueTValue
Returns
Type Parameters
TKeyTValue
json_objectagg_unique<TKey, TValue>(TKey?, TValue?)
Rejects a duplicate key while aggregating the pairs into a SQL/JSON object
(json_objectagg(<key> VALUE <value> WITH UNIQUE KEYS), PostgreSQL 17+;
exposed as json_objectagg_unique for the clause, distinct from the
json_object_agg_unique function). A duplicate key raises 22030 and a NULL key
raises 22004 — both measured on 17.11. A NULL value is kept as JSON null (the
measured default NULL ON NULL), and an empty input yields NULL. The result is
json, read back as a string.
public string? json_objectagg_unique<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyThe object key (any type; PostgreSQL coerces it to text, measured).
valueTValueThe value stored under the key.
Returns
Type Parameters
TKeyTValue
json_objectagg<TKey, TValue>(TKey?, TValue?)
Aggregates the key/value pairs of a group into a SQL/JSON object (json_objectagg,
PostgreSQL 17+; a parser-level aggregate construct with no pg_proc row). The emitted
form is json_objectagg(<key> VALUE <value>): PostgreSQL 17 admits exactly
one pair per call — the comma-separated two-pair form is a syntax error (42601) and the
key : value colon spelling is accepted but not emitted (the VALUE keyword is the
documented spelling). The measured default is NULL ON NULL (a NULL value is kept as
JSON null) and duplicate keys are kept as-is; a NULL key raises 22004, and an
empty input yields NULL. Duplicate-key rejection (22030) is the
WITH UNIQUE KEYS form, exposed as json_objectagg_unique<TKey, TValue>(TKey?, TValue?);
ABSENT ON NULL and [ORDER BY …] are not exposed because the builder has no
clause slot for them. The result is json, read back as a string.
public string? json_objectagg<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyThe object key (any type; PostgreSQL coerces it to text, measured).
valueTValueThe value stored under the key.
Returns
Type Parameters
TKeyTValue
json_populate_record<TRow>(object?, string?, bool?)
json_populate_record(base, json, use_json_as_text) is refused: the first argument is an
anyelement base row whose composite type a CLR type cannot name, so no faithful
call can be built (the column-definition list is available but does not replace the base row).
Referencing this member fails while the query is prepared.
public TvfEntityBuilder<TRow> json_populate_record<TRow>(object? baseRecord, string? json, bool? useJsonAsText)
Parameters
baseRecordobjectThe base row value; a CLR type cannot carry the
anyelementbase.jsonstringThe JSON document to expand.
useJsonAsTextbool?Whether JSON strings are read as text values.
Returns
- TvfEntityBuilder<TRow>
Never returns; the call is refused when the source is composed.
Type Parameters
TRowThe base row type the server would have to infer from the base value.
json_populate_recordset<TRow>(object?, string?, bool?)
json_populate_recordset(base, json, use_json_as_text) is refused for the same reason as
json_populate_record<TRow>(object?, string?, bool?): the anyelement base row
cannot be supplied from a CLR type.
public TvfEntityBuilder<TRow> json_populate_recordset<TRow>(object? baseRecord, string? json, bool? useJsonAsText)
Parameters
baseRecordobjectThe base row value; a CLR type cannot carry the
anyelementbase.jsonstringThe JSON array to expand.
useJsonAsTextbool?Whether JSON strings are read as text values.
Returns
- TvfEntityBuilder<TRow>
Never returns; the call is refused when the source is composed.
Type Parameters
TRowThe base row type the server would have to infer from the base value.
json_query(object?, string?)
SQL/JSON json_query(json, jsonpath): the JSON value selected by path.
The path is cast to jsonpath. This is the SQL/JSON query function, not the
-> operator (json_get(object?, string?)).
public string? json_query(object? json, string? path)
Parameters
Returns
json_scalar<T>(T?)
SQL/JSON json_scalar(value): converts value to a json scalar
(a string becomes a JSON string, a number a JSON number, SQL NULL stays NULL).
A PostgreSQL 17 SQL/JSON constructor: grammar, not a pg_proc function.
public string? json_scalar<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
json_serialize<T>(T?)
SQL/JSON json_serialize(expression FORMAT JSON RETURNING text): parses
value's text as JSON and returns its serialized text. The result is
text, not json — that is the difference from json<T>(T?).
A PostgreSQL 17 SQL/JSON constructor: grammar, not a pg_proc function.
public string? json_serialize<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
json_table<TRow>(string?, string?)
json_table(json, path COLUMNS (...)) is refused: the SQL/JSON table function needs its
per-call COLUMNS (...) clause inside the call parentheses, and the expression model only
renders a caller-declared schema as an alias column-definition list after the alias. The construct
itself works on PostgreSQL 17; only the rendering model cannot express it.
public TvfEntityBuilder<TRow> json_table<TRow>(string? json, string? path)
Parameters
Returns
- TvfEntityBuilder<TRow>
Never returns; the call is refused when the source is composed.
Type Parameters
TRowThe row type the
COLUMNSclause would declare.
json_to_record<TRow>(string?)
json_to_record(json) AS x(col type, ...) as a FROM source: one row from a single
json object, with the result schema derived from TRow's mapped
properties and rendered as the alias column-definition list. The document is a JSON
text (the argument is cast to json in the emitted SQL). Requires a provider that
supports a typed result schema (see SupportsResultSchema(TableFunctionSchema);
PostgreSQL). Use through ctx.From(() => ...).
public TvfEntityBuilder<TRow> json_to_record<TRow>(string? json)
Parameters
jsonstringThe JSON object to expand.
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRowThe caller-declared row shape; its
[Column]names/types form the column list.
json_to_recordset<TRow>(string?)
json_to_recordset(json) AS x(col type, ...) as a FROM source: one row per element of a
json array, with the result schema derived from TRow's mapped
properties. This is the set form of json_to_record<TRow>(string?); an empty array
yields no rows.
public TvfEntityBuilder<TRow> json_to_recordset<TRow>(string? json)
Parameters
jsonstringThe JSON array to expand.
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRowThe caller-declared row shape; its
[Column]names/types form the column list.
json_to_tsvector(string?, string?)
Builds a tsvector from the string and numeric values of the json document that the
filter selects (json_to_tsvector). The filter is a jsonb array
of the strings "string", "numeric", "boolean", "key" and
"all".
public string? json_to_tsvector(string? json, string? filter)
Parameters
Returns
json_to_tsvector(string?, string?, string?)
Builds a tsvector from a json document with an explicit text-search
config (for example english).
public string? json_to_tsvector(string? config, string? json, string? filter)
Parameters
configstringThe text-search configuration name (
regconfig).jsonstringThe JSON document, as text.
filterstringThe
jsonbfilter array, as text.
Returns
json_typeof(object?)
The JSON type of the top-level value (json_typeof).
public string? json_typeof(object? json)
Parameters
jsonobject
Returns
json_value(object?, string?)
SQL/JSON json_value(json, jsonpath): the scalar value selected by path.
The path is cast to jsonpath. This is the SQL/JSON query function, not the
->> operator (json_get_text(object?, string?)).
public string? json_value(object? json, string? path)
Parameters
Returns
json<T>(T?)
SQL/JSON json(expression FORMAT JSON): parses value's text as a JSON
document and returns it as json. The argument is rendered as text
(cast(value as text)) and FORMAT JSON declares it to be JSON text, so an invalid
document is rejected by the server. Distinct from json_scalar<T>(T?), which
converts a value to JSON (a string becomes a JSON string, not a parsed document).
A PostgreSQL 17 SQL/JSON constructor: it is grammar, not a pg_proc function.
public string? json<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
jsonb_agg_strict<T>(T?)
Aggregates the values of property into a JSONB array, ignoring the NULL
values (jsonb_agg_strict, PostgreSQL 16+). A group whose values are all NULL yields an
empty array ([]), an empty input still produces one NULL row, and the result is
jsonb, read back as a string.
public string? jsonb_agg_strict<T>(T? property)
Parameters
propertyTThe value to aggregate.
Returns
Type Parameters
T
jsonb_agg<T>(T?)
Aggregates the values of property into a JSONB array (jsonb_agg).
public string? jsonb_agg<T>(T? property)
Parameters
propertyT
Returns
Type Parameters
T
jsonb_array(params object?[])
Builds a JSONB array with the SQL/JSON constructor
(json_array(... returning jsonb), exposed as jsonb_array).
public string jsonb_array(params object?[] values)
Parameters
valuesobject[]
Returns
jsonb_array_elements(object?)
jsonb_array_elements(json) as a FROM source: one row per array element, the
value column is the element as a jsonb document (see
SqlFunctions.IJsonArrayElementsRow).
public TvfEntityBuilder<SqlFunctions.IJsonArrayElementsRow> jsonb_array_elements(object? json)
Parameters
jsonobject
Returns
jsonb_array_elements_text(object?)
jsonb_array_elements_text(json) as a FROM source: one row per array element, the value column is text.
public TvfEntityBuilder<SqlFunctions.IJsonArrayElementsRow> jsonb_array_elements_text(object? json)
Parameters
jsonobject
Returns
jsonb_array_length(object?)
Number of elements in a top-level JSONB array (jsonb_array_length).
public int? jsonb_array_length(object? json)
Parameters
jsonobject
Returns
- int?
jsonb_arrayagg<T>(T?)
Aggregates the values of a group into a SQL/JSON array of type jsonb
(json_arrayagg(<arg> RETURNING jsonb), PostgreSQL 17+; exposed as
jsonb_arrayagg because PostgreSQL has no jsonb_arrayagg function). The measured
default is ABSENT ON NULL, so a group whose values are all NULL yields [] and an
empty input still produces one NULL row. Read back as a string (measured: Npgsql materialises
the jsonb result as string).
public string? jsonb_arrayagg<T>(T? property)
Parameters
propertyTThe value to aggregate.
Returns
Type Parameters
T
jsonb_build_array(params object?[])
Builds a JSONB array from the arguments (jsonb_build_array).
public string jsonb_build_array(params object?[] args)
Parameters
argsobject[]
Returns
jsonb_build_object(params object?[])
Builds a JSONB object from alternating key/value arguments (jsonb_build_object).
public string jsonb_build_object(params object?[] args)
Parameters
argsobject[]
Returns
jsonb_delete(object?, int)
Deletes the array element at index from json.
public string? jsonb_delete(object? json, int index)
Parameters
Returns
jsonb_delete(object?, string?)
Deletes the object field key from json.
public string? jsonb_delete(object? json, string? key)
Parameters
Returns
jsonb_each(object?)
jsonb_each(json) as a FROM source: one row per top-level object property, the
key/value columns are text/jsonb (see SqlFunctions.IJsonbEachRow).
public TvfEntityBuilder<SqlFunctions.IJsonbEachRow> jsonb_each(object? json)
Parameters
jsonobject
Returns
jsonb_each_text(object?)
jsonb_each_text(json) as a FROM source: one row per property, key/value are text.
public TvfEntityBuilder<SqlFunctions.IJsonbEachRow> jsonb_each_text(object? json)
Parameters
jsonobject
Returns
jsonb_extract_path(string?, string?[])
jsonb_extract_path(json, path): the jsonb element at path (SQL NULL when absent).
public string? jsonb_extract_path(string? json, string?[] path)
Parameters
Returns
jsonb_extract_path_text(string?, string?[])
jsonb_extract_path_text(json, path): the jsonb element at path as text (SQL NULL when absent).
public string? jsonb_extract_path_text(string? json, string?[] path)
Parameters
Returns
jsonb_insert(object?, string?[], object?)
Inserts newValue at path (jsonb_insert), before the target.
public string? jsonb_insert(object? json, string?[] path, object? newValue)
Parameters
Returns
jsonb_insert(object?, string?[], object?, bool)
Inserts newValue at path, optionally after the target.
public string? jsonb_insert(object? json, string?[] path, object? newValue, bool insertAfter)
Parameters
Returns
jsonb_object_agg<TKey, TValue>(TKey?, TValue?)
Aggregates key/value pairs into a JSONB object (jsonb_object_agg).
public string? jsonb_object_agg<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyvalueTValue
Returns
Type Parameters
TKeyTValue
jsonb_object_keys(object?)
jsonb_object_keys(json) as a FROM source: one row per top-level object key (see
SqlFunctions.IJsonObjectKeysRow).
public TvfEntityBuilder<SqlFunctions.IJsonObjectKeysRow> jsonb_object_keys(object? json)
Parameters
jsonobject
Returns
jsonb_objectagg<TKey, TValue>(TKey?, TValue?)
Aggregates the pairs into a SQL/JSON object of type jsonb
(json_objectagg(<key> VALUE <value> RETURNING jsonb), PostgreSQL 17+;
exposed as jsonb_objectagg because no such function exists). The measured defaults are
those of json_objectagg<TKey, TValue>(TKey?, TValue?): NULL ON NULL, duplicate keys kept,
a NULL key raises 22004, and an empty input yields NULL. Read back as a string.
public string? jsonb_objectagg<TKey, TValue>(TKey? key, TValue? value)
Parameters
keyTKeyThe object key (any type; PostgreSQL coerces it to text, measured).
valueTValueThe value stored under the key.
Returns
Type Parameters
TKeyTValue
jsonb_path_exists(object?, string?)
True when path yields any item in json.
public bool jsonb_path_exists(object? json, string? path)
Parameters
Returns
jsonb_path_exists_tz(string?, string?, string?, bool?)
jsonb_path_exists_tz(json, path, vars, silent): true when path selects
any item. The _tz form is required for paths that depend on the session time zone (for
example the .datetime() method); the non-_tz sibling raises an error for them.
public bool? jsonb_path_exists_tz(string? json, string? path, string? vars, bool? silent)
Parameters
Returns
- bool?
jsonb_path_match(object?, string?)
True when path yields a single boolean true in json.
public bool jsonb_path_match(object? json, string? path)
Parameters
Returns
jsonb_path_match_tz(string?, string?, string?, bool?)
jsonb_path_match_tz(json, path, vars, silent): true when path selects a single true (time-zone-aware).
public bool? jsonb_path_match_tz(string? json, string? path, string? vars, bool? silent)
Parameters
Returns
- bool?
jsonb_path_query(object?, string?)
jsonb_path_query(json, path) as a FROM source: one row per JSONPath match. Cast a text
path with jsonpath(string?) (SqlFunctions.IJsonPathQueryRow).
public TvfEntityBuilder<SqlFunctions.IJsonPathQueryRow> jsonb_path_query(object? json, string? path)
Parameters
Returns
jsonb_path_query_array(object?, string?)
All items selected by path as a JSON array.
public string? jsonb_path_query_array(object? json, string? path)
Parameters
Returns
jsonb_path_query_array_tz(string?, string?, string?, bool?)
jsonb_path_query_array_tz(json, path, vars, silent): all matches as a jsonb array (time-zone-aware).
public string? jsonb_path_query_array_tz(string? json, string? path, string? vars, bool? silent)
Parameters
Returns
jsonb_path_query_first(object?, string?)
The first item selected by path, or null.
public string? jsonb_path_query_first(object? json, string? path)
Parameters
Returns
jsonb_path_query_first_tz(string?, string?, string?, bool?)
jsonb_path_query_first_tz(json, path, vars, silent): the first match, or SQL NULL (time-zone-aware).
public string? jsonb_path_query_first_tz(string? json, string? path, string? vars, bool? silent)
Parameters
Returns
jsonb_path_query_tz(string?, string?, string?, bool?)
jsonb_path_query_tz(json, path, vars, silent) as a FROM source: one row per JSONPath
match, the single jsonb_path_query_tz column holds the match as text (see
SqlFunctions.IJsonPathQueryTzRow). The _tz form is required for paths that
depend on the session time zone (for example the .datetime() method); the non-_tz
sibling jsonb_path_query(object?, string?) raises an error for them. No match
yields no rows, and a SQL-NULL document yields no rows.
public TvfEntityBuilder<SqlFunctions.IJsonPathQueryTzRow> jsonb_path_query_tz(string? json, string? path, string? vars, bool? silent)
Parameters
Returns
jsonb_populate_record_valid(object?, string?)
jsonb_populate_record_valid(base, json) is refused: the anyelement base row cannot be
supplied from a CLR type, and without a base row the server cannot determine the row type
(0A000). Referencing this member fails while the query is prepared, before any SQL is emitted.
public bool? jsonb_populate_record_valid(object? baseRecord, string? json)
Parameters
baseRecordobjectThe base row value; a CLR type cannot carry the
anyelementbase.jsonstringThe JSON document to validate.
Returns
- bool?
Never returns; the call is refused when the query is prepared.
jsonb_populate_record<TRow>(object?, string?)
jsonb_populate_record(base, json) is refused: the anyelement base row's composite
type is what the result row carries, and no CLR type can name it.
public TvfEntityBuilder<TRow> jsonb_populate_record<TRow>(object? baseRecord, string? json)
Parameters
baseRecordobjectThe base row value; a CLR type cannot carry the
anyelementbase.jsonstringThe JSON document to expand.
Returns
- TvfEntityBuilder<TRow>
Never returns; the call is refused when the source is composed.
Type Parameters
TRowThe base row type the server would have to infer from the base value.
jsonb_populate_recordset<TRow>(object?, string?)
jsonb_populate_recordset(base, json) is refused for the same reason as
jsonb_populate_record<TRow>(object?, string?): the anyelement base row cannot
be supplied from a CLR type.
public TvfEntityBuilder<TRow> jsonb_populate_recordset<TRow>(object? baseRecord, string? json)
Parameters
baseRecordobjectThe base row value; a CLR type cannot carry the
anyelementbase.jsonstringThe JSON array to expand.
Returns
- TvfEntityBuilder<TRow>
Never returns; the call is refused when the source is composed.
Type Parameters
TRowThe base row type the server would have to infer from the base value.
jsonb_pretty(object?)
Renders json with indentation.
public string? jsonb_pretty(object? json)
Parameters
jsonobject
Returns
jsonb_set(object?, string?[], object?)
Replaces the value at path (jsonb_set), creating it when missing.
public string? jsonb_set(object? json, string?[] path, object? newValue)
Parameters
Returns
jsonb_set(object?, string?[], object?, bool)
Replaces the value at path, optionally creating it when missing.
public string? jsonb_set(object? json, string?[] path, object? newValue, bool createIfMissing)
Parameters
Returns
jsonb_set_lax(string?, string?[], string?, bool?, string?)
jsonb_set_lax(json, path, new_value, create_if_missing, null_value_treatment): replaces
the value at path, with the SQL-NULL newValue handled by
nullValueTreatment (use_json_null, delete_key,
return_target or raise_exception). Both PostgreSQL defaults are exposed as
explicit arguments (createIfMissing = true,
nullValueTreatment = use_json_null) instead of a nullable overload.
public string? jsonb_set_lax(string? json, string?[] path, string? newValue, bool? createIfMissing, string? nullValueTreatment)
Parameters
Returns
jsonb_strip_nulls(object?)
Removes null-valued object fields from json.
public string? jsonb_strip_nulls(object? json)
Parameters
jsonobject
Returns
jsonb_to_record<TRow>(object?)
jsonb_to_record(json) AS x(col type, ...) as a FROM source: one row from a single JSON
object, with the result schema derived from TRow's mapped properties
and rendered as the alias column-definition list. Requires a provider that supports a typed
result schema (see SupportsResultSchema(TableFunctionSchema); PostgreSQL). Use
through
ctx.From(() => ...).
public TvfEntityBuilder<TRow> jsonb_to_record<TRow>(object? json)
Parameters
jsonobjectThe JSON object to expand.
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRowThe caller-declared row shape; its
[Column]names/types form the column list.
jsonb_to_recordset<TRow>(object?)
jsonb_to_recordset(json) AS x(col type, ...) as a FROM source: one row per element of a
JSON array, with the result schema derived from TRow's mapped
properties. This is the set form of jsonb_to_record<TRow>(object?). Requires a
provider that supports a typed result schema (see
SupportsResultSchema(TableFunctionSchema); PostgreSQL).
public TvfEntityBuilder<TRow> jsonb_to_recordset<TRow>(object? json)
Parameters
jsonobjectThe JSON array to expand.
Returns
- TvfEntityBuilder<TRow>
Type Parameters
TRowThe caller-declared row shape; its
[Column]names/types form the column list.
jsonb_to_tsvector(string?, string?)
Builds a tsvector from a jsonb document (jsonb_to_tsvector).
public string? jsonb_to_tsvector(string? json, string? filter)
Parameters
Returns
jsonb_to_tsvector(string?, string?, string?)
Builds a tsvector from a jsonb document with an explicit text-search config.
public string? jsonb_to_tsvector(string? config, string? json, string? filter)
Parameters
configstringThe text-search configuration name (
regconfig).jsonstringThe JSON document, as text.
filterstringThe
jsonbfilter array, as text.
Returns
jsonb_typeof(object?)
The JSONB type of the top-level value (jsonb_typeof).
public string? jsonb_typeof(object? json)
Parameters
jsonobject
Returns
jsonpath(string?)
Casts path to the PostgreSQL jsonpath type
(cast(path as jsonpath)). Use it for the path operand of the JSONPath functions and
the jsonb_path_query(object?, string?) table function, because a text
parameter is not implicitly coerced to jsonpath.
public string? jsonpath(string? path)
Parameters
pathstring
Returns
justify_days(TimeSpan?)
Adjusts an interval so that 30-day units are represented as months, so the returned value can carry a month component: the mapper rejects a non-zero month component (either sign) through InvalidCastException and converts a zero-month result exactly.
public TimeSpan? justify_days(TimeSpan? interval)
Parameters
intervalTimeSpan?
Returns
justify_hours(TimeSpan?)
Adjusts an interval so that 24-hour units are represented as days. The returned interval is subject to the same mapper rule: a non-zero month component (either sign) is rejected through InvalidCastException and a zero-month value converts exactly.
public TimeSpan? justify_hours(TimeSpan? interval)
Parameters
intervalTimeSpan?
Returns
justify_interval(TimeSpan?)
Adjusts an interval so that 24-hour units are represented as days and 30-day units as months
(justify_interval). The returned interval can therefore carry a month component: an
interval with a non-zero month component (either sign) is rejected through
InvalidCastException when materialised as a TimeSpan, and a
zero-month value converts exactly. A NULL argument yields NULL. Gated per name by
Supports(string).
public TimeSpan? justify_interval(TimeSpan? interval)
Parameters
intervalTimeSpan?
Returns
lastval()
The value most recently returned by nextval in this session (lastval).
public long? lastval()
Returns
- long?
lcm<T>(T?, T?)
The least common multiple.
public T? lcm<T>(T? a, T? b)
Parameters
aTbT
Returns
- T
Type Parameters
T
lgamma(double?)
lgamma(x) is refused: it does not exist on the pinned PostgreSQL 17.11 server (absent
from pg_proc and the name fails with 42883), so any SQL emitted for it would be
rejected by the target server.
public double? lgamma(double? x)
Parameters
xdouble?
Returns
- double?
Never returns; the call is refused when the query is translated.
localtime()
The current time of day without time zone.
public TimeSpan? localtime()
Returns
localtimestamp()
The current timestamp without time zone.
public DateTime? localtimestamp()
Returns
log(double?, double?)
The logarithm of x to the given base (two-argument log).
public double? log(double? baseValue, double? x)
Parameters
Returns
lower_inc<T>(Range<T>)
lower_inc(range): true when the lower bound is inclusive.
public bool lower_inc<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to inspect.
Returns
Type Parameters
TThe bound type of the range.
lower_inc<T>(Range<T>[])
lower_inc(multirange): true when the lower bound is inclusive.
public bool lower_inc<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to inspect.
Returns
Type Parameters
TThe bound type of the multirange.
lower_inf<T>(Range<T>)
lower_inf(range): true when the lower side is unbounded.
public bool lower_inf<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to inspect.
Returns
Type Parameters
TThe bound type of the range.
lower_inf<T>(Range<T>[])
lower_inf(multirange): true when the lower side is unbounded.
public bool lower_inf<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to inspect.
Returns
Type Parameters
TThe bound type of the multirange.
lower<T>(Range<T>)
lower(range): the lower bound, or null when it is unbounded.
public T? lower<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to inspect.
Returns
- T?
The lower bound, or null.
Type Parameters
TThe bound type of the range.
lower<T>(Range<T>[])
lower(multirange): the lower bound, or null when it is unbounded.
public T? lower<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to inspect.
Returns
- T?
The lower bound, or null.
Type Parameters
TThe bound type of the multirange.
ltrim(byte[]?, byte[]?)
The bytea form of ltrim(string?, string?): removes the leading bytes
that occur in bytesToTrim. A NULL argument yields NULL. Gated per name by
Supports(string).
public byte[]? ltrim(byte[]? value, byte[]? bytesToTrim)
Parameters
Returns
- byte[]
ltrim(string?, string?)
Removes the longest string containing only the characters of characters
from the start of value (ltrim, two-argument form). The
one-argument form is the built-in TrimStart() translation. A NULL
argument yields NULL. Gated per name by Supports(string).
public string? ltrim(string? value, string? characters)
Parameters
Returns
make_interval(int, int, int, int, int, double)
Builds an interval from its parts. A mapped TimeSpan result is supported only for zero-month values: the mapper rejects a returned interval with a non-zero month component (either sign) through InvalidCastException and converts the zero-month days and microseconds exactly.
public TimeSpan? make_interval(int years, int months, int days, int hours, int minutes, double seconds)
Parameters
Returns
make_time(int, int, double)
Builds a time from its parts (make_time). Use the cross-provider
date_from_parts(int, int, int) for make_date.
public TimeSpan? make_time(int hour, int minute, double second)
Parameters
Returns
make_timestamp(int, int, int, int, int, double)
Builds a timestamp from its parts (make_timestamp).
public DateTime? make_timestamp(int year, int month, int day, int hour, int minute, double second)
Parameters
Returns
make_timestamptz(int?, int?, int?, int?, int?, double?)
Builds a timestamp with time zone from its parts in the session time zone
(make_timestamptz). A NULL argument yields NULL. Gated per name by
Supports(string).
public DateTime? make_timestamptz(int? year, int? month, int? day, int? hour, int? minute, double? second)
Parameters
Returns
make_timestamptz(int?, int?, int?, int?, int?, double?, string?)
Builds a timestamp with time zone from its parts in the named
zone (make_timestamptz(..., timezone text)). A NULL argument yields
NULL. Gated per name by Supports(string).
public DateTime? make_timestamptz(int? year, int? month, int? day, int? hour, int? minute, double? second, string? zone)
Parameters
Returns
md5(string?)
The MD5 hash of value as a hexadecimal string.
public string? md5(string? value)
Parameters
valuestring
Returns
median<T>(Expression<Func<T>>)
percentile_cont(0.5) within group (order by key): the median as the native ordered-set
aggregate (PostgreSQL has no median function of its own). Requires the ordered-set
percentile capability (see SupportsOrderedPercentiles; PostgreSQL) and
a floating-point orderBy expression, because the continuous percentile
interpolates and returns double precision. This is an aggregate: it produces one row per
group, not one value per input row.
public double? median<T>(Expression<Func<T>> orderBy)
Parameters
orderByExpression<Func<T>>The ordering key, written as a lambda closing over the query parameter.
Returns
- double?
The interpolated median, or SQL NULL when the group has no non-null values.
Type Parameters
min_scale(decimal?)
The number of fractional digits that remain after the trailing zeroes of
value are removed (min_scale, PostgreSQL 13+); 12.3400
reports 2. A NULL argument yields NULL. Gated per name by
Supports(string).
public int? min_scale(decimal? value)
Parameters
valuedecimal?
Returns
- int?
mode<T>(Expression<Func<T>>)
mode() within group (order by key): the most frequent value.
public T? mode<T>(Expression<Func<T>> orderBy)
Parameters
orderByExpression<Func<T>>
Returns
- T
Type Parameters
T
multirange<T>(Range<T>)
multirange(range): a multirange containing just the given range.
public Range<T>[] multirange<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to wrap.
Returns
- Range<T>[]
The multirange with a single element.
Type Parameters
TThe bound type of the range.
nextval(string?)
Advances sequence and returns its next value (nextval).
public long? nextval(string? sequence)
Parameters
sequencestring
Returns
- long?
normalize(string?, string?)
The Unicode normalization of value in the form named by
form (normalize): NFC, NFD, NFKC or
NFKD. The form is a grammar keyword in PostgreSQL, not a string value, so it must be a
constant and is rendered unquoted. A NULL argument yields NULL. Gated per name by
Supports(string).
public string? normalize(string? value, string? form)
Parameters
Returns
num_nonnulls(params object?[])
The number of non-null arguments (num_nonnulls).
public int num_nonnulls(params object?[] values)
Parameters
valuesobject[]
Returns
num_nulls(params object?[])
The number of null arguments (num_nulls).
public int num_nulls(params object?[] values)
Parameters
valuesobject[]
Returns
numnode(string?)
The number of lexemes and operators in tsquery (numnode).
public int? numnode(string? tsquery)
Parameters
tsquerystringThe
tsquerytext, for examplea & b.
Returns
- int?
numrange(decimal?, decimal?)
Builds numrange(lower, upper) with the default [) bounds.
public Range<decimal> numrange(decimal? lower, decimal? upper)
Parameters
lowerdecimal?The lower bound, or null for an unbounded side.
upperdecimal?The upper bound, or null for an unbounded side.
Returns
numrange(decimal?, decimal?, string)
Builds numrange(lower, upper, bounds).
public Range<decimal> numrange(decimal? lower, decimal? upper, string bounds)
Parameters
lowerdecimal?The lower bound, or null for an unbounded side.
upperdecimal?The upper bound, or null for an unbounded side.
boundsstringThe bound characters, for example
[),[],()or(].
Returns
overlaps<T>(Range<T>, Range<T>)
a && b: true when the two ranges overlap (share at least one point).
public bool overlaps<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
overlaps<T>(Range<T>, Range<T>[])
range && multirange: true when the range overlaps the multirange.
public bool overlaps<T>(Range<T> a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
overlaps<T>(Range<T>[], Range<T>)
multirange && range: true when the multirange overlaps the range.
public bool overlaps<T>(Range<T>[] a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
overlaps<T>(Range<T>[], Range<T>[])
a && b: true when the two multiranges share at least one point.
public bool overlaps<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
overlay(string?, string?, int, int)
Overlays value with placing starting at from for count characters.
public string? overlay(string? value, string? placing, int from, int count)
Parameters
Returns
parse_ident(string?, bool?)
Splits a qualified identifier into its dot-separated parts (parse_ident), removing the
quoting of each part. With strict true an invalid identifier raises
instead of being truncated after the first error. Returns text[]; a NULL argument
yields NULL. Gated per name by Supports(string).
public string?[] parse_ident(string? value, bool? strict)
Parameters
Returns
- string[]
percentile_cont<T>(double, Expression<Func<T>>)
percentile_cont(fraction) within group (order by key): the interpolated value at
the given fraction. Requires a provider that supports ordered-set aggregates. This is the
ordered-set aggregate; orderBy must be a lambda. The window form is the
separate CommonFunctions.percentile_cont.
public T? percentile_cont<T>(double fraction, Expression<Func<T>> orderBy)
Parameters
fractiondoubleorderByExpression<Func<T>>
Returns
- T
Type Parameters
T
percentile_disc<T>(double, Expression<Func<T>>)
percentile_disc(fraction) within group (order by key): the first value whose position reaches the fraction (ordered-set aggregate; the window form is CommonFunctions.percentile_disc).
public T? percentile_disc<T>(double fraction, Expression<Func<T>> orderBy)
Parameters
fractiondoubleorderByExpression<Func<T>>
Returns
- T
Type Parameters
T
percentile<T>(double, Expression<Func<T>>)
percentile: not supported by PostgreSQL. Its native spellings are the typed
percentile_cont<T>(double, Expression<Func<T>>) and
percentile_disc<T>(double, Expression<Func<T>>) ordered-set aggregates, which
differ in whether the result is interpolated or an input value; a generic alias would hide that
difference. Referencing this member throws NotSupportedException at translation time.
public double? percentile<T>(double fraction, Expression<Func<T>> orderBy)
Parameters
fractiondoubleThe percentile fraction, in
[0, 1].orderByExpression<Func<T>>The ordering key, written as a lambda closing over the query parameter.
Returns
- double?
Never returns; the call is refused when the query is translated.
Type Parameters
TThe sort expression's type.
pg_available_wal_summaries()
pg_available_wal_summaries() as a FROM source: one row per WAL summary file on disk,
with the pg_lsn bounds read as text (see
SqlFunctions.IPgAvailableWalSummaryRow). Empty while
summarize_wal is off.
public TvfEntityBuilder<SqlFunctions.IPgAvailableWalSummaryRow> pg_available_wal_summaries()
Returns
pg_basetype(string?)
The base type of type (pg_basetype(regtype)) in its text form, e.g.
integer for integer and integer[] for an integer array; an unknown type
name raises a server error. The regtype result is cast to text because the driver
cannot read a regtype. Gated per name by Supports(string).
public string? pg_basetype(string? type)
Parameters
typestring
Returns
pg_blocking_pids(int?)
The process IDs of the sessions holding a lock that blocks the session
pid (pg_blocking_pids(pid)); an empty array when nothing blocks it.
Gated per name by Supports(string).
public int[]? pg_blocking_pids(int? pid)
Parameters
pidint?
Returns
- int[]
pg_char_to_encoding(string?)
The numeric code of the encoding called name
(pg_char_to_encoding(name)), or -1 when the name is not a known encoding.
Gated per name by Supports(string).
public int? pg_char_to_encoding(string? name)
Parameters
namestring
Returns
- int?
pg_collation_is_visible(string?)
Whether the collation with the given oid is visible in the current search
path (pg_collation_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_collation_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_conf_load_time()
The time the configuration files were last loaded (pg_conf_load_time()). Gated per name
by Supports(string).
public DateTime? pg_conf_load_time()
Returns
pg_control_checkpoint()
pg_control_checkpoint() as a FROM source: the single checkpoint-state row; the
pg_lsn/oid columns are text and the xid columns are uint
(see SqlFunctions.IPgControlCheckpointRow).
public TvfEntityBuilder<SqlFunctions.IPgControlCheckpointRow> pg_control_checkpoint()
Returns
pg_control_init()
pg_control_init() as a FROM source: the single row of compile-time and control-file
constants (see SqlFunctions.IPgControlInitRow).
public TvfEntityBuilder<SqlFunctions.IPgControlInitRow> pg_control_init()
Returns
pg_control_recovery()
pg_control_recovery() as a FROM source: the single recovery-state row; the
pg_lsn columns are text (see SqlFunctions.IPgControlRecoveryRow).
public TvfEntityBuilder<SqlFunctions.IPgControlRecoveryRow> pg_control_recovery()
Returns
pg_control_system()
pg_control_system() as a FROM source: the single control-file row (see
SqlFunctions.IPgControlSystemRow).
public TvfEntityBuilder<SqlFunctions.IPgControlSystemRow> pg_control_system()
Returns
pg_conversion_is_visible(string?)
Whether the encoding conversion with the given oid is visible in the current search
path (pg_conversion_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_conversion_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_current_logfile()
The path of the current log file for the default (stderr) log format
(pg_current_logfile()), or NULL when the server does not collect logs. Gated per name
by Supports(string).
public string? pg_current_logfile()
Returns
pg_current_logfile(string?)
The path of the current log file for the log format named format
(pg_current_logfile(format)): stderr, csvlog or jsonlog; any other
format raises an error and an uncollected format yields NULL. Gated per name by
Supports(string).
public string? pg_current_logfile(string? format)
Parameters
formatstring
Returns
pg_current_snapshot()
The current transaction snapshot (pg_current_snapshot()) in its textual form, e.g.
100:104:100,102; read as text because the driver cannot read a pg_snapshot. The
value can be passed back to pg_snapshot_xmax, pg_snapshot_xmin and
pg_visible_in_snapshot, which accept this textual form.
Gated per name by Supports(string).
public string? pg_current_snapshot()
Returns
pg_current_xact_id()
The current transaction id (pg_current_xact_id()) in its textual form; read as text
because the driver cannot read an xid8. A write transaction is assigned one lazily, so
this form assigns one. Gated per name by Supports(string).
public string? pg_current_xact_id()
Returns
pg_current_xact_id_if_assigned()
The transaction id already assigned to the current transaction, or NULL when none is
(pg_current_xact_id_if_assigned()), in its textual form; read as text because the driver
cannot read an xid8. Unlike pg_current_xact_id() it assigns nothing. Gated
per name by Supports(string).
public string? pg_current_xact_id_if_assigned()
Returns
pg_describe_object(string?, string?, int?)
A human-readable description of a catalog object
(pg_describe_object(classid, objid, objsubid)), e.g. table pg_class; NULL when
the OIDs name no object. Both OIDs are passed in their text form. Gated per name by
Supports(string).
public string? pg_describe_object(string? classOid, string? objectOid, int? objectSubId)
Parameters
Returns
pg_encoding_to_char(int?)
The canonical name of the encoding with the given code
(pg_encoding_to_char(code)); code 0 is SQL_ASCII, and an unknown code
yields the empty string. Gated per name by Supports(string).
public string? pg_encoding_to_char(int? code)
Parameters
codeint?
Returns
pg_function_is_visible(string?)
Whether the function or procedure with the given oid is visible in the current search
path (pg_function_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_function_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_get_catalog_foreign_keys()
pg_get_catalog_foreign_keys() as a FROM source: one row per catalog foreign-key
relationship, with both regclass columns read as text and both column lists as
text[] (see SqlFunctions.IPgCatalogForeignKeyRow).
public TvfEntityBuilder<SqlFunctions.IPgCatalogForeignKeyRow> pg_get_catalog_foreign_keys()
Returns
pg_get_constraintdef(string?)
The definition of the constraint with the given constraintOid
(pg_get_constraintdef(oid)). Refused together with pg_get_expr(object?, string?):
both render a stored node tree as SQL text, and the node-tree argument of pg_get_expr
cannot be called at all, because PostgreSQL requires a pg_node_tree argument and a value
of that type cannot be produced from CLR (cannot accept a value of type pg_node_tree).
Read the constraint text from pg_constraint.conbin through a raw command instead.
public string? pg_get_constraintdef(string? constraintOid)
Parameters
constraintOidstring
Returns
- string
Never returns; the call is refused when the query is translated.
pg_get_constraintdef(string?, bool?)
The definition of the constraint with the given constraintOid, pretty-printed
when pretty is true (pg_get_constraintdef(oid, boolean)). Refused with
pg_get_constraintdef(string?).
public string? pg_get_constraintdef(string? constraintOid, bool? pretty)
Parameters
Returns
- string
Never returns; the call is refused when the query is translated.
pg_get_expr(object?, string?)
The expression stored in a pg_node_tree
(pg_get_expr(pg_node_tree, oid)). Refused: PostgreSQL requires a pg_node_tree
argument and a value of that type cannot be produced from CLR — the pinned 17.11 server answers
cannot accept a value of type pg_node_tree. There is no CLR type that can carry the
stored tree, so no form of this function can ever be prepared.
public string? pg_get_expr(object? nodeTree, string? relationOid)
Parameters
Returns
- string
Never returns; the call is refused when the query is translated.
pg_get_expr(object?, string?, bool?)
The expression stored in a pg_node_tree, pretty-printed when
pretty is true (pg_get_expr(pg_node_tree, oid, boolean)). Refused with
pg_get_expr(object?, string?).
public string? pg_get_expr(object? nodeTree, string? relationOid, bool? pretty)
Parameters
Returns
- string
Never returns; the call is refused when the query is translated.
pg_get_function_arguments(string?)
The argument list of the function with the given functionOid
(pg_get_function_arguments(oid)), with argument names and defaults; the empty string for a
function without arguments. The OID is passed in its text form. Gated per name by
Supports(string).
public string? pg_get_function_arguments(string? functionOid)
Parameters
functionOidstring
Returns
pg_get_function_identity_arguments(string?)
The identity argument list of the function with the given functionOid
(pg_get_function_identity_arguments(oid)), without names and defaults; the form used to
identify the function in ALTER/DROP. The OID is passed in its text form. Gated per
name by Supports(string).
public string? pg_get_function_identity_arguments(string? functionOid)
Parameters
functionOidstring
Returns
pg_get_function_result(string?)
The result type of the function with the given functionOid
(pg_get_function_result(oid)), e.g. integer or TABLE(...). The OID is passed
in its text form. Gated per name by Supports(string).
public string? pg_get_function_result(string? functionOid)
Parameters
functionOidstring
Returns
pg_get_functiondef(string?)
The complete CREATE OR REPLACE FUNCTION statement of the function with the given
functionOid (pg_get_functiondef(oid)); an aggregate or a window
function is an error. The OID is passed in its text form. Gated per name by
Supports(string).
public string? pg_get_functiondef(string? functionOid)
Parameters
functionOidstring
Returns
pg_get_indexdef(string?)
The CREATE INDEX statement of the index with the given indexOid
(pg_get_indexdef(oid)). The OID is passed in its text form. Gated per name by
Supports(string).
public string? pg_get_indexdef(string? indexOid)
Parameters
indexOidstring
Returns
pg_get_indexdef(string?, int?, bool?)
The definition of one index column of the index with the given indexOid
(pg_get_indexdef(oid, integer, boolean)); an out-of-range column is an error. The OID is
passed in its text form. Gated per name by Supports(string).
public string? pg_get_indexdef(string? indexOid, int? columnNumber, bool? pretty)
Parameters
Returns
pg_get_keywords()
pg_get_keywords() as a FROM source: one row per SQL keyword or keyword-like token;
the "char" category code is read as text (see
SqlFunctions.IPgKeywordRow).
public TvfEntityBuilder<SqlFunctions.IPgKeywordRow> pg_get_keywords()
Returns
pg_get_multixact_members(uint?)
pg_get_multixact_members(multixactid) as a FROM source: one row per transaction that
is a member of the multixact, with its lock mode (see
SqlFunctions.IPgMultixactMemberRow).
public TvfEntityBuilder<SqlFunctions.IPgMultixactMemberRow> pg_get_multixact_members(uint? multixactId)
Parameters
multixactIduint?
Returns
pg_get_object_address(string?, string?[], string?[])
pg_get_object_address(type, object_names, object_args) as a FROM source: the catalog
coordinates of the described object, with both OIDs read as text (see
SqlFunctions.IPgObjectAddressRow).
public TvfEntityBuilder<SqlFunctions.IPgObjectAddressRow> pg_get_object_address(string? type, string?[] objectNames, string?[] objectArgs)
Parameters
Returns
pg_get_partition_constraintdef(string?)
The FOR VALUES clause of the partition bound of the relation with the given
relationOid (pg_get_partition_constraintdef(oid)); an error when the
relation is not a partition. The OID is passed in its text form. Gated per name by
Supports(string).
public string? pg_get_partition_constraintdef(string? relationOid)
Parameters
relationOidstring
Returns
pg_get_partkeydef(string?)
The partition key of the partitioned table with the given relationOid
(pg_get_partkeydef(oid)), e.g. RANGE (id); an error when the relation is not
partitioned. The OID is passed in its text form. Gated per name by
Supports(string).
public string? pg_get_partkeydef(string? relationOid)
Parameters
relationOidstring
Returns
pg_get_ruledef(string?)
The CREATE RULE statement of the rule with the given ruleOid
(pg_get_ruledef(oid)). The OID is passed in its text form. Gated per name by
Supports(string).
public string? pg_get_ruledef(string? ruleOid)
Parameters
ruleOidstring
Returns
pg_get_ruledef(string?, bool?)
The CREATE RULE statement of the rule with the given ruleOid,
pretty-printed when pretty is true (pg_get_ruledef(oid, boolean)). The
OID is passed in its text form. Gated per name by Supports(string).
public string? pg_get_ruledef(string? ruleOid, bool? pretty)
Parameters
Returns
pg_get_serial_sequence(string?, string?)
The sequence owned by a serial or identity column
(pg_get_serial_sequence(table, column)), or NULL when the column has none; an unknown
column is an error. Gated per name by Supports(string).
public string? pg_get_serial_sequence(string? table, string? column)
Parameters
Returns
pg_get_statisticsobjdef(string?)
The CREATE STATISTICS statement of the extended statistics object with the given
statisticsOid (pg_get_statisticsobjdef(oid)). The OID is passed in its
text form. Gated per name by Supports(string).
public string? pg_get_statisticsobjdef(string? statisticsOid)
Parameters
statisticsOidstring
Returns
pg_get_triggerdef(string?)
The CREATE TRIGGER statement of the trigger with the given triggerOid
(pg_get_triggerdef(oid)). The OID is passed in its text form. Gated per name by
Supports(string).
public string? pg_get_triggerdef(string? triggerOid)
Parameters
triggerOidstring
Returns
pg_get_triggerdef(string?, bool?)
The CREATE TRIGGER statement of the trigger with the given triggerOid,
pretty-printed when pretty is true (pg_get_triggerdef(oid, boolean)).
The OID is passed in its text form. Gated per name by Supports(string).
public string? pg_get_triggerdef(string? triggerOid, bool? pretty)
Parameters
Returns
pg_get_userbyid(string?)
The name of the role with the given roleOid (pg_get_userbyid(oid)), or
unknown (OID=N) when no role has that OID. The OID is passed in its text form. Gated per
name by Supports(string).
public string? pg_get_userbyid(string? roleOid)
Parameters
roleOidstring
Returns
pg_get_viewdef(string?)
The reconstructed SELECT of the view named view
(pg_get_viewdef(text)), where the argument is a view name or a numeric OID in text form
(rendered through a to_regclass cast; an unknown name yields NULL). Gated per name by
Supports(string).
public string? pg_get_viewdef(string? view)
Parameters
viewstring
Returns
pg_get_viewdef(string?, bool?)
The reconstructed SELECT of the view named view, pretty-printed when
pretty is true (pg_get_viewdef(text, boolean)); the name or OID goes
through a to_regclass cast. Gated per name by Supports(string).
public string? pg_get_viewdef(string? view, bool? pretty)
Parameters
Returns
pg_get_viewdef(string?, int?)
The reconstructed SELECT of the view with the given viewOid
(pg_get_viewdef(oid, integer)), pretty-printed when pretty is true.
The OID is passed in its text form (to_regclass). Gated per name by
Supports(string).
public string? pg_get_viewdef(string? viewOid, int? pretty)
Parameters
Returns
pg_get_wal_summarizer_state()
pg_get_wal_summarizer_state() as a FROM source: the single WAL summarizer state row,
with the pg_lsn columns read as text (see
SqlFunctions.IPgWalSummarizerStateRow).
public TvfEntityBuilder<SqlFunctions.IPgWalSummarizerStateRow> pg_get_wal_summarizer_state()
Returns
pg_has_role(string?, string?)
Whether the current user has the privilege privilege on the role
role (pg_has_role(name, text)); the role may also be given as a numeric
OID in text form (pg_has_role(oid, text)), since it is rendered through a regrole
cast. Gated per name by Supports(string).
public bool? pg_has_role(string? role, string? privilege)
Parameters
Returns
- bool?
pg_has_role(string?, string?, string?)
Whether the current user has privilege on role, with
membership naming the membership to check
(pg_has_role(name, name, text)); either role may be a numeric OID in text form, since both
are rendered through a regrole cast. Gated per name by
Supports(string).
public bool? pg_has_role(string? role, string? membership, string? privilege)
Parameters
Returns
- bool?
pg_identify_object(string?, string?, int?)
pg_identify_object(classid, objid, objsubid) as a FROM source: the type, schema, name
and identity of one catalog object (see SqlFunctions.IPgIdentifyObjectRow). An
object that does not exist yields one all-NULL row.
public TvfEntityBuilder<SqlFunctions.IPgIdentifyObjectRow> pg_identify_object(string? classId, string? objectId, int? objectSubId)
Parameters
Returns
pg_identify_object_as_address(string?, string?, int?)
pg_identify_object_as_address(classid, objid, objsubid) as a FROM source: the
machine-readable address of one catalog object, both components as text[] (see
SqlFunctions.IPgIdentifyObjectAddressRow).
public TvfEntityBuilder<SqlFunctions.IPgIdentifyObjectAddressRow> pg_identify_object_as_address(string? classId, string? objectId, int? objectSubId)
Parameters
Returns
pg_index_column_has_property(string?, int?, string?)
Whether the index column has the named property
(pg_index_column_has_property(index, column, property)), e.g. orderable; NULL
when the property is not recognised. The index is a regclass name or a numeric OID in
text form. Gated per name by Supports(string).
public bool? pg_index_column_has_property(string? index, int? columnNumber, string? property)
Parameters
Returns
- bool?
pg_index_has_property(string?, string?)
Whether the index has the named property (pg_index_has_property(index, property)), e.g.
clusterable; NULL when the property is not recognised. The index is a regclass
name or a numeric OID in text form. Gated per name by Supports(string).
public bool? pg_index_has_property(string? index, string? property)
Parameters
Returns
- bool?
pg_indexam_has_property(string?, string?)
Whether the index access method has the named property
(pg_indexam_has_property(amoid, property)), e.g. can_order; NULL when the
property is not recognised. The access-method OID is passed in its text form. Gated per name
by Supports(string).
public bool? pg_indexam_has_property(string? accessMethodOid, string? property)
Parameters
Returns
- bool?
pg_input_error_info(string?, string?)
pg_input_error_info(value, type_name) as a FROM source: the soft error report of parsing
value as typeName. A valid value yields one all-NULL row;
an invalid value yields the message and SQLSTATE (see
SqlFunctions.IPgInputErrorInfoRow).
public TvfEntityBuilder<SqlFunctions.IPgInputErrorInfoRow> pg_input_error_info(string? value, string? typeName)
Parameters
Returns
pg_input_is_valid(string?, string?)
Whether value is valid input for the type typeName
(pg_input_is_valid(value, type)), without raising an error; an unknown type name is
still an error. Gated per name by Supports(string).
public bool? pg_input_is_valid(string? value, string? typeName)
Parameters
Returns
- bool?
pg_is_other_temp_schema(string?)
Whether the temporary schema identified by schemaOid belongs to another
session (pg_is_other_temp_schema(oid)). Gated per name by
Supports(string).
public bool? pg_is_other_temp_schema(string? schemaOid)
Parameters
schemaOidstring
Returns
- bool?
pg_jit_available()
Whether JIT compilation is available in this server process (pg_jit_available()).
Gated per name by Supports(string).
public bool? pg_jit_available()
Returns
- bool?
pg_last_committed_xact()
pg_last_committed_xact() as a FROM source: the last transaction with a commit
timestamp, or no row when none is recorded (see
SqlFunctions.IPgCommittedXactRow).
public TvfEntityBuilder<SqlFunctions.IPgCommittedXactRow> pg_last_committed_xact()
Returns
pg_listening_channels()
pg_listening_channels() as a FROM source: one row per channel this session is
listening on (see SqlFunctions.IListeningChannelRow). The set is empty until a
LISTEN is issued on the same connection.
public TvfEntityBuilder<SqlFunctions.IListeningChannelRow> pg_listening_channels()
Returns
pg_my_temp_schema()
The OID of this session's temporary schema, or 0 when none was created
(pg_my_temp_schema()); the OID is read as its text form. Gated per name by
Supports(string).
public string? pg_my_temp_schema()
Returns
pg_notification_queue_usage()
The fraction of the asynchronous notification queue currently in use, between 0 and 1
(pg_notification_queue_usage()). Gated per name by
Supports(string).
public double? pg_notification_queue_usage()
Returns
pg_opclass_is_visible(string?)
Whether the operator class with the given oid is visible in the current search
path (pg_opclass_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_opclass_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_operator_is_visible(string?)
Whether the operator with the given oid is visible in the current search
path (pg_operator_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_operator_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_opfamily_is_visible(string?)
Whether the operator family with the given oid is visible in the current search
path (pg_opfamily_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_opfamily_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_options_to_table(string?[])
pg_options_to_table(options) as a FROM source: one row per name=value storage
option, split into option_name/option_value (see
SqlFunctions.IPgOptionRow).
public TvfEntityBuilder<SqlFunctions.IPgOptionRow> pg_options_to_table(string?[] options)
Parameters
optionsstring[]
Returns
pg_postmaster_start_time()
The time the postmaster started (pg_postmaster_start_time()), as
timestamp with time zone. Gated per name by Supports(string).
public DateTime? pg_postmaster_start_time()
Returns
pg_safe_snapshot_blocking_pids(int?)
The process IDs of the sessions holding a safe-snapshot conflict that blocks the session
pid (pg_safe_snapshot_blocking_pids(pid)). Gated per name by
Supports(string).
public int[]? pg_safe_snapshot_blocking_pids(int? pid)
Parameters
pidint?
Returns
- int[]
pg_settings_get_flags(string?)
The flags of the run-time setting setting
(pg_settings_get_flags(setting)), e.g. EXPLAIN; an empty array when it has none
and NULL for an unknown setting. Gated per name by Supports(string).
public string?[] pg_settings_get_flags(string? setting)
Parameters
settingstring
Returns
- string[]
pg_sleep(double?)
pg_sleep(seconds) is refused: it returns void, and the expression model has no
void-typed projection, so no faithful result type exists. Declaring any CLR result would
return a value the server never sends; the call is refused while the query is translated and
no SQL is emitted.
public void pg_sleep(double? seconds)
Parameters
secondsdouble?
pg_sleep_for(TimeSpan?)
pg_sleep_for(interval) is refused for the same reason as pg_sleep(double?):
it returns void, so there is no faithful expression result.
public void pg_sleep_for(TimeSpan? interval)
Parameters
intervalTimeSpan?
pg_sleep_until(DateTime?)
pg_sleep_until(timestamp with time zone) is refused for the same reason as
pg_sleep(double?): it returns void, so there is no faithful expression
result.
public void pg_sleep_until(DateTime? target)
Parameters
targetDateTime?
pg_snapshot_xip(string?)
pg_snapshot_xip(snapshot) as a FROM source: one row per in-progress transaction id of
the snapshot, read as text (see SqlFunctions.ISnapshotXipRow).
public TvfEntityBuilder<SqlFunctions.ISnapshotXipRow> pg_snapshot_xip(string? snapshot)
Parameters
snapshotstring
Returns
pg_snapshot_xmax(string?)
The highest transaction id of the snapshot snapshot
(pg_snapshot_xmax(pg_snapshot)) in its textual form; the snapshot is the text produced by
pg_current_snapshot(). The xid8 result is read as text because the driver
cannot read it. Gated per name by Supports(string).
public string? pg_snapshot_xmax(string? snapshot)
Parameters
snapshotstring
Returns
pg_snapshot_xmin(string?)
The lowest transaction id still in progress in the snapshot snapshot
(pg_snapshot_xmin(pg_snapshot)) in its textual form; the xid8 result is read as
text because the driver cannot read it. Gated per name by
Supports(string).
public string? pg_snapshot_xmin(string? snapshot)
Parameters
snapshotstring
Returns
pg_statistics_obj_is_visible(string?)
Whether the extended statistics object with the given oid is visible in the current search
path (pg_statistics_obj_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_statistics_obj_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_table_is_visible(string?)
Whether the table, view or other relation with the given oid is visible in the current search
path (pg_table_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_table_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_tablespace_databases(string?)
pg_tablespace_databases(oid) as a FROM source: one row per database that has files in
the tablespace, with the database OID read as text (see
SqlFunctions.ITablespaceDatabaseRow).
public TvfEntityBuilder<SqlFunctions.ITablespaceDatabaseRow> pg_tablespace_databases(string? tablespaceOid)
Parameters
tablespaceOidstring
Returns
pg_tablespace_location(string?)
The file-system location of the tablespace with the given oid
(pg_tablespace_location(oid)); the empty string for the default tablespace. The OID is
passed in its text form. Gated per name by Supports(string).
public string? pg_tablespace_location(string? oid)
Parameters
oidstring
Returns
pg_trigger_depth()
The current nesting depth of trigger execution (pg_trigger_depth()), zero outside a
trigger. Gated per name by Supports(string).
public int? pg_trigger_depth()
Returns
- int?
pg_ts_config_is_visible(string?)
Whether the text-search configuration with the given oid is visible in the current search
path (pg_ts_config_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_ts_config_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_ts_dict_is_visible(string?)
Whether the text-search dictionary with the given oid is visible in the current search
path (pg_ts_dict_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_ts_dict_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_ts_parser_is_visible(string?)
Whether the text-search parser with the given oid is visible in the current search
path (pg_ts_parser_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_ts_parser_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_ts_template_is_visible(string?)
Whether the text-search template with the given oid is visible in the current search
path (pg_ts_template_is_visible(oid)); NULL when the OID names no such object. The OID is passed in its
text form. Gated per name by Supports(string).
public bool? pg_ts_template_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_type_is_visible(string?)
Whether the data type with the given oid is visible in the current search
path (pg_type_is_visible(oid)); NULL when the OID names no type. The OID is passed in
its text form. Gated per name by Supports(string).
public bool? pg_type_is_visible(string? oid)
Parameters
oidstring
Returns
- bool?
pg_typeof(object?)
The type name of value (pg_typeof).
public string? pg_typeof(object? value)
Parameters
valueobject
Returns
pg_visible_in_snapshot(string?, string?)
Whether the transaction xid is visible in snapshot
(pg_visible_in_snapshot(xid8, pg_snapshot)); both arguments are the textual forms.
Gated per name by Supports(string).
public bool? pg_visible_in_snapshot(string? xid, string? snapshot)
Parameters
Returns
- bool?
pg_wal_summary_contents(long?, string?, string?)
pg_wal_summary_contents(tli, start_lsn, end_lsn) as a FROM source: one block range of the
WAL summary file that covers the requested range, with the oid columns read as text (see
SqlFunctions.IPgWalSummaryContentRow).
public TvfEntityBuilder<SqlFunctions.IPgWalSummaryContentRow> pg_wal_summary_contents(long? timelineId, string? startLsn, string? endLsn)
Parameters
Returns
pg_xact_commit_timestamp(string?)
The commit time of the transaction xid (pg_xact_commit_timestamp(xid)).
The time exists only for a transaction that committed while track_commit_timestamp was
enabled (a restart-only setting); otherwise the server raises SQLSTATE 55000
(could not get commit timestamp data). The xid argument is passed in its numeric
text form (the driver cannot bind an xid, and PostgreSQL has no integer-to-xid cast).
Gated per name by Supports(string).
public DateTime? pg_xact_commit_timestamp(string? xid)
Parameters
xidstring
Returns
pg_xact_commit_timestamp_origin(uint?)
pg_xact_commit_timestamp_origin(xid) as a FROM source: the commit timestamp of one
transaction and its replication origin, with roident read as text (see
SqlFunctions.IPgXactCommitOriginRow). Requires track_commit_timestamp.
public TvfEntityBuilder<SqlFunctions.IPgXactCommitOriginRow> pg_xact_commit_timestamp_origin(uint? xid)
Parameters
xiduint?
Returns
pg_xact_status(string?)
The status of the transaction xid
(pg_xact_status(xid8)): in progress, committed, aborted or
subcommitted. Gated per name by Supports(string).
public string? pg_xact_status(string? xid)
Parameters
xidstring
Returns
phraseto_tsquery(string)
Parses query into a tsquery, keeping phrase order (phraseto_tsquery).
public string? phraseto_tsquery(string query)
Parameters
querystringThe phrase query.
Returns
plainto_tsquery(string)
Parses query into a tsquery, treating it as plain text (plainto_tsquery).
public string? plainto_tsquery(string query)
Parameters
querystringThe plain-text query.
Returns
querytree(string?)
The query tree of tsquery as text (querytree), with the operators and
the grouping the parser produced, for example 'b' & 'a'.
public string? querytree(string? tsquery)
Parameters
tsquerystringThe
tsquerytext.
Returns
quote_ident(string?)
Quotes value as an SQL identifier, adding double quotes only when required
(quote_ident): a b becomes "a b", test stays unquoted. A NULL
argument yields NULL. Gated per name by Supports(string).
public string? quote_ident(string? value)
Parameters
valuestring
Returns
quote_literal(string?)
Quotes value as an SQL string literal, doubling embedded single quotes and
prefixing a backslash-containing value with E (quote_literal, the text
overload). A NULL argument yields NULL — use
quote_nullable(string?) to obtain the NULL keyword. Gated per name by
Supports(string).
public string? quote_literal(string? value)
Parameters
valuestring
Returns
quote_nullable(string?)
Like quote_literal(string?), but a NULL argument yields the four-character text
NULL instead of NULL (quote_nullable, the text overload). Gated per name
by Supports(string).
public string? quote_nullable(string? value)
Parameters
valuestring
Returns
random()
A pseudo-random value in the range 0.0 <= x < 1.0.
public double? random()
Returns
random_normal(double?, double?)
A normally distributed random value with the given mean and
stddev (random_normal); the result is volatile, so the same query
returns a different value on every execution. A NULL argument yields NULL. Gated per name by
Supports(string).
public double? random_normal(double? mean, double? stddev)
Parameters
Returns
range_adjacent<T>(Range<T>, Range<T>)
a -|- b: true when the ranges are adjacent (they touch but do not overlap).
public bool range_adjacent<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_adjacent<T>(Range<T>[], Range<T>[])
a -|- b: true when the multiranges are adjacent.
public bool range_adjacent<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_agg<T>(Range<T>)
range_agg(value): the multirange of all ranges in the group.
public Range<T>[] range_agg<T>(Range<T> value) where T : struct, IComparable<T>
Parameters
valueRange<T>The range to aggregate.
Returns
- Range<T>[]
The aggregated multirange.
Type Parameters
TThe bound type of the ranges.
range_contained_by<T>(Range<T>, Range<T>)
inner <@ outer: true when every point of inner is inside outer.
public bool range_contained_by<T>(Range<T> inner, Range<T> outer) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contained_by<T>(Range<T>, Range<T>[])
range <@ multirange: true when the range is contained by the multirange.
public bool range_contained_by<T>(Range<T> inner, Range<T>[] outer) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contained_by<T>(Range<T>[], Range<T>)
multirange <@ range: true when the multirange is contained by the range.
public bool range_contained_by<T>(Range<T>[] inner, Range<T> outer) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contained_by<T>(Range<T>[], Range<T>[])
multirange <@ multirange: true when the first multirange is contained by the second.
public bool range_contained_by<T>(Range<T>[] inner, Range<T>[] outer) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contains<T>(Range<T>, Range<T>)
outer @> inner: true when outer contains every point of inner.
public bool range_contains<T>(Range<T> outer, Range<T> inner) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contains<T>(Range<T>, Range<T>[])
range @> multirange: true when the range contains the multirange.
public bool range_contains<T>(Range<T> outer, Range<T>[] inner) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contains<T>(Range<T>, T)
range @> value: true when value is inside range.
public bool range_contains<T>(Range<T> range, T value) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to test.
valueTThe point to look for.
Returns
Type Parameters
TThe bound type of the range.
range_contains<T>(Range<T>[], Range<T>)
multirange @> range: true when the multirange contains the range.
public bool range_contains<T>(Range<T>[] outer, Range<T> inner) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contains<T>(Range<T>[], Range<T>[])
multirange @> multirange: true when the first multirange contains the second.
public bool range_contains<T>(Range<T>[] outer, Range<T>[] inner) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_contains<T>(Range<T>[], T)
multirange @> value: true when the multirange contains the element.
public bool range_contains<T>(Range<T>[] multirange, T value) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to test.
valueTThe point to look for.
Returns
Type Parameters
TThe bound type of the ranges.
range_difference<T>(Range<T>, Range<T>)
a - b: the part of a not covered by b.
public Range<T> range_difference<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
- Range<T>
The difference range.
Type Parameters
TThe bound type of the ranges.
range_difference<T>(Range<T>[], Range<T>[])
a - b: the multirange difference.
public Range<T>[] range_difference<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
- Range<T>[]
The difference multirange.
Type Parameters
TThe bound type of the ranges.
range_intersect_agg<T>(Range<T>)
range_intersect_agg(value): the intersection of all ranges in the group.
public Range<T> range_intersect_agg<T>(Range<T> value) where T : struct, IComparable<T>
Parameters
valueRange<T>The range to aggregate.
Returns
- Range<T>
The intersection of every range in the group.
Type Parameters
TThe bound type of the ranges.
range_intersection<T>(Range<T>, Range<T>)
a * b: the common part of the two ranges, or the empty range.
public Range<T> range_intersection<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
- Range<T>
The intersection range.
Type Parameters
TThe bound type of the ranges.
range_intersection<T>(Range<T>[], Range<T>[])
a * b: the multirange intersection.
public Range<T>[] range_intersection<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
- Range<T>[]
The intersection multirange.
Type Parameters
TThe bound type of the ranges.
range_merge<T>(Range<T>, Range<T>)
range_merge(a, b): the smallest range that includes both ranges.
public Range<T> range_merge<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
- Range<T>
The smallest range covering both operands.
Type Parameters
TThe bound type of the ranges.
range_merge<T>(Range<T>[])
range_merge(multirange): the smallest range that includes the whole multirange.
public Range<T> range_merge<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to merge.
Returns
- Range<T>
The smallest range covering the multirange.
Type Parameters
TThe bound type of the multirange.
range_not_extend_left_of<T>(Range<T>, Range<T>)
a &> b: true when a does not extend to the left of b.
public bool range_not_extend_left_of<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_not_extend_left_of<T>(Range<T>[], Range<T>[])
a &> b: true when the first multirange does not extend to the left of the second.
public bool range_not_extend_left_of<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_not_extend_right_of<T>(Range<T>, Range<T>)
a &< b: true when a does not extend to the right of b.
public bool range_not_extend_right_of<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_not_extend_right_of<T>(Range<T>[], Range<T>[])
a &< b: true when the first multirange does not extend to the right of the second.
public bool range_not_extend_right_of<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_strictly_left_of<T>(Range<T>, Range<T>)
a << b: true when a ends before b starts.
public bool range_strictly_left_of<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_strictly_left_of<T>(Range<T>[], Range<T>[])
a << b: true when the first multirange is strictly left of the second.
public bool range_strictly_left_of<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_strictly_right_of<T>(Range<T>, Range<T>)
a >> b: true when a starts after b ends.
public bool range_strictly_right_of<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_strictly_right_of<T>(Range<T>[], Range<T>[])
a >> b: true when the first multirange is strictly right of the second.
public bool range_strictly_right_of<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
Type Parameters
TThe bound type of the ranges.
range_union<T>(Range<T>, Range<T>)
a + b: the smallest range covering both operands (they must overlap or be adjacent).
public Range<T> range_union<T>(Range<T> a, Range<T> b) where T : struct, IComparable<T>
Parameters
Returns
- Range<T>
The union range.
Type Parameters
TThe bound type of the ranges.
range_union<T>(Range<T>[], Range<T>[])
a + b: the multirange union (the operands need not overlap).
public Range<T>[] range_union<T>(Range<T>[] a, Range<T>[] b) where T : struct, IComparable<T>
Parameters
Returns
- Range<T>[]
The union multirange.
Type Parameters
TThe bound type of the ranges.
regexp_count(string?, string?)
The number of matches of a POSIX regular expression in value.
public int? regexp_count(string? value, string? pattern)
Parameters
Returns
- int?
regexp_instr(string?, string?)
The 1-based position of the first match of a POSIX regular expression in value.
public int? regexp_instr(string? value, string? pattern)
Parameters
Returns
- int?
regexp_like(string?, string?)
True when value matches the POSIX regular expression.
public bool regexp_like(string? value, string? pattern)
Parameters
Returns
regexp_like(string?, string?, string?)
True when value matches the POSIX regular expression with flags.
public bool regexp_like(string? value, string? pattern, string? flags)
Parameters
Returns
regexp_match(string?, string?)
The first POSIX regular-expression match of pattern in
value as a text[] of its captured groups — the whole match when the
pattern has no groups. A pattern with no match returns null (not an empty
array), and a NULL argument yields NULL. Gated per name by
Supports(string).
public string?[] regexp_match(string? value, string? pattern)
Parameters
Returns
- string[]
regexp_match(string?, string?, string?)
regexp_match(value, pattern, flags): the first match with the given
g/i/n/p/w/x flags. A pattern with no match returns
null, and a NULL argument yields NULL. Gated per name by
Supports(string).
public string?[] regexp_match(string? value, string? pattern, string? flags)
Parameters
Returns
- string[]
regexp_matches(string?, string?)
regexp_matches(source, pattern) as a FROM source: one row per match, the
regexp_matches column is the text[] array of captured groups (see
SqlFunctions.IRegexpMatchesRow).
public TvfEntityBuilder<SqlFunctions.IRegexpMatchesRow> regexp_matches(string? source, string? pattern)
Parameters
Returns
regexp_matches(string?, string?, string?)
regexp_matches(source, pattern, flags) as a FROM source, with the g/i/... flags.
public TvfEntityBuilder<SqlFunctions.IRegexpMatchesRow> regexp_matches(string? source, string? pattern, string? flags)
Parameters
Returns
regexp_replace(string?, string?, string?)
Replaces the matches of a POSIX regular expression.
public string? regexp_replace(string? value, string? pattern, string? replacement)
Parameters
Returns
regexp_replace(string?, string?, string?, string?)
Replaces the matches of a POSIX regular expression with flags.
public string? regexp_replace(string? value, string? pattern, string? replacement, string? flags)
Parameters
Returns
regexp_split_to_array(string?, string?)
Splits value on a POSIX regular expression into an array.
public string[]? regexp_split_to_array(string? value, string? pattern)
Parameters
Returns
- string[]
regexp_split_to_table(string?, string?)
regexp_split_to_table(source, pattern) as a FROM source: one row per fragment (see
SqlFunctions.IRegexpSplitToTableRow).
public TvfEntityBuilder<SqlFunctions.IRegexpSplitToTableRow> regexp_split_to_table(string? source, string? pattern)
Parameters
Returns
regexp_split_to_table(string?, string?, string?)
regexp_split_to_table(source, pattern, flags) as a FROM source.
public TvfEntityBuilder<SqlFunctions.IRegexpSplitToTableRow> regexp_split_to_table(string? source, string? pattern, string? flags)
Parameters
Returns
regexp_substr(string?, string?)
The substring matched by the first POSIX regular expression match in value (regexp_substr).
public string? regexp_substr(string? value, string? pattern)
Parameters
Returns
regexp_substr(string?, string?, string?)
The substring matched by the first POSIX regular expression match in value with flags.
public string? regexp_substr(string? value, string? pattern, string? flags)
Parameters
Returns
regr_avgx<TY, TX>(TY?, TX?)
regr_avgx(Y, X): the average of the independent variable.
public double? regr_avgx<TY, TX>(TY? y, TX? x)
Parameters
yTYxTX
Returns
Type Parameters
TYTX
regr_avgy<TY, TX>(TY?, TX?)
regr_avgy(Y, X): the average of the dependent variable.
public double? regr_avgy<TY, TX>(TY? y, TX? x)
Parameters
yTYxTX
Returns
Type Parameters
TYTX
regr_count<TY, TX>(TY?, TX?)
regr_count(Y, X): the number of input rows where both arguments are non-null.
public double? regr_count<TY, TX>(TY? y, TX? x)
Parameters
yTYxTX
Returns
Type Parameters
TYTX
regr_intercept<TY, TX>(TY?, TX?)
regr_intercept(Y, X): the y-intercept of the least-squares fit.
public double? regr_intercept<TY, TX>(TY? y, TX? x)
Parameters
yTYxTX
Returns
Type Parameters
TYTX
regr_r2<TY, TX>(TY?, TX?)
regr_r2(Y, X): the coefficient of determination.
public double? regr_r2<TY, TX>(TY? y, TX? x)
Parameters
yTYxTX
Returns
Type Parameters
TYTX
regr_slope<TY, TX>(TY?, TX?)
regr_slope(Y, X): the slope of the least-squares fit.
public double? regr_slope<TY, TX>(TY? y, TX? x)
Parameters
yTYxTX
Returns
Type Parameters
TYTX
regr_sxx<TY, TX>(TY?, TX?)
The sum of squares of the independent variable (regr_sxx), sum(X^2) - sum(X)^2/N
over the (Y, X) pairs in which both arguments are non-null. A group with no such pair, and
an empty input, yield NULL; a single pair yields 0.
public double? regr_sxx<TY, TX>(TY? y, TX? x)
Parameters
yTYThe dependent variable.
xTXThe independent variable.
Returns
Type Parameters
TYTX
regr_sxy<TY, TX>(TY?, TX?)
The sum of products of the independent and dependent variables (regr_sxy),
sum(X*Y) - sum(X)*sum(Y)/N over the pairs in which both arguments are non-null. A
group with no such pair, and an empty input, yield NULL.
public double? regr_sxy<TY, TX>(TY? y, TX? x)
Parameters
yTYThe dependent variable.
xTXThe independent variable.
Returns
Type Parameters
TYTX
regr_syy<TY, TX>(TY?, TX?)
The sum of squares of the dependent variable (regr_syy), sum(Y^2) - sum(Y)^2/N
over the (Y, X) pairs in which both arguments are non-null. A group with no such pair, and
an empty input, yield NULL; a single pair yields 0.
public double? regr_syy<TY, TX>(TY? y, TX? x)
Parameters
yTYThe dependent variable.
xTXThe independent variable.
Returns
Type Parameters
TYTX
row_to_json<T>(T?)
Converts a row value to JSON (row_to_json).
public string? row_to_json<T>(T? row)
Parameters
rowT
Returns
Type Parameters
T
rtrim(byte[]?, byte[]?)
The bytea form of rtrim(string?, string?): removes the trailing bytes
that occur in bytesToTrim. A NULL argument yields NULL. Gated per name by
Supports(string).
public byte[]? rtrim(byte[]? value, byte[]? bytesToTrim)
Parameters
Returns
- byte[]
rtrim(string?, string?)
Removes the longest string containing only the characters of characters
from the end of value (rtrim, two-argument form). The
one-argument form is the built-in TrimEnd() translation. A NULL
argument yields NULL. Gated per name by Supports(string).
public string? rtrim(string? value, string? characters)
Parameters
Returns
scale(decimal?)
The number of decimal digits in the fractional part of value
(scale, PostgreSQL). Trailing zeroes count, so 12.3400 has scale 4. A NULL
argument yields NULL. Gated per name by Supports(string).
public int? scale(decimal? value)
Parameters
valuedecimal?
Returns
- int?
set_bit(byte[]?, long?, int?)
bytes with its index-th bit set to
value (0 or 1), returning bytea
(set_bit(bytea, bigint, integer)). Gated per name by
Supports(string).
public byte[]? set_bit(byte[]? bytes, long? index, int? value)
Parameters
Returns
- byte[]
set_byte(byte[]?, int?, int?)
bytes with its index-th byte replaced by
value, returning bytea (set_byte(bytea, integer, integer)).
Gated per name by Supports(string).
public byte[]? set_byte(byte[]? bytes, int? index, int? value)
Parameters
Returns
- byte[]
set_config(string?, string?, bool)
Sets the run-time setting name to value (set_config).
public string? set_config(string? name, string? value, bool isLocal)
Parameters
Returns
setseed(double?)
Sets the seed for subsequent random() calls in the session (setseed).
Requires a provider that supports it (see SupportsRandomSeed;
PostgreSQL only). PostgreSQL's setseed returns void, so the projected value is
always null; the call is made for its side effect.
public double? setseed(double? seed)
Parameters
seeddouble?
Returns
- double?
Always
null, because PostgreSQL'ssetseedreturnsvoid.
setval(string?, long)
Sets the current value of sequence (setval).
public long? setval(string? sequence, long value)
Parameters
Returns
- long?
setweight(string?, string?)
Assigns the weight weight to every lexeme of tsvector
(setweight). The result is a tsvector, which the driver reads as text.
public string? setweight(string? tsvector, string? weight)
Parameters
tsvectorstringThe
tsvectortext.weightstringOne of
A,B,CorD; the server rejects anything else.
Returns
setweight(string?, string?, string?[])
Assigns the weight weight only to the lexemes listed in
lexemes (setweight); the remaining lexemes keep their weights.
public string? setweight(string? tsvector, string? weight, string?[] lexemes)
Parameters
tsvectorstringThe
tsvectortext.weightstringOne of
A,B,CorD.lexemesstring[]The lexemes whose weight changes; a NULL element, an empty array and a lexeme absent from
tsvectorall leave the vector unchanged (measured on 17.11).
Returns
sha224(byte[]?)
The SHA-224 hash of data as a bytea (sha224). Requires a
provider that supports it (see SupportsCryptoFunctions;
PostgreSQL, where this is a core binary-string function).
public byte[]? sha224(byte[]? data)
Parameters
databyte[]
Returns
- byte[]
sha256(byte[]?)
The SHA-256 hash of data as a bytea (sha256). Requires a
provider that supports it (see SupportsCryptoFunctions;
PostgreSQL, where this is a core binary-string function).
public byte[]? sha256(byte[]? data)
Parameters
databyte[]
Returns
- byte[]
sha384(byte[]?)
The SHA-384 hash of data as a bytea (sha384). Requires a
provider that supports it (see SupportsCryptoFunctions;
PostgreSQL, where this is a core binary-string function).
public byte[]? sha384(byte[]? data)
Parameters
databyte[]
Returns
- byte[]
sha512(byte[]?)
The SHA-512 hash of data as a bytea (sha512). Requires a
provider that supports it (see SupportsCryptoFunctions;
PostgreSQL, where this is a core binary-string function).
public byte[]? sha512(byte[]? data)
Parameters
databyte[]
Returns
- byte[]
sind(double?)
Sine in degrees (sind). A NULL argument yields NULL. Gated per name by Supports(string).
public double? sind(double? x)
Parameters
xdouble?
Returns
sinh(double?)
Hyperbolic sine.
public double? sinh(double? x)
Parameters
xdouble?
Returns
split_part(string?, string?, int)
Splits value on delimiter and returns the field-th part (1-based).
public string? split_part(string? value, string? delimiter, int field)
Parameters
Returns
starts_with(string?, string?)
True when value begins with prefix (starts_with,
collation-aware, case-sensitive unless the collation says otherwise). A NULL argument yields
NULL. Gated per name by Supports(string).
public bool? starts_with(string? value, string? prefix)
Parameters
Returns
- bool?
statement_timestamp()
The time at which the current statement started (statement_timestamp), as a
timestamp with time zone. Gated per name by Supports(string).
public DateTime? statement_timestamp()
Returns
string_to_array(string?, string?)
Splits value on delimiter into an array.
public string[]? string_to_array(string? value, string? delimiter)
Parameters
Returns
- string[]
string_to_table(string?, string?)
Splits value on the delimiter string and returns one
row per fragment (string_to_table), select
Value. Use through ctx.From(() => ...).
public TvfEntityBuilder<SqlFunctions.IStringToTableRow> string_to_table(string? value, string? delimiter)
Parameters
Returns
string_to_table(string?, string?, string?)
string_to_table(value, delimiter, null_string): fragments equal to
nullString become NULL rows; the other fragments are unchanged. Use through
ctx.From(() => ...).
public TvfEntityBuilder<SqlFunctions.IStringToTableRow> string_to_table(string? value, string? delimiter, string? nullString)
Parameters
Returns
strip(string?)
Removes the positions and weights of tsvector, leaving only the lexemes
(strip).
public string? strip(string? tsvector)
Parameters
tsvectorstringThe
tsvectortext.
Returns
strpos(string?, string?)
The 1-based position of substring in value.
public int? strpos(string? value, string? substring)
Parameters
Returns
- int?
tand(double?)
Tangent in degrees (tand). A NULL argument yields NULL. Gated per name by Supports(string).
public double? tand(double? x)
Parameters
xdouble?
Returns
tanh(double?)
Hyperbolic tangent.
public double? tanh(double? x)
Parameters
xdouble?
Returns
tgamma(double?)
tgamma(x) is refused: it does not exist on the pinned PostgreSQL 17.11 server (absent
from pg_proc and the name fails with 42883), so any SQL emitted for it would be
rejected by the target server.
public double? tgamma(double? x)
Parameters
xdouble?
Returns
- double?
Never returns; the call is refused when the query is translated.
timeofday()
The current date and time as text, including the time zone abbreviation
(timeofday, for example Tue Oct 27 22:21:04.335170 2026 UTC). Gated per name by
Supports(string).
public string? timeofday()
Returns
timezone(string?, DateTime?)
Converts value to the given time zone.
public DateTime? timezone(string? zone, DateTime? value)
Parameters
Returns
to_ascii(string?)
The one-argument to_ascii(text) is refused: it takes the source encoding from the
database encoding, and PostgreSQL 17 supports the conversion only from LATIN1,
LATIN2, LATIN9 and WIN1250. The pinned fixture database is UTF8, so the
form raises 0A000 even for ASCII-only input. Use
to_ascii(string?, string?) or to_ascii(string?, int) with an
explicit encoding instead.
public string? to_ascii(string? value)
Parameters
valuestring
Returns
- string
Never returns; the call is refused when the query is translated.
to_ascii(string?, int)
to_ascii(value, encoding) with the encoding given as its numeric code — the
identifier reported by pg_encoding_to_char (8 = LATIN1, 9 =
LATIN2, 16 = LATIN9, 29 = WIN1250). This is the documented
to_ascii(text, integer) overload. The code is validated by the server when the command
runs, so an unknown code raises 42704 instead of being refused while the query is
prepared. A NULL argument yields NULL. Gated per name by
Supports(string).
public string? to_ascii(string? value, int encoding)
Parameters
Returns
to_ascii(string?, string?)
to_ascii(value, encoding) with the encoding named as text (for example
LATIN1). A NULL argument yields NULL. Gated per name by
Supports(string).
public string? to_ascii(string? value, string? encoding)
Parameters
Returns
to_bin(int?)
The binary representation of value (to_bin). A NULL argument yields NULL.
public string? to_bin(int? value)
Parameters
valueint?
Returns
to_bin(long?)
The binary representation of the 64-bit value (to_bin). A NULL argument yields NULL.
public string? to_bin(long? value)
Parameters
valuelong?
Returns
to_char(DateTime?, string?)
Formats a timestamp with a template.
public string? to_char(DateTime? value, string? formatString)
Parameters
Returns
to_char(decimal?, string?)
Formats a number with a template.
public string? to_char(decimal? value, string? formatString)
Parameters
Returns
to_date(string?, string?)
Parses a date from text using a template.
public DateTime? to_date(string? text, string? formatString)
Parameters
Returns
to_hex(int?)
The hexadecimal representation of value (to_hex); negative values
keep the two's-complement sign, so -1 is ffffffff. A NULL argument yields NULL.
Gated per name by Supports(string).
public string? to_hex(int? value)
Parameters
valueint?
Returns
to_hex(long?)
The hexadecimal representation of the 64-bit value (to_hex). A NULL argument yields NULL.
public string? to_hex(long? value)
Parameters
valuelong?
Returns
to_json<T>(T?)
Converts a SQL value to json (to_json).
public string to_json<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_jsonb<T>(T?)
Converts a SQL value to jsonb (to_jsonb).
public string to_jsonb<T>(T? value)
Parameters
valueT
Returns
Type Parameters
T
to_number(string?, string?)
Parses a number from text using a template.
public decimal? to_number(string? text, string? formatString)
Parameters
Returns
to_oct(int?)
The octal representation of value (to_oct). A NULL argument yields NULL.
public string? to_oct(int? value)
Parameters
valueint?
Returns
to_oct(long?)
The octal representation of the 64-bit value (to_oct). A NULL argument yields NULL.
public string? to_oct(long? value)
Parameters
valuelong?
Returns
to_timestamp(double?)
Converts a Unix epoch to a timestamp.
public DateTime? to_timestamp(double? epoch)
Parameters
epochdouble?
Returns
to_timestamp(string?, string?)
Parses a timestamp from text using a template.
public DateTime? to_timestamp(string? text, string? formatString)
Parameters
Returns
to_tsquery(string)
Parses query into a tsquery (to_tsquery); the terms must
already be joined by the &/|/! operators.
public string? to_tsquery(string query)
Parameters
querystringThe query text, with explicit operators.
Returns
to_tsvector(string)
Converts document to a tsvector (to_tsvector). Part of the
PostgreSQL native text-search surface (see SupportsTextSearchFunctions).
Both tsvector and tsquery are represented as string on the CLR side.
public string? to_tsvector(string document)
Parameters
documentstringThe text to convert.
Returns
transaction_timestamp()
The time at which the current transaction started (transaction_timestamp), as a
timestamp with time zone. Gated per name by Supports(string).
public DateTime? transaction_timestamp()
Returns
trim_array<T>(T[], int?)
Removes the last n elements of a one-dimensional array
(trim_array), keeping the element type. PostgreSQL raises an error when
n is greater than the array length, and only one-dimensional arrays are
accepted; a SQL-NULL array stays NULL.
public T[] trim_array<T>(T[] array, int? n)
Parameters
arrayT[]nint?
Returns
- T[]
Type Parameters
T
trim_scale(decimal?)
value with its trailing fractional zeroes removed (trim_scale,
PostgreSQL 13+): 12.3400 becomes 12.34. Only zeroes are removed, so this is
not rounding and an input without removable zeroes is returned unchanged. A NULL argument
yields NULL. Gated per name by Supports(string).
public decimal? trim_scale(decimal? value)
Parameters
valuedecimal?
Returns
ts_debug(string?)
ts_debug(document) as a FROM source: one row per tokenizer step of the default
text-search configuration, with the six documented columns alias, description,
token, dictionaries, dictionary and lexemes (see
SqlFunctions.ITsDebugRow; measured on PostgreSQL 17). The
regdictionary/regdictionary[] columns have no CLR mapping and are cast to
text/text[] in the emitted projection. Only the one-argument
ts_debug(text) overload is exposed: the document always runs through the session's
default configuration, while the two-argument ts_debug(regconfig, text) form would need
a configuration argument the API does not model. An empty or SQL-NULL document yields no rows.
public TvfEntityBuilder<SqlFunctions.ITsDebugRow> ts_debug(string? document)
Parameters
documentstring
Returns
ts_delete(string?, string?)
Removes lexeme from tsvector, NULLing the positions it
occupied (ts_delete). A missing lexeme leaves the vector unchanged.
public string? ts_delete(string? tsvector, string? lexeme)
Parameters
Returns
ts_delete(string?, string?[])
Removes every lexeme listed in lexemes from tsvector
(ts_delete). A lexeme that does not match is ignored; a NULL element or an empty array
leaves the vector unchanged, and a SQL-NULL array yields NULL (measured on 17.11).
public string? ts_delete(string? tsvector, string?[] lexemes)
Parameters
Returns
ts_filter(string?, string?[])
Keeps only the lexemes of tsvector whose weight is one of
weights (ts_filter).
public string? ts_filter(string? tsvector, string?[] weights)
Parameters
Returns
ts_headline(string, string?)
A highlighted excerpt of document for tsquery (ts_headline).
public string? ts_headline(string document, string? tsquery)
Parameters
Returns
ts_lexize(string?, string?)
Normalizes token with the text-search dictionary dictionary
(ts_lexize). Returns the lexemes as a text[]; a stop word yields an empty array.
public string?[] ts_lexize(string? dictionary, string? token)
Parameters
dictionarystringThe dictionary name (
regdictionary), for exampleenglish_stem.tokenstringThe token to normalize.
Returns
- string[]
ts_match(string?, string?)
The @@ match operator: true when tsvector matches tsquery.
public bool ts_match(string? tsvector, string? tsquery)
Parameters
Returns
ts_parse(string?, string?)
ts_parse(parser, document) as a FROM source: one row per token the named text-search
parser extracted, the tokid/token columns (see
SqlFunctions.ITsParseRow). The parser is passed by name (default,
english, …), so this member always resolves the ts_parse(text, text) overload:
PostgreSQL has no implicit text to oid cast, and the ts_parse(oid, text)
form cannot be reached from a string parameter. An unknown name raises
42704 (text search parser "…" does not exist) on the server; an empty or
SQL-NULL document yields no rows.
public TvfEntityBuilder<SqlFunctions.ITsParseRow> ts_parse(string? parser, string? document)
Parameters
Returns
ts_rank(string?, string?)
Relevance score of a tsvector against a tsquery (ts_rank).
public double? ts_rank(string? tsvector, string? tsquery)
Parameters
Returns
ts_rank_cd(string?, string?)
Cover-density relevance score of a tsvector against a tsquery (ts_rank_cd).
public double? ts_rank_cd(string? tsvector, string? tsquery)
Parameters
Returns
ts_rewrite(string?, string?)
Rewrites query with the rules returned by the SQL query
select (ts_rewrite); that query must return a target tsquery
and a substitute tsquery. The result is a tsquery, which the driver reads as text.
public string? ts_rewrite(string? query, string? select)
Parameters
querystringThe
tsquerytext to rewrite.selectstringA SQL query returning the rewrite pairs, for example
select 'a'::tsquery, 'c'::tsquery.
Returns
ts_rewrite(string?, string?, string?)
Replaces every occurrence of target in query with
substitute (ts_rewrite). The result is a tsquery, which the
driver reads as text.
public string? ts_rewrite(string? query, string? target, string? substitute)
Parameters
querystringThe
tsquerytext to rewrite.targetstringThe
tsqueryto replace.substitutestringThe replacement
tsquery.
Returns
ts_stat(string?)
ts_stat(query) as a FROM source: one row per lexeme of a tsvector query, the
word/ndoc/nentry columns (see SqlFunctions.ITsStatRow).
public TvfEntityBuilder<SqlFunctions.ITsStatRow> ts_stat(string? query)
Parameters
querystring
Returns
ts_token_type(string?)
ts_token_type(parser) as a FROM source: one row per token type the named text-search
parser recognises, the tokid/alias/description columns (see
SqlFunctions.ITsTokenTypeRow; 23 rows for default on PostgreSQL 17). The
parser is passed by name, so this member resolves the ts_token_type(text)
overload; the ts_token_type(oid) form cannot be reached from a string parameter
(no implicit text to oid cast). An unknown name raises 42704, and a
SQL-NULL parser yields no rows.
public TvfEntityBuilder<SqlFunctions.ITsTokenTypeRow> ts_token_type(string? parser)
Parameters
parserstring
Returns
tsquery_phrase(string?, string?)
Builds the phrase query query1 followed by query2
(tsquery_phrase), for example 'a' <-> 'b'. The result is a tsquery,
which the driver reads as text.
public string? tsquery_phrase(string? query1, string? query2)
Parameters
Returns
tsquery_phrase(string?, string?, int?)
Builds the phrase query with distance between the operands
(tsquery_phrase), for example 'a' <3> 'b'; the default distance is 1.
public string? tsquery_phrase(string? query1, string? query2, int? distance)
Parameters
query1stringThe first
tsquerytext.query2stringThe second
tsquerytext.distanceint?The number of positions between the operands.
Returns
tsrange(DateTime?, DateTime?)
Builds tsrange(lower, upper) with the default [) bounds.
public Range<DateTime> tsrange(DateTime? lower, DateTime? upper)
Parameters
lowerDateTime?The lower bound, or null for an unbounded side.
upperDateTime?The upper bound, or null for an unbounded side.
Returns
tsrange(DateTime?, DateTime?, string)
Builds tsrange(lower, upper, bounds).
public Range<DateTime> tsrange(DateTime? lower, DateTime? upper, string bounds)
Parameters
lowerDateTime?The lower bound, or null for an unbounded side.
upperDateTime?The upper bound, or null for an unbounded side.
boundsstringThe bound characters, for example
[),[],()or(].
Returns
tstzrange(DateTimeOffset?, DateTimeOffset?)
Builds tstzrange(lower, upper) with the default [) bounds.
public Range<DateTimeOffset> tstzrange(DateTimeOffset? lower, DateTimeOffset? upper)
Parameters
lowerDateTimeOffset?The lower bound, or null for an unbounded side.
upperDateTimeOffset?The upper bound, or null for an unbounded side.
Returns
- Range<DateTimeOffset>
The
tstzrangevalue.
tstzrange(DateTimeOffset?, DateTimeOffset?, string)
Builds tstzrange(lower, upper, bounds).
public Range<DateTimeOffset> tstzrange(DateTimeOffset? lower, DateTimeOffset? upper, string bounds)
Parameters
lowerDateTimeOffset?The lower bound, or null for an unbounded side.
upperDateTimeOffset?The upper bound, or null for an unbounded side.
boundsstringThe bound characters, for example
[),[],()or(].
Returns
- Range<DateTimeOffset>
The
tstzrangevalue.
tsvector_to_array(string?)
The lexemes of tsvector as a text[] (tsvector_to_array), in
the vector's stored order.
public string?[] tsvector_to_array(string? tsvector)
Parameters
tsvectorstringThe
tsvectortext.
Returns
- string[]
unistr(string?)
Interprets backslash escapes (\XXXX, +XXXXXX, \uXXXX,
\UXXXXXXXX) and doubled backslashes in value as Unicode code
points (unistr). A NULL argument yields NULL. Gated per name by
Supports(string).
public string? unistr(string? value)
Parameters
valuestring
Returns
unnest_with_ordinality<T>(T[])
unnest(array) WITH ORDINALITY as a FROM source: the element and its one-based position
(see SqlFunctions.IUnnestOrdinalityRow<T>). WITH ORDINALITY is FROM-clause
grammar, and the ordinality column is bigint, so it is long here.
public TvfEntityBuilder<SqlFunctions.IUnnestOrdinalityRow<T>> unnest_with_ordinality<T>(T[] array)
Parameters
arrayT[]The array to expand.
Returns
Type Parameters
TThe element type of the array.
unnest_with_ordinality<T1, T2>(T1[], T2[])
unnest(array1, array2) WITH ORDINALITY as a FROM source: both admitted array positions
plus the shared one-based position; the shorter array is padded with null (see
SqlFunctions.IUnnestOrdinalityMultiRow<T1, T2>).
public TvfEntityBuilder<SqlFunctions.IUnnestOrdinalityMultiRow<T1, T2>> unnest_with_ordinality<T1, T2>(T1[] first, T2[] second)
Parameters
firstT1[]The first array.
secondT2[]The second array; the shorter array is padded with null.
Returns
Type Parameters
T1The element type of the first array.
T2The element type of the second array.
unnest<TRow>(object?, object?, object?, object?)
unnest(four or more arrays) is refused: PostgreSQL's multi-array unnest is
FROM-clause grammar with no variadic arity, and this library admits exactly one, two and three
arrays as typed overloads. Claiming an arbitrary arity through one overload would misrepresent
the grammar, so the call fails while the source is composed and no SQL is emitted.
public TvfEntityBuilder<TRow> unnest<TRow>(object? first, object? second, object? third, object? fourth)
Parameters
firstobjectThe first array.
secondobjectThe second array.
thirdobjectThe third array.
fourthobjectThe fourth array, which exceeds the admitted arities.
Returns
- TvfEntityBuilder<TRow>
Never returns; the call is refused when the source is composed.
Type Parameters
TRowThe row shape the caller hoped to project; never produced.
unnest<T>(T[])
unnest(array) as a FROM source; select Value. The
array is normally supplied through SqlFunctions.Parameter<T[]>(idx).
public TvfEntityBuilder<SqlFunctions.IUnnestRow<T>> unnest<T>(T[] array)
Parameters
arrayT[]
Returns
Type Parameters
T
unnest<T1, T2>(T1[], T2[])
unnest(array1, array2) as a FROM source: one row per position of the longest array, with
Value1 and
Value2 taking the elements of the two arrays and
the shorter array padded with null. The multi-array form is FROM-clause
grammar, not a pg_proc function: PostgreSQL rejects a column definition list on it and
points at ROWS FROM, which the provider renders. The admitted arities are one, two and
three arrays — there is no variadic claim.
public TvfEntityBuilder<SqlFunctions.IUnnestMultiRow<T1, T2>> unnest<T1, T2>(T1[] first, T2[] second)
Parameters
firstT1[]The first array.
secondT2[]The second array; the shorter array is padded with null.
Returns
- TvfEntityBuilder<SqlFunctions.IUnnestMultiRow<T1, T2>>
Type Parameters
T1The element type of the first array.
T2The element type of the second array.
unnest<T1, T2, T3>(T1[], T2[], T3[])
unnest(array1, array2, array3) as a FROM source: the three admitted array positions, all
padded with null to the longest array (see
SqlFunctions.IUnnestMultiRow<T1, T2, T3>).
public TvfEntityBuilder<SqlFunctions.IUnnestMultiRow<T1, T2, T3>> unnest<T1, T2, T3>(T1[] first, T2[] second, T3[] third)
Parameters
firstT1[]The first array.
secondT2[]The second array.
thirdT3[]The third array.
Returns
- TvfEntityBuilder<SqlFunctions.IUnnestMultiRow<T1, T2, T3>>
Type Parameters
T1The element type of the first array.
T2The element type of the second array.
T3The element type of the third array.
upper_inc<T>(Range<T>)
upper_inc(range): true when the upper bound is inclusive.
public bool upper_inc<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to inspect.
Returns
Type Parameters
TThe bound type of the range.
upper_inc<T>(Range<T>[])
upper_inc(multirange): true when the upper bound is inclusive.
public bool upper_inc<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to inspect.
Returns
Type Parameters
TThe bound type of the multirange.
upper_inf<T>(Range<T>)
upper_inf(range): true when the upper side is unbounded.
public bool upper_inf<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to inspect.
Returns
Type Parameters
TThe bound type of the range.
upper_inf<T>(Range<T>[])
upper_inf(multirange): true when the upper side is unbounded.
public bool upper_inf<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to inspect.
Returns
Type Parameters
TThe bound type of the multirange.
upper<T>(Range<T>)
upper(range): the upper bound, or null when it is unbounded.
public T? upper<T>(Range<T> range) where T : struct, IComparable<T>
Parameters
rangeRange<T>The range to inspect.
Returns
- T?
The upper bound, or null.
Type Parameters
TThe bound type of the range.
upper<T>(Range<T>[])
upper(multirange): the upper bound, or null when it is unbounded.
public T? upper<T>(Range<T>[] multirange) where T : struct, IComparable<T>
Parameters
multirangeRange<T>[]The multirange to inspect.
Returns
- T?
The upper bound, or null.
Type Parameters
TThe bound type of the multirange.
uuid_extract_timestamp(Guid?)
Extracts the timestamp with time zone embedded in a version 1 (or version 7) UUID
(uuid_extract_timestamp); UUIDs of other versions and the nil UUID yield NULL. Gated
per name by Supports(string).
public DateTime? uuid_extract_timestamp(Guid? value)
Parameters
valueGuid?
Returns
uuid_extract_version(Guid?)
The version number embedded in value (uuid_extract_version), for
example 1 or 4; the nil UUID yields NULL. Gated per name by
Supports(string).
public short? uuid_extract_version(Guid? value)
Parameters
valueGuid?
Returns
websearch_to_tsquery(string)
Parses query into a tsquery using web-search syntax (websearch_to_tsquery).
public string? websearch_to_tsquery(string query)
Parameters
querystringThe web-search query.
Returns
width_bucket(double?, double?, double?, int)
The bucket number for operand in count equal-width buckets.
public int width_bucket(double? operand, double? low, double? high, int count)
Parameters
Returns
xmlagg(string?)
Aggregates the XML values of a group into one xml document (xmlagg, PostgreSQL 9.0+).
PostgreSQL has a single xmlagg(xml) → xml aggregate and no text/integer overload
(measured on 17.11: xmlagg(text) is 42883 "function xmlagg(text) does not exist"), so
the operand is cast to xml in the rendered SQL, so value must hold
XML markup the xml type accepts; the cast is what keeps the emitted call in the
xmlagg(xml) form. The result is the
concatenation of the group's documents with no separator, read back by the driver as a plain
string (measured: the xml result arrives as string with data type name
xml). NULL operands are skipped, a group whose operands are all NULL yields NULL, and —
because this is an aggregate — an empty input still produces one row with NULL.
public string? xmlagg(string? value)
Parameters
valuestringThe XML markup to aggregate.