Skip to content

Igr1x/pg_temporal

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

29 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pg_temporal

Key Features

This extension implements a logic and data manipulation engine based on Allen’s Interval Algebra and C.J. Date’s extended relational operators. These features enable expressive temporal reasoning and manipulation of complex, nested relational data structures.

  • Allen’s Interval Algebra Provides 15 basic temporal interval operations used to compare time intervals. These are essential for reasoning about temporal data in scheduling, planning, and history-aware systems
  • Extended Relational Operators (C.J. Date) Inspired by the work of C.J. Date, operators for representation of the collapsed (PACK) and expanded (UNPACK) form of a relation with an attribute of interval type are realized Also implemented operators U_MINUS, U_EQUALS, U_INTERSECT and U_UNION, which are generalizations over standard operators.

System Requirements

  • A Rust toolchain: rustc, cargo, and rustfmt. The recommended way to get these is from https://rustup.rs
  • git
  • libclang 11 or greater (for bindgen)
  • C compiler
    • Linux and MacOS: GCC or Clang if cshim feature is enabled, and no need if the cshim feature is disabled
    • Windows: MSVC or Clang
  • PostgreSQL's build dependencies
    • Debian-likes: sudo apt-get install build-essential libreadline-dev zlib1g-dev flex bison libxml2-dev libxslt-dev libssl-dev libxml2-utils xsltproc ccache pkg-config

Getting Started

1. Install dependencies

cargo install --locked cargo-pgrx
cargo pgrx init

2. Installextension in the local server PostgreSQL

cargo pgrx install -pg-config {PATH_TO_PG_CONFIG}

3. Build extension

cargo pgrx run

4. Create extension

CREATE EXTENSION pg_temporal;

Example

SELECT eq(daterange('2023-01-01', '2023-01-10'), daterange('2023-01-01', '2023-01-10'));

Testing

Run unit and integration tests:

cargo pgrx test

Contributing

Pull requests and feedback are welcome! Please feel free to file issues or join the discussion.

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages