Table of Contents

Class PostgreSQLExtensions

Namespace
LinqToDB.DataProvider.PostgreSQL
Assembly
linq2db.dll
public static class PostgreSQLExtensions
Inheritance
PostgreSQLExtensions

Methods

ArrayAggregate<T>(ISqlExtension?, T)

[Sql.Extension("ARRAY_AGG({expr})", TokenName = "function", ChainPrecedence = 1, IsAggregate = true)]
public static AnalyticFunctions.IAnalyticFunctionWithoutWindow<T[]> ArrayAggregate<T>(this Sql.ISqlExtension? ext, T expr)

Parameters

ext Sql.ISqlExtension
expr T

Returns

AnalyticFunctions.IAnalyticFunctionWithoutWindow<T[]>

Type Parameters

T

ArrayAggregate<T>(ISqlExtension?, T, AggregateModifier)

[Sql.Extension("ARRAY_AGG({modifier?}{_}{expr})", TokenName = "function", BuilderType = typeof(PostgreSQLExtensions.ApplyAggregateModifier), ChainPrecedence = 0, IsAggregate = true)]
public static AnalyticFunctions.IAnalyticFunctionWithoutWindow<T[]> ArrayAggregate<T>(this Sql.ISqlExtension? ext, T expr, Sql.AggregateModifier modifier)

Parameters

ext Sql.ISqlExtension
expr T
modifier Sql.AggregateModifier

Returns

AnalyticFunctions.IAnalyticFunctionWithoutWindow<T[]>

Type Parameters

T

ArrayAggregate<TEntity, TV>(IEnumerable<TEntity>, Func<TEntity, TV>, AggregateModifier)

[Sql.Extension("ARRAY_AGG({modifier?}{_}{expr}{_}{order_by_clause?})", BuilderType = typeof(PostgreSQLExtensions.ApplyAggregateModifier), IsAggregate = true, ChainPrecedence = 10)]
public static Sql.IAggregateFunctionNotOrdered<TEntity, TV[]> ArrayAggregate<TEntity, TV>(this IEnumerable<TEntity> source, Func<TEntity, TV> expr, Sql.AggregateModifier modifier)

Parameters

source IEnumerable<TEntity>
expr Func<TEntity, TV>
modifier Sql.AggregateModifier

Returns

Sql.IAggregateFunctionNotOrdered<TEntity, TV[]>

Type Parameters

TEntity
TV

ArrayAggregate<TEntity, TV>(IQueryable<TEntity>, Expression<Func<TEntity, TV>>)

[Sql.Extension("ARRAY_AGG({expr}{_}{order_by_clause?})", IsAggregate = true, ChainPrecedence = 10)]
public static Sql.IAggregateFunctionNotOrdered<TEntity, TV[]> ArrayAggregate<TEntity, TV>(this IQueryable<TEntity> source, Expression<Func<TEntity, TV>> expr)

Parameters

source IQueryable<TEntity>
expr Expression<Func<TEntity, TV>>

Returns

Sql.IAggregateFunctionNotOrdered<TEntity, TV[]>

Type Parameters

TEntity
TV

ArrayAggregate<TEntity, TV>(IQueryable<TEntity>, Expression<Func<TEntity, TV>>, AggregateModifier)

[Sql.Extension("ARRAY_AGG({modifier?}{_}{expr}{_}{order_by_clause?})", BuilderType = typeof(PostgreSQLExtensions.ApplyAggregateModifier), IsAggregate = true, ChainPrecedence = 10)]
public static Sql.IAggregateFunctionNotOrdered<TEntity, TV[]> ArrayAggregate<TEntity, TV>(this IQueryable<TEntity> source, Expression<Func<TEntity, TV>> expr, Sql.AggregateModifier modifier)

Parameters

source IQueryable<TEntity>
expr Expression<Func<TEntity, TV>>
modifier Sql.AggregateModifier

Returns

Sql.IAggregateFunctionNotOrdered<TEntity, TV[]>

Type Parameters

TEntity
TV

ArrayAppend<T>(IPostgreSQLExtensions?, T[], T)

