A PostgreSQL extension providing simplified time-series utilities.
pgtime aims to simplify common tasks associated with time-series data in PostgreSQL. It includes features such as:
- Automatic Time-Based Partitioning: Helper functions to manage time-partitioned tables.
- Time-Series Aggregates: Custom aggregate functions useful for time-series analysis (e.g., gap-filling).
- Background Worker: A background worker process (details on its specific function TBD, possibly for maintenance or continuous aggregation).
- PostgreSQL (version compatibility TBD - requires development libraries for building)
pg_cronextension (required for certain features, like scheduled aggregation helpers)
Ensure you have PostgreSQL installed, along with its development headers (e.g., postgresql-server-dev-XX on Debian/Ubuntu, postgresql-devel on RHEL/CentOS). You also need the pg_cron extension installed and enabled in your target database.
- Make sure
pg_configis in yourPATH. - Clone the repository (if applicable).
- Navigate to the extension's source directory.
- Run the standard PGXS build commands:
make sudo make install
- Enable
pg_cron: If not already done, runCREATE EXTENSION IF NOT EXISTS pg_cron;in your database. - Enable
pgtime: Connect to your target database as a superuser and run:CREATE EXTENSION pgtime;
- Configure Server: Add
pgtimeto theshared_preload_librariessetting in yourpostgresql.conffile:shared_preload_libraries = 'pg_cron,pgtime' # Add pgtime, preserving existing entries
- Restart PostgreSQL: A server restart is required for the changes in
shared_preload_librariesto take effect.
This extension provides SQL functions and potentially custom types/operators.
- Explore the functions and objects created by the extension by examining the
pgtime--0.1.sqlfile. - Refer to the regression tests (e.g.,
test/sql/basic_usage.sqlandtest/expected/basic_usage.outif present) for practical examples.
Contributions are welcome! We appreciate bug reports, feature requests, and pull requests.
- Bug Reports & Feature Requests: Please submit these via the GitHub Issues page. Provide as much detail as possible, including steps to reproduce for bugs.
- Pull Requests:
- Fork the repository.
- Create a new branch for your feature or bug fix (
git checkout -b feature/your-feature-nameorgit checkout -b fix/issue-number). - Make your changes. Write clear, concise commit messages.
- Ensure any new code is covered by tests if applicable.
- Update documentation if necessary.
- Push your branch and submit a pull request to the main repository via the GitHub Pull Requests page.
We aim to review contributions promptly.
This project is licensed under the MIT License - see the LICENSE file for details.