API Reference#
This section contains live API documentation extracted directly from SQL source docstrings via Doxygen and Breathe.
Bitemporal Schema Management#
-
boolean ll_create_bitemporal_partition(text p_schema, text p_table, text p_partition_name, text p_range)#
Creates a partition for a partitioned bitemporal table, including the GiST exclusion constraint.
- Parameters:
p_schema – [in] text Schema name where table and partition reside.
p_table – [in] text Base partitioned table name.
p_partition_name – [in] text Partition table name to create.
p_range – [in] text Value range for partition (e.g. FROM (‘2023-01-01) TO (‘2023-02-01’)`).
- Returns:
boolean True if partition creation and constraint setup succeeded, false otherwise.
-
boolean ll_create_bitemporal_table(text p_schema, text p_table, text p_table_definition, text p_business_key)#
Creates a bitemporal table equipped with effective and asserted temporal ranges and GIST exclusion constraints.
- Example
SELECT * FROM bitemporal_internal.ll_create_bitemporal_table( 'bitemp_tables', 'devices', 'device_id integer, device_descr text', 'device_id' );
- Parameters:
p_schema – [in] text The schema name where the bitemporal table will be created.
p_table – [in] text The table name.
p_table_definition – [in] text Column definitions for business attributes (e.g., ‘device_id integer, device_descr text’).
p_business_key – [in] text Natural business key column(s) (comma-separated if composite).
- Return values:
true – Table created successfully with primary key and GIST exclusion constraint.
false – Table creation failed (error diagnostic logged via RAISE NOTICE).
- Pre:
Target schema must exist.
- Post:
Creates physical table containing surrogate PK
<table_name>_key, attributes,effective,asserted,row_created_at, and exclusion constraint<table_name>_<business_key>_assert_eff_excl.
-
boolean ll_create_bitemporal_table_partitioned(text p_schema, text p_table, text p_table_definition, text p_business_key, text p_partitioned_by = NULL)#
Creates a declarative partitioned bitemporal table.
- Parameters:
p_schema – [in] text Schema name where table will reside.
p_table – [in] text Base table name.
p_table_definition – [in] text Column definitions for business payload fields.
p_business_key – [in] text Comma-separated column name(s) forming the business key.
p_partitioned_by – [in] text Optional expression to partition by range (defaults to business key).
- Returns:
boolean True if table creation succeeded, false otherwise.
-
boolean ll_create_bitemporal_view(text p_schema, text p_table, text p_view, boolean p_recreate = false)#
Creates a parameterized as_of temporal query function and an updatable current-state view with INSTEAD OF triggers.
See also
ll_create_bitemporal_table, ll_is_bitemporal_table, ll_drop_bitemporal_view, ll_bitemporal_insert_select_effective
- Example
SELECT bitemporal_internal.ll_create_bitemporal_view('myschema', 'orders_bt', 'orders'); -- Query historical state at valid time V as known at evaluation time E: SELECT * FROM myschema.orders_as_of('2026-09-01', '2026-02-28'); -- Query and modify current state: SELECT * FROM myschema.orders; -- Recreate view after schema modification: SELECT bitemporal_internal.ll_create_bitemporal_view('myschema', 'orders_bt', 'orders', p_recreate := true);
Note
Point-in-Time Querying vs. Bulk Ingestion: The generated
<view>_as_offunction performs point-in-time reads using interval containment (p_effective <@ effective AND p_asserted <@ asserted). For bulk ingestion of batches that already carry explicit validity intervals, usebitemporal_internal.ll_bitemporal_insert_select_effective.- Parameters:
p_schema – [in] text Schema name containing the bitemporal table.
p_table – [in] text Bitemporal table name.
p_view – [in] text Mandatory target view name to create.
p_recreate – [in] boolean Optional flag to drop and recreate existing view and functions (defaults to false).
- Return values:
true – View, as_of function, and INSTEAD OF triggers created successfully.
false – View creation failed (error diagnostic logged via RAISE NOTICE).
- Pre:
Target table must exist and be a valid bitemporal table.
- Post:
Creates parameterized query function
<p_schema>.<p_view>_as_of(p_effective, p_asserted), creates view<p_schema>.<p_view>specialized tonow(), now(), and binds an INSTEAD OF trigger supporting INSERT, UPDATE, and DELETE.
-
boolean ll_drop_bitemporal_view(text p_schema, text p_view, boolean p_cascade = false)#
Drops an updatable bitemporal view, its INSTEAD OF trigger, trigger function, and as_of function.
See also
- Example
SELECT bitemporal_internal.ll_drop_bitemporal_view('myschema', 'orders');
- Parameters:
p_schema – [in] text Schema name containing the bitemporal view.
p_view – [in] text Name of the view to drop.
p_cascade – [in] boolean Optional flag to cascade drop to dependent database objects (defaults to false).
- Return values:
true – View and associated helper functions dropped successfully.
false – Dropping failed (error diagnostic logged via RAISE NOTICE).
- Post:
Drops view
<p_schema>.<p_view>, function<p_schema>.<p_view>_bitemporal_dml(), and function<p_schema>.<p_view>_as_of(timestamptz, timestamptz).
-
text ll_generate_bitemp_for_schema(text p_schema_name)#
Generates DDL scripts to create bitemporal versions of all tables in a schema.
See also
- Parameters:
p_schema_name – [in] text Name of the source schema whose tables will be transformed into bitemporal tables.
- Returns:
text SQL DDL script containing ll_create_bitemporal_table invocations for each table in the schema.
- Pre:
Source schema must exist and contain base tables with primary keys.
- Post:
Generates SQL string to construct
<schema>_bitemporaltables.
-
boolean ll_is_bitemporal_table(text p_table)#
Checks whether a table is a valid bitemporal table.
See also
- Parameters:
p_table – [in] text Qualified table name (
<schema>.<table_name>).
- Return values:
true – Table contains
effective,asserted,row_created_atattributes and active GIST exclusion index.false – Table lacks bitemporal attributes or required GIST exclusion index.
Bitemporal DML Operations#
-
integer ll_bitemporal_correction(text p_schema_name, text p_table_name, text p_list_of_fields, text p_list_of_values, text p_search_fields, text p_search_values, timeperiod p_effective, time_endpoint p_now)#
Executes a bitemporal correction operation with an explicit assertion timestamp boundary.
Direct data correction that mutates historical record attributes without creating a new assertion interval.
See also
Warning
Correction vs Update: Correction modifies record attributes in place without preserving historical versions.
- Parameters:
p_schema_name – [in] text Schema name containing target table.
p_table_name – [in] text Target bitemporal table.
p_list_of_fields – [in] text Comma-separated columns to correct.
p_list_of_values – [in] text Comma-separated corrected literal values.
p_search_fields – [in] text Comma-separated list of search columns in WHERE clause.
p_search_values – [in] text Comma-separated search values.
p_effective – [in] temporal_relationships.timeperiod Effective range of correction.
p_now – [in] temporal_relationships.time_endpoint Assertion timestamp boundary used for correction interval.
- Returns:
integer Count of corrected records.
- Pre:
Target table must be bitemporal.
- Post:
Overwrites values of matching records directly within the target assertion range.
-
integer ll_bitemporal_correction(text p_schema_name, text p_table_name, text p_list_of_fields, text p_list_of_values, text p_search_fields, text p_search_values, timeperiod p_effective)
Executes a bitemporal correction operation defaulting assertion boundary to clock_timestamp().
Direct data correction that mutates historical record attributes without creating a new assertion interval.
See also
Warning
Correction vs Update: Correction modifies record attributes in place without preserving historical versions.
- Parameters:
p_schema_name – [in] text Schema name containing target table.
p_table_name – [in] text Target bitemporal table.
p_list_of_fields – [in] text Comma-separated columns to correct.
p_list_of_values – [in] text Comma-separated corrected literal values.
p_search_fields – [in] text Comma-separated list of search columns in WHERE clause.
p_search_values – [in] text Comma-separated search values.
p_effective – [in] temporal_relationships.timeperiod Effective range of correction.
- Returns:
integer Count of corrected records.
- Pre:
Target table must be bitemporal.
- Post:
Overwrites values of matching records directly within the target assertion range.
-
INTEGER ll_bitemporal_delete(text p_table, TEXT p_search_fields, TEXT p_search_values, timeperiod p_asserted)#
Deletes (asserts out) matching records from a bitemporal table by closing their assertion interval.
See also
- Parameters:
p_table – [in] text Qualified bitemporal table name (
<schema>.<table_name>).p_search_fields – [in] text Comma-separated search column names for WHERE clause.
p_search_values – [in] text Comma-separated search values.
p_asserted – [in] temporal_relationships.timeperiod Assertion range closing record validity in system time.
- Returns:
integer Count of deleted (asserted-out) records.
- Pre:
Target table must be bitemporal and contain active records matching
p_search_fields.- Post:
Sets
upper(asserted)boundary to lower bound ofp_assertedfor matching active records.
-
INTEGER ll_bitemporal_inactivate(text p_schema_name, text p_table_name, TEXT p_search_fields, TEXT p_search_values, timeperiod p_effective, timeperiod p_asserted)#
Inactivates a bitemporal record starting from specified effective interval.
See also
- Parameters:
p_schema_name – [in] text Name of the schema.
p_table_name – [in] text Name of the bitemporal table.
p_search_fields – [in] text Comma-separated search columns for WHERE clause.
p_search_values – [in] text Comma-separated search values.
p_effective – [in] temporal_relationships.timeperiod Effective range when record becomes inactive.
p_asserted – [in] temporal_relationships.timeperiod Assertion range for inactivation.
- Throws EXCEPTION:
‘Asserted interval starts in the past or has a finite end’ if
p_assertedbounds are invalid.- Returns:
integer Count of inactivated records.
- Pre:
Target table must be bitemporal.
- Post:
Closes effective availability interval of matching records starting from
p_effective.
-
INTEGER ll_bitemporal_insert(text p_table, text p_list_of_fields, TEXT p_list_of_values, timeperiod p_effective, timeperiod p_asserted)#
Inserts a new tuple into a bitemporal table with explicit effective and asserted time periods.
- Example
SELECT * FROM bitemporal_internal.ll_bitemporal_insert( 'bitemp_tables.devices', 'device_id, device_descr', $$1, 'description_1'$$, '[now(), infinity)'::tstzrange, '[now(), infinity)'::tstzrange );
- Parameters:
p_table – [in] text Fully qualified bitemporal table name (
<schema>.<table_name>).p_list_of_fields – [in] text Comma-separated column names to insert.
p_list_of_values – [in] text Comma-separated literal values for the columns.
p_effective – [in] temporal_relationships.timeperiod Business effective interval for the record.
p_asserted – [in] temporal_relationships.timeperiod System assertion interval for the record.
- Returns:
integer Number of inserted records (1 if successful).
- Pre:
Target table must exist and be bitemporal.
- Post:
Inserts a new record into
p_tablewitheffectiveandassertedranges set.
-
INTEGER ll_bitemporal_insert_select(text p_table, text p_list_of_fields, TEXT p_select, timeperiod p_effective, timeperiod p_asserted)#
Inserts a set of records into a bitemporal table using a SELECT query statement.
- Example
SELECT * FROM bitemporal_internal.ll_bitemporal_insert_select( 'bitemp_tables.devices', 'device_id, device_descr', $$SELECT device_id, device_descr FROM nontemporal.devices WHERE device_id BETWEEN 4 AND 10$$, '[now(), infinity)'::tstzrange, '[now(), infinity)'::tstzrange );
- Parameters:
p_table – [in] text Fully qualified bitemporal table name (
<schema>.<table_name>).p_list_of_fields – [in] text Comma-separated column names to populate.
p_select – [in] text SELECT query string providing source dataset values.
p_effective – [in] temporal_relationships.timeperiod Business effective interval applied to all inserted records.
p_asserted – [in] temporal_relationships.timeperiod System assertion interval applied to all inserted records.
- Returns:
integer Count of inserted records.
- Pre:
Target table must be bitemporal and query in
p_selectmust return columns matchingp_list_of_fields.- Post:
Populates
p_tablewith records generated byp_select.
-
INTEGER ll_bitemporal_insert_select_effective(text p_table, text p_list_of_fields, TEXT p_select, timeperiod p_asserted)#
Inserts records into a bitemporal table where the source query includes an
effectivecolumn.This function performs bulk data ingestion (write) when importing rows that already contain individual validity ranges (
[valid_from, valid_to)). Contrast with<view>_as_of(...), which performs point-in-time reads (querying) over historical validity periods.Note
Distinction from
as_of: Use this function for batch write/ingestion when source rows carry explicit validity ranges. For point-in-time reads and historical queries, use<view>_as_of(p_effective, p_asserted)generated viall_create_bitemporal_view.- Parameters:
p_table – [in] text Fully qualified bitemporal table name (
<schema>.<table_name>).p_list_of_fields – [in] text Comma-separated column names to populate (excluding
effectiveandasserted).p_select – [in] text SELECT query string providing source dataset values including an
effectiveinterval column.p_asserted – [in] temporal_relationships.timeperiod System assertion interval applied to all inserted records.
- Returns:
integer Count of inserted records.
-
INTEGER ll_bitemporal_update(text p_schema_name, text p_table_name, text p_list_of_fields, TEXT p_list_of_values, TEXT p_search_fields, TEXT p_search_values, timeperiod p_effective, timeperiod p_asserted)#
Performs a bitemporal update operation, closing existing system assertion periods and creating updated effective history.
- Example
SELECT * FROM bitemporal_internal.ll_bitemporal_update( 'bitemp_tables', 'devices', 'device_descr', $$'descr starting from jan 1'$$, 'device_id', $$1$$, '[2020-01-01, infinity)', '[now(), infinity)' );
Warning
Update vs Correction:
ll_bitemporal_updatecreates new temporal versions. To correct errant data without versioning history, usell_bitemporal_correction.- Parameters:
p_schema_name – [in] text Schema name containing the bitemporal table.
p_table_name – [in] text Target table name.
p_list_of_fields – [in] text Comma-separated column names to update.
p_list_of_values – [in] text Comma-separated literal values for updated columns.
p_search_fields – [in] text Comma-separated list of search columns in WHERE clause.
p_search_values – [in] text Comma-separated literal search values.
p_effective – [in] temporal_relationships.timeperiod Business effective range of the update.
p_asserted – [in] temporal_relationships.timeperiod System assertion range for the update.
- Throws EXCEPTION:
‘Asserted interval starts in the past or has a finite end’ if
p_assertedlower bound is before current date or upper bound is finite.- Throws EXCEPTION:
‘Empty list of fields for a table’ if table metadata lookup fails.
- Returns:
integer Count of updated records.
- Pre:
Target table must be a valid bitemporal table.
- Post:
Closes assertion period on matching active records and inserts new assertion version with updated effective ranges and attribute values.
-
INTEGER ll_bitemporal_update_select(text p_table, text p_list_of_fields, TEXT p_values_selected_update, TEXT p_search_fields, TEXT p_values_selected_search, timeperiod p_effective, timeperiod p_asserted)#
Performs bitemporal update where values and search conditions are supplied by SELECT subqueries (qualified table signature).
See also
- Parameters:
p_table – [in] text Bitemporal table name (
<schema>.<table_name>).p_list_of_fields – [in] text Comma-separated column names to update.
p_values_selected_update – [in] text SELECT query string providing updated values.
p_search_fields – [in] text Comma-separated list of search columns in WHERE clause.
p_values_selected_search – [in] text SELECT query string supplying search criteria.
p_effective – [in] temporal_relationships.timeperiod Effective range of the update.
p_asserted – [in] temporal_relationships.timeperiod Assertion range for the update.
- Throws EXCEPTION:
‘Asserted interval starts in the past or has a finite end’ if
p_assertedbounds are invalid.- Returns:
integer Count of updated records.
- Pre:
Target table must be a valid bitemporal table.
- Post:
Updates target records using subquery dataset.
-
INTEGER ll_bitemporal_update_select(text p_schema_name, text p_table_name, text p_list_of_fields, TEXT p_values_selected_update, TEXT p_search_fields, TEXT p_values_selected_search, timeperiod p_effective, timeperiod p_asserted)
Performs bitemporal update where values and search conditions are supplied by SELECT subqueries (separate schema and table signature).
See also
- Example
SELECT * FROM bitemporal_internal.ll_bitemporal_update_select( 'bitemp_tables', 'devices', 'device_descr', $$SELECT device_descr FROM regular_tables.new_devices d WHERE device_id=t.device_id$$, 'device_id', $$SELECT device_id FROM regular_tables.new_devices$$, temporal_relationships.timeperiod(now(), infinity), temporal_relationships.timeperiod(now(), infinity) );
- Parameters:
p_schema_name – [in] text Name of the schema.
p_table_name – [in] text Name of the bitemporal table.
p_list_of_fields – [in] text Comma-separated list of columns to update.
p_values_selected_update – [in] text SELECT query string providing updated values.
p_search_fields – [in] text Comma-separated list of search columns in WHERE clause.
p_values_selected_search – [in] text SELECT query string supplying search criteria.
p_effective – [in] temporal_relationships.timeperiod Effective range of the update.
p_asserted – [in] temporal_relationships.timeperiod Assertion range for the update.
- Throws EXCEPTION:
‘Asserted interval starts in the past or has a finite end’ if
p_assertedbounds are invalid.- Returns:
integer Count of updated records.
- Pre:
Target table must be a valid bitemporal table.
- Post:
Updates target records using subquery dataset.
Temporal Interval Relationships#
Simple Allen Relationships#
-
boolean has_starts(timeperiod a, timeperiod b)#
Evaluates whether two time periods share the same start endpoint (
[Starts]or[Starts^-1]).Evaluates whether two time periods start at the exact same instant but end at different times.
[starts A B] A |---| B |-------| [starts^-1 A B] A |-------| B |---|
See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Both time periods start at the same timestamp but have different end timestamps.
false – Start timestamps differ, or both start and end timestamps match.
-
boolean has_finishes(timeperiod a, timeperiod b)#
Evaluates whether two time periods share the same end endpoint (
[Finishes]or[Finishes^-1]).Evaluates whether two time periods finish at the exact same instant but start at different times.
[finishes A B] A |-------| B |---| [finishes^-1 A B] A |---| B |-------|
See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Both time periods finish at the same timestamp but have different start timestamps.
false – End timestamps differ, or both start and end timestamps match.
-
boolean equals(timeperiod a, timeperiod b)#
Evaluates whether two time periods are identical (
[Equals]).Evaluates whether two time periods start and end at the exact same timestamps.
[equals A B] A |----| B |----|
See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Both start and end endpoints are identical.
false – Endpoints differ.
During Allen Relationships#
-
boolean is_during(timeperiod a, timeperiod b)#
Evaluates whether time period A is strictly during time period B (
[During]).Returns true if period A starts strictly after period B starts and finishes strictly before period B finishes.
[during A B] A |---| B |-------|
See also
- Parameters:
a – [in] timeperiod Subject time period.
b – [in] timeperiod Container time period.
- Return values:
true – Period A is strictly contained inside period B.
false – Period A is not strictly inside period B.
-
boolean is_contained_in(timeperiod a, timeperiod b)#
Evaluates whether time period A contains time period B strictly (
[During^-1]).Inverse of
is_during(a, b). Returns true if period B is strictly inside period A.[during^-1 A B] A |-------| B |---|
See also
- Parameters:
a – [in] timeperiod Container time period.
b – [in] timeperiod Subject time period.
- Return values:
true – Period B is strictly contained inside period A.
false – Period B is not strictly inside period A.
-
boolean has_during(timeperiod a, timeperiod b)#
Evaluates whether either period is strictly during the other (
[During]or[During^-1]).See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Either period A is during period B or period B is during period A.
false – Neither period is strictly during the other.
Overlaps Allen Relationships#
-
boolean is_overlaps(timeperiod a, timeperiod b)#
Evaluates whether time period A starts before and overlaps into time period B (
[Overlaps]).Returns true if period A starts before period B, ends after period B starts, and ends before period B finishes.
[overlaps A B] A |-----| B |-----|
See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Period A overlaps period B.
false – Period A does not overlap period B.
-
boolean has_overlaps(timeperiod a, timeperiod b)#
Evaluates whether either time period overlaps the other (
[Overlaps]or[Overlaps^-1]).See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Either period A overlaps period B or period B overlaps period A.
false – Neither period overlaps the other.
Before & After Allen Relationships#
-
boolean is_before(timeperiod a, timeperiod b)#
Evaluates whether time period A strictly precedes time period B (
[Before]).Returns true if period A finishes strictly before period B starts (with a gap between them).
[before A B] A |-----| B |-----|
See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Period A ends strictly before period B starts.
false – Period A does not end before period B starts.
-
boolean is_after(timeperiod a, timeperiod b)#
Evaluates whether time period A strictly succeeds time period B (
[Before^-1]).Inverse of
is_before(a, b). Returns true if period B finishes strictly before period A starts.[before^-1 A B] A |-----| B |-----|
See also
- Parameters:
a – [in] timeperiod Subject time period.
b – [in] timeperiod Preceding time period.
- Return values:
true – Period A starts strictly after period B finishes.
false – Period A does not start after period B finishes.
-
boolean has_before(timeperiod a, timeperiod b)#
Evaluates whether either period is strictly before the other (
[Before]or[Before^-1]).See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Either period A is before period B or period B is before period A.
false – The periods overlap or touch.
Meets Allen Relationships#
-
boolean is_meets(timeperiod a, timeperiod b)#
Evaluates whether time period A meets time period B seamlessly without gap or overlap (
[Meets]).Returns true if the end timestamp of period A equals the start timestamp of period B.
[meets A B] A |-----| B |-----|
See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Period A finishes exactly when period B starts.
false – End of A does not equal start of B.
-
boolean has_meets(timeperiod a, timeperiod b)#
Evaluates whether two time periods meet in either direction (
[Meets]or[Meets^-1]).See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – End of A equals start of B, or end of B equals start of A.
false – Neither boundary meets.
Binary Partition Groups#
-
boolean has_includes(timeperiod a, timeperiod b)#
Evaluates the
[Includes]binary partition group.Evaluates whether two periods fall into the
[Includes]partition, which encompasses[Contains]or[Overlaps].See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Relationship is in
[Includes]partition.false – Relationship is excluded from
[Includes].
-
boolean has_contains(timeperiod a, timeperiod b)#
Evaluates the
[Contains]binary partition group.Evaluates whether two periods fall into the
[Contains]partition, which encompasses[Encloses]or[Equals].See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Relationship is in
[Contains]partition.false – Relationship is excluded from
[Contains].
-
boolean has_aligns_with(timeperiod a, timeperiod b)#
Evaluates the
[Aligns With]binary partition group.Evaluates whether two periods fall into the
[Aligns With]partition, which encompasses[Starts]or[Finishes].See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Relationship is in
[Aligns With]partition.false – Relationship is excluded from
[Aligns With].
-
boolean has_encloses(timeperiod a, timeperiod b)#
Evaluates the
[Encloses]binary partition group.Evaluates whether two periods fall into the
[Encloses]partition, which encompasses[Aligns With]or[During].See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Relationship is in
[Encloses]partition.false – Relationship is excluded from
[Encloses].
-
boolean has_excludes(timeperiod a, timeperiod b)#
Evaluates the
[Excludes]binary partition group.Evaluates whether two periods fall into the
[Excludes]partition, which encompasses[Before]or[Meets].See also
- Parameters:
a – [in] timeperiod First time period.
b – [in] timeperiod Second time period.
- Return values:
true – Relationship is in
[Excludes]partition (periods are disjoint or touching only at boundary).false – Periods overlap or enclose each other.
Support Utilities & Constructors#
-
timeperiod timeperiod(time_endpoint p_range_start, time_endpoint p_range_end)#
Constructs a
timeperiodinterval range from start and end endpoints.- Parameters:
p_range_start – [in] time_endpoint Start endpoint timestamp.
p_range_end – [in] time_endpoint End endpoint timestamp.
- Returns:
timeperiod Range constructed as
[p_range_start, p_range_end).
-
timeperiod timeperiod_range(time_endpoint _s, time_endpoint _e, text _ignored)#
Backwards compatible range constructor function.
- Parameters:
_s – [in] time_endpoint Start endpoint timestamp.
_e – [in] time_endpoint End endpoint timestamp.
_ignored – [in] text Ignored parameter maintained for compatibility.
- Returns:
timeperiod Range constructed via
timeperiod(_s, _e).
-
boolean xor(boolean a, boolean b)#
Logical exclusive-OR (XOR) function.
- Parameters:
a – [in] boolean First boolean operand.
b – [in] boolean Second boolean operand.
- Return values:
true – Exactly one operand is true.
false – Both operands are true or both are false.
-
anyelement fst(anyrange x)#
Returns the lower bound (first element) of a range.
- Parameters:
x – [in] anyrange Input range.
- Returns:
anyelement Lower bound element of the range.
-
anyelement snd(anyrange x)#
Returns the upper bound (second element) of a range.
- Parameters:
x – [in] anyrange Input range.
- Returns:
anyelement Upper bound element of the range.