[Sql.Extension("ARRAY_APPEND({array}, {element})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static T[] ArrayAppend<T>(this IPostgreSQLExtensions? ext, T[] array, T element)

Parameters

ext IPostgreSQLExtensions
array T[]
element T

Returns

T[]

Type Parameters

T

ArrayCat<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("ARRAY_CAT({array1}, {array2})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static T[] ArrayCat<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

T[]

Type Parameters

T

ArrayDims<T>(IPostgreSQLExtensions?, T[])

[Sql.Extension("ARRAY_DIMS({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static string ArrayDims<T>(this IPostgreSQLExtensions? ext, T[] array)

Parameters

ext IPostgreSQLExtensions
array T[]

Returns

string

Type Parameters

T

ArrayLength<T>(IPostgreSQLExtensions?, T[], int)

[Sql.Extension("ARRAY_LENGTH({array}, {dimension})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static int ArrayLength<T>(this IPostgreSQLExtensions? ext, T[] array, int dimension)

Parameters

ext IPostgreSQLExtensions
array T[]
dimension int

Returns

int

Type Parameters

T

ArrayLower<T>(IPostgreSQLExtensions?, T[], int)

[Sql.Extension("ARRAY_LOWER({array}, {dimension})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static int ArrayLower<T>(this IPostgreSQLExtensions? ext, T[] array, int dimension)

Parameters

ext IPostgreSQLExtensions
array T[]
dimension int

Returns

int

Type Parameters

T

ArrayNDims<T>(IPostgreSQLExtensions?, T[])

[Sql.Extension("ARRAY_NDIMS({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static int ArrayNDims<T>(this IPostgreSQLExtensions? ext, T[] array)

Parameters

ext IPostgreSQLExtensions
array T[]

Returns

int

Type Parameters

T

ArrayPosition<T>(IPostgreSQLExtensions?, T[], T)

[Sql.Extension("ARRAY_POSITION({array}, {element})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static int ArrayPosition<T>(this IPostgreSQLExtensions? ext, T[] array, T element)

Parameters

ext IPostgreSQLExtensions
array T[]
element T

Returns

int

Type Parameters

T

ArrayPosition<T>(IPostgreSQLExtensions?, T[], T, int)

[Sql.Extension("ARRAY_POSITION({array}, {element}, {start})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static int ArrayPosition<T>(this IPostgreSQLExtensions? ext, T[] array, T element, int start)

Parameters

ext IPostgreSQLExtensions
array T[]
element T
start int

Returns

int

Type Parameters

T

ArrayPositions<T>(IPostgreSQLExtensions?, T[], T)

[Sql.Extension("ARRAY_POSITIONS({array}, {element})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static int[] ArrayPositions<T>(this IPostgreSQLExtensions? ext, T[] array, T element)

Parameters

ext IPostgreSQLExtensions
array T[]
element T

Returns

int[]

Type Parameters

T

ArrayPrepend<T>(IPostgreSQLExtensions?, T, T[])

[Sql.Extension("ARRAY_PREPEND({element}, {array})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static T[] ArrayPrepend<T>(this IPostgreSQLExtensions? ext, T element, T[] array)

Parameters

ext IPostgreSQLExtensions
element T
array T[]

Returns

T[]

Type Parameters

T

ArrayRemove<T>(IPostgreSQLExtensions?, T[], T)

[Sql.Extension("ARRAY_REMOVE({array}, {element})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static T[] ArrayRemove<T>(this IPostgreSQLExtensions? ext, T[] array, T element)

Parameters

ext IPostgreSQLExtensions
array T[]
element T

Returns

T[]

Type Parameters

T

ArrayReplace<T>(IPostgreSQLExtensions?, T[], T, T)

[Sql.Extension("ARRAY_REPLACE({array}, {oldElement}, {newElement})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static T[] ArrayReplace<T>(this IPostgreSQLExtensions? ext, T[] array, T oldElement, T newElement)

Parameters

ext IPostgreSQLExtensions
array T[]
oldElement T
newElement T

Returns

T[]

Type Parameters

T

ArrayToString<T>(IPostgreSQLExtensions?, T[], string)

[Sql.Extension("ARRAY_TO_STRING({array}, {delimiter})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static string ArrayToString<T>(this IPostgreSQLExtensions? ext, T[] array, string delimiter)

Parameters

ext IPostgreSQLExtensions
array T[]
delimiter string

Returns

string

Type Parameters

T

ArrayToString<T>(IPostgreSQLExtensions?, T[], string, string)

[Sql.Extension("ARRAY_TO_STRING({array}, {delimiter}, {nullString})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static string ArrayToString<T>(this IPostgreSQLExtensions? ext, T[] array, string delimiter, string nullString)

Parameters

ext IPostgreSQLExtensions
array T[]
delimiter string
nullString string

Returns

string

Type Parameters

T

ArrayUpper<T>(IPostgreSQLExtensions?, T[], int)

[Sql.Extension("ARRAY_UPPER({array}, {dimension})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static T[] ArrayUpper<T>(this IPostgreSQLExtensions? ext, T[] array, int dimension)

Parameters

ext IPostgreSQLExtensions
array T[]
dimension int

Returns

T[]

Type Parameters

T

Cardinality<T>(IPostgreSQLExtensions?, T[])

[Sql.Extension("CARDINALITY({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static int Cardinality<T>(this IPostgreSQLExtensions? ext, T[] array)

Parameters

ext IPostgreSQLExtensions
array T[]

Returns

int

Type Parameters

T

ConcatArrays<T>(IPostgreSQLExtensions?, T[], T[][])

[Sql.Extension("{array1} || {array2}", ServerSideOnly = true, CanBeNull = true, Precedence = 60)]
public static T[] ConcatArrays<T>(this IPostgreSQLExtensions? ext, T[] array1, T[][] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[][]

Returns

T[]

Type Parameters

T

ConcatArrays<T>(IPostgreSQLExtensions?, params T[][])

[Sql.Extension("{arrays, ' || '}", ServerSideOnly = true, CanBeNull = true, Precedence = 60)]
public static T[] ConcatArrays<T>(this IPostgreSQLExtensions? ext, params T[][] arrays)

Parameters

ext IPostgreSQLExtensions
arrays T[][]

Returns

T[]

Type Parameters

T

ConcatArrays<T>(IPostgreSQLExtensions?, T[][], T[])

[CLSCompliant(false)]
[Sql.Extension("{array1} || {array2}", ServerSideOnly = true, CanBeNull = true, Precedence = 60)]
public static T[] ConcatArrays<T>(this IPostgreSQLExtensions? ext, T[][] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[][]
array2 T[]

Returns

T[]

Type Parameters

T

ContainedBy<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("{array1} <@ {array2}", ServerSideOnly = true, CanBeNull = false, IsPredicate = true, Precedence = 50)]
public static bool ContainedBy<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

bool

Type Parameters

T

Contains<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("{array1} @> {array2}", ServerSideOnly = true, CanBeNull = false, IsPredicate = true, Precedence = 50)]
public static bool Contains<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

bool

Type Parameters

T

CurrentCatalog(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("CURRENT_CATALOG", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string CurrentCatalog(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string

CurrentDatabase(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("CURRENT_DATABASE()", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string CurrentDatabase(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string

CurrentRole(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("CURRENT_ROLE", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string CurrentRole(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string

CurrentSchema(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("CURRENT_SCHEMA", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string CurrentSchema(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string

CurrentSchemas(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("CURRENT_SCHEMAS()", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string[] CurrentSchemas(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string[]

CurrentSchemas(IPostgreSQLExtensions?, IDataContext, bool)

[Sql.Extension("CURRENT_SCHEMAS({includeImplicit})", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string[] CurrentSchemas(this IPostgreSQLExtensions? ext, IDataContext dc, bool includeImplicit)

Parameters

ext IPostgreSQLExtensions
dc IDataContext
includeImplicit bool

Returns

string[]

CurrentUser(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("CURRENT_USER", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string CurrentUser(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string

GreaterThanOrEqual<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("{array1} > {array2}", ServerSideOnly = true, CanBeNull = false, IsPredicate = true, Precedence = 50)]
public static bool GreaterThanOrEqual<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

bool

Type Parameters

T

GreaterThan<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("{array1} > {array2}", ServerSideOnly = true, CanBeNull = false, IsPredicate = true, Precedence = 50)]
public static bool GreaterThan<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

bool

Type Parameters

T

LessThanOrEqual<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("{array1} <= {array2}", ServerSideOnly = true, CanBeNull = false, IsPredicate = true, Precedence = 50)]
public static bool LessThanOrEqual<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

bool

Type Parameters

T

LessThan<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("{array1} < {array2}", ServerSideOnly = true, CanBeNull = true, IsPredicate = true, Precedence = 50)]
public static bool LessThan<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

bool

Type Parameters

T

Overlaps<T>(IPostgreSQLExtensions?, T[], T[])

[Sql.Extension("{array1} && {array2}", ServerSideOnly = true, CanBeNull = false, IsPredicate = true, Precedence = 50)]
public static bool Overlaps<T>(this IPostgreSQLExtensions? ext, T[] array1, T[] array2)

Parameters

ext IPostgreSQLExtensions
array1 T[]
array2 T[]

Returns

bool

Type Parameters

T

PostgreSQL(ISqlExtension?)

public static IPostgreSQLExtensions? PostgreSQL(this Sql.ISqlExtension? ext)

Parameters

ext Sql.ISqlExtension

Returns

IPostgreSQLExtensions

SessionUser(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("SESSION_USER", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string SessionUser(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string

StringToArray(IPostgreSQLExtensions?, string, string)

[Sql.Extension("STRING_TO_ARRAY({str}, {delimiter})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static string[] StringToArray(this IPostgreSQLExtensions? ext, string str, string delimiter)

Parameters

ext IPostgreSQLExtensions
str string
delimiter string

Returns

string[]

StringToArray(IPostgreSQLExtensions?, string, string, string)

[Sql.Extension("STRING_TO_ARRAY({str}, {delimiter}, {nullString})", ServerSideOnly = true, CanBeNull = true, Precedence = 100)]
public static string[] StringToArray(this IPostgreSQLExtensions? ext, string str, string delimiter, string nullString)

Parameters

ext IPostgreSQLExtensions
str string
delimiter string
nullString string

Returns

string[]

ValueIsEqualToAny<T>(IPostgreSQLExtensions?, T, T[])

[Sql.Extension("{value} = ANY({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 50, IsPredicate = true)]
public static bool ValueIsEqualToAny<T>(this IPostgreSQLExtensions? ext, T value, T[] array)

Parameters

ext IPostgreSQLExtensions
value T
array T[]

Returns

bool

Type Parameters

T

ValueIsGreaterThanAny<T>(IPostgreSQLExtensions?, T, T[])

[Sql.Extension("{value} > ANY({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 50, IsPredicate = true)]
public static bool ValueIsGreaterThanAny<T>(this IPostgreSQLExtensions? ext, T value, T[] array)

Parameters

ext IPostgreSQLExtensions
value T
array T[]

Returns

bool

Type Parameters

T

ValueIsGreaterThanOrEqualToAny<T>(IPostgreSQLExtensions?, T, T[])

[Sql.Extension("{value} >= ANY({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 50, IsPredicate = true)]
public static bool ValueIsGreaterThanOrEqualToAny<T>(this IPostgreSQLExtensions? ext, T value, T[] array)

Parameters

ext IPostgreSQLExtensions
value T
array T[]

Returns

bool

Type Parameters

T

ValueIsLessThanAny<T>(IPostgreSQLExtensions?, T, T[])

[Sql.Extension("{value} < ANY({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 50, IsPredicate = true)]
public static bool ValueIsLessThanAny<T>(this IPostgreSQLExtensions? ext, T value, T[] array)

Parameters

ext IPostgreSQLExtensions
value T
array T[]

Returns

bool

Type Parameters

T

ValueIsLessThanOrEqualToAny<T>(IPostgreSQLExtensions?, T, T[])

[Sql.Extension("{value} <= ANY({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 50, IsPredicate = true)]
public static bool ValueIsLessThanOrEqualToAny<T>(this IPostgreSQLExtensions? ext, T value, T[] array)

Parameters

ext IPostgreSQLExtensions
value T
array T[]

Returns

bool

Type Parameters

T

ValueIsNotEqualToAny<T>(IPostgreSQLExtensions?, T, T[])

[Sql.Extension("{value} <> ANY({array})", ServerSideOnly = true, CanBeNull = true, Precedence = 50, IsPredicate = true)]
public static bool ValueIsNotEqualToAny<T>(this IPostgreSQLExtensions? ext, T value, T[] array)

Parameters

ext IPostgreSQLExtensions
value T
array T[]

Returns

bool

Type Parameters

T

Version(IPostgreSQLExtensions?, IDataContext)

[Sql.Extension("VERSION()", ServerSideOnly = true, CanBeNull = false, Precedence = 100)]
public static string Version(this IPostgreSQLExtensions? ext, IDataContext dc)

Parameters

ext IPostgreSQLExtensions
dc IDataContext

Returns

string