pg_later

pg_later

pg_later : Run queries now and get results later

Overview

ID Extension Package Version Category License Language
1090
pg_later
pg_later
0.4.0
TIME
PostgreSQL
Rust
Attribute Has Binary Has Library Need Load Has DDL Relocatable Trusted
--sLd--
No
Yes
Yes
Yes
no
no
Relationships
Schemas pglater
Requires
pgmq
See Also
pg_cron
pg_task
pg_background
timescaledb
timescaledb_toolkit
timeseries
periods
temporal_tables

Packages

Type Repo Version PG Major Compatibility Package Pattern Dependencies
EXT
PIGSTY
0.4.0
18
17
16
15
14
pg_later pgmq
RPM
PIGSTY
0.4.0
18
17
16
15
14
pg_later_$v pgmq_$v
DEB
PIGSTY
0.4.0
18
17
16
15
14
postgresql-$v-pg-later postgresql-$v-pgmq
Linux / PG PG18 PG17 PG16 PG15 PG14
el8.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
el8.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
el9.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
el9.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
el10.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
el10.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
d12.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
d12.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
d13.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
d13.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
u22.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
u22.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
u24.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
u24.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
Package Version OS ORG SIZE File URL
pg_later_18 0.4.0 el8.x86_64 pigsty 1.5 MiB pg_later_18-0.4.0-1PIGSTY.el8.x86_64.rpm
pg_later_18 0.4.0 el8.aarch64 pigsty 1.3 MiB pg_later_18-0.4.0-1PIGSTY.el8.aarch64.rpm
pg_later_18 0.4.0 el9.x86_64 pigsty 1.5 MiB pg_later_18-0.4.0-1PIGSTY.el9.x86_64.rpm
pg_later_18 0.4.0 el9.aarch64 pigsty 1.4 MiB pg_later_18-0.4.0-1PIGSTY.el9.aarch64.rpm
pg_later_18 0.4.0 el10.x86_64 pigsty 1.5 MiB pg_later_18-0.4.0-1PIGSTY.el10.x86_64.rpm
pg_later_18 0.4.0 el10.aarch64 pigsty 1.4 MiB pg_later_18-0.4.0-1PIGSTY.el10.aarch64.rpm
postgresql-18-pg-later 0.4.0 d12.x86_64 pigsty 1.2 MiB postgresql-18-pg-later_0.4.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-pg-later 0.4.0 d12.aarch64 pigsty 991.3 KiB postgresql-18-pg-later_0.4.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-pg-later 0.4.0 d13.x86_64 pigsty 1.2 MiB postgresql-18-pg-later_0.4.0-1PIGSTY~trixie_amd64.deb
postgresql-18-pg-later 0.4.0 d13.aarch64 pigsty 991.1 KiB postgresql-18-pg-later_0.4.0-1PIGSTY~trixie_arm64.deb
postgresql-18-pg-later 0.4.0 u22.x86_64 pigsty 1.3 MiB postgresql-18-pg-later_0.4.0-1PIGSTY~jammy_amd64.deb
postgresql-18-pg-later 0.4.0 u22.aarch64 pigsty 1.1 MiB postgresql-18-pg-later_0.4.0-1PIGSTY~jammy_arm64.deb
postgresql-18-pg-later 0.4.0 u24.x86_64 pigsty 1.3 MiB postgresql-18-pg-later_0.4.0-1PIGSTY~noble_amd64.deb
postgresql-18-pg-later 0.4.0 u24.aarch64 pigsty 1.1 MiB postgresql-18-pg-later_0.4.0-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_later_17 0.4.0 el8.x86_64 pigsty 1.5 MiB pg_later_17-0.4.0-1PIGSTY.el8.x86_64.rpm
pg_later_17 0.4.0 el8.aarch64 pigsty 1.3 MiB pg_later_17-0.4.0-1PIGSTY.el8.aarch64.rpm
pg_later_17 0.4.0 el9.x86_64 pigsty 1.5 MiB pg_later_17-0.4.0-1PIGSTY.el9.x86_64.rpm
pg_later_17 0.4.0 el9.aarch64 pigsty 1.4 MiB pg_later_17-0.4.0-1PIGSTY.el9.aarch64.rpm
pg_later_17 0.4.0 el10.x86_64 pigsty 1.5 MiB pg_later_17-0.4.0-1PIGSTY.el10.x86_64.rpm
pg_later_17 0.4.0 el10.aarch64 pigsty 1.4 MiB pg_later_17-0.4.0-1PIGSTY.el10.aarch64.rpm
postgresql-17-pg-later 0.4.0 d12.x86_64 pigsty 1.2 MiB postgresql-17-pg-later_0.4.0-1PIGSTY~bookworm_amd64.deb
postgresql-17-pg-later 0.4.0 d12.aarch64 pigsty 990.9 KiB postgresql-17-pg-later_0.4.0-1PIGSTY~bookworm_arm64.deb
postgresql-17-pg-later 0.4.0 d13.x86_64 pigsty 1.2 MiB postgresql-17-pg-later_0.4.0-1PIGSTY~trixie_amd64.deb
postgresql-17-pg-later 0.4.0 d13.aarch64 pigsty 991.4 KiB postgresql-17-pg-later_0.4.0-1PIGSTY~trixie_arm64.deb
postgresql-17-pg-later 0.4.0 u22.x86_64 pigsty 1.3 MiB postgresql-17-pg-later_0.4.0-1PIGSTY~jammy_amd64.deb
postgresql-17-pg-later 0.4.0 u22.aarch64 pigsty 1.1 MiB postgresql-17-pg-later_0.4.0-1PIGSTY~jammy_arm64.deb
postgresql-17-pg-later 0.4.0 u24.x86_64 pigsty 1.3 MiB postgresql-17-pg-later_0.4.0-1PIGSTY~noble_amd64.deb
postgresql-17-pg-later 0.4.0 u24.aarch64 pigsty 1.1 MiB postgresql-17-pg-later_0.4.0-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_later_16 0.4.0 el8.x86_64 pigsty 1.5 MiB pg_later_16-0.4.0-1PIGSTY.el8.x86_64.rpm
pg_later_16 0.4.0 el8.aarch64 pigsty 1.3 MiB pg_later_16-0.4.0-1PIGSTY.el8.aarch64.rpm
pg_later_16 0.4.0 el9.x86_64 pigsty 1.5 MiB pg_later_16-0.4.0-1PIGSTY.el9.x86_64.rpm
pg_later_16 0.4.0 el9.aarch64 pigsty 1.4 MiB pg_later_16-0.4.0-1PIGSTY.el9.aarch64.rpm
pg_later_16 0.4.0 el10.x86_64 pigsty 1.5 MiB pg_later_16-0.4.0-1PIGSTY.el10.x86_64.rpm
pg_later_16 0.4.0 el10.aarch64 pigsty 1.4 MiB pg_later_16-0.4.0-1PIGSTY.el10.aarch64.rpm
postgresql-16-pg-later 0.4.0 d12.x86_64 pigsty 1.2 MiB postgresql-16-pg-later_0.4.0-1PIGSTY~bookworm_amd64.deb
postgresql-16-pg-later 0.4.0 d12.aarch64 pigsty 990.6 KiB postgresql-16-pg-later_0.4.0-1PIGSTY~bookworm_arm64.deb
postgresql-16-pg-later 0.4.0 d13.x86_64 pigsty 1.2 MiB postgresql-16-pg-later_0.4.0-1PIGSTY~trixie_amd64.deb
postgresql-16-pg-later 0.4.0 d13.aarch64 pigsty 990.7 KiB postgresql-16-pg-later_0.4.0-1PIGSTY~trixie_arm64.deb
postgresql-16-pg-later 0.4.0 u22.x86_64 pigsty 1.3 MiB postgresql-16-pg-later_0.4.0-1PIGSTY~jammy_amd64.deb
postgresql-16-pg-later 0.4.0 u22.aarch64 pigsty 1.1 MiB postgresql-16-pg-later_0.4.0-1PIGSTY~jammy_arm64.deb
postgresql-16-pg-later 0.4.0 u24.x86_64 pigsty 1.3 MiB postgresql-16-pg-later_0.4.0-1PIGSTY~noble_amd64.deb
postgresql-16-pg-later 0.4.0 u24.aarch64 pigsty 1.1 MiB postgresql-16-pg-later_0.4.0-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_later_15 0.4.0 el8.x86_64 pigsty 1.5 MiB pg_later_15-0.4.0-1PIGSTY.el8.x86_64.rpm
pg_later_15 0.4.0 el8.aarch64 pigsty 1.3 MiB pg_later_15-0.4.0-1PIGSTY.el8.aarch64.rpm
pg_later_15 0.4.0 el9.x86_64 pigsty 1.5 MiB pg_later_15-0.4.0-1PIGSTY.el9.x86_64.rpm
pg_later_15 0.4.0 el9.aarch64 pigsty 1.4 MiB pg_later_15-0.4.0-1PIGSTY.el9.aarch64.rpm
pg_later_15 0.4.0 el10.x86_64 pigsty 1.5 MiB pg_later_15-0.4.0-1PIGSTY.el10.x86_64.rpm
pg_later_15 0.4.0 el10.aarch64 pigsty 1.4 MiB pg_later_15-0.4.0-1PIGSTY.el10.aarch64.rpm
postgresql-15-pg-later 0.4.0 d12.x86_64 pigsty 1.2 MiB postgresql-15-pg-later_0.4.0-1PIGSTY~bookworm_amd64.deb
postgresql-15-pg-later 0.4.0 d12.aarch64 pigsty 992.4 KiB postgresql-15-pg-later_0.4.0-1PIGSTY~bookworm_arm64.deb
postgresql-15-pg-later 0.4.0 d13.x86_64 pigsty 1.2 MiB postgresql-15-pg-later_0.4.0-1PIGSTY~trixie_amd64.deb
postgresql-15-pg-later 0.4.0 d13.aarch64 pigsty 990.8 KiB postgresql-15-pg-later_0.4.0-1PIGSTY~trixie_arm64.deb
postgresql-15-pg-later 0.4.0 u22.x86_64 pigsty 1.3 MiB postgresql-15-pg-later_0.4.0-1PIGSTY~jammy_amd64.deb
postgresql-15-pg-later 0.4.0 u22.aarch64 pigsty 1.1 MiB postgresql-15-pg-later_0.4.0-1PIGSTY~jammy_arm64.deb
postgresql-15-pg-later 0.4.0 u24.x86_64 pigsty 1.3 MiB postgresql-15-pg-later_0.4.0-1PIGSTY~noble_amd64.deb
postgresql-15-pg-later 0.4.0 u24.aarch64 pigsty 1.1 MiB postgresql-15-pg-later_0.4.0-1PIGSTY~noble_arm64.deb
Package Version OS ORG SIZE File URL
pg_later_14 0.4.0 el8.x86_64 pigsty 1.5 MiB pg_later_14-0.4.0-1PIGSTY.el8.x86_64.rpm
pg_later_14 0.4.0 el8.aarch64 pigsty 1.3 MiB pg_later_14-0.4.0-1PIGSTY.el8.aarch64.rpm
pg_later_14 0.4.0 el9.x86_64 pigsty 1.5 MiB pg_later_14-0.4.0-1PIGSTY.el9.x86_64.rpm
pg_later_14 0.4.0 el9.aarch64 pigsty 1.4 MiB pg_later_14-0.4.0-1PIGSTY.el9.aarch64.rpm
pg_later_14 0.4.0 el10.x86_64 pigsty 1.5 MiB pg_later_14-0.4.0-1PIGSTY.el10.x86_64.rpm
pg_later_14 0.4.0 el10.aarch64 pigsty 1.4 MiB pg_later_14-0.4.0-1PIGSTY.el10.aarch64.rpm
postgresql-14-pg-later 0.4.0 d12.x86_64 pigsty 1.2 MiB postgresql-14-pg-later_0.4.0-1PIGSTY~bookworm_amd64.deb
postgresql-14-pg-later 0.4.0 d12.aarch64 pigsty 990.9 KiB postgresql-14-pg-later_0.4.0-1PIGSTY~bookworm_arm64.deb
postgresql-14-pg-later 0.4.0 d13.x86_64 pigsty 1.2 MiB postgresql-14-pg-later_0.4.0-1PIGSTY~trixie_amd64.deb
postgresql-14-pg-later 0.4.0 d13.aarch64 pigsty 991.7 KiB postgresql-14-pg-later_0.4.0-1PIGSTY~trixie_arm64.deb
postgresql-14-pg-later 0.4.0 u22.x86_64 pigsty 1.3 MiB postgresql-14-pg-later_0.4.0-1PIGSTY~jammy_amd64.deb
postgresql-14-pg-later 0.4.0 u22.aarch64 pigsty 1.1 MiB postgresql-14-pg-later_0.4.0-1PIGSTY~jammy_arm64.deb
postgresql-14-pg-later 0.4.0 u24.x86_64 pigsty 1.3 MiB postgresql-14-pg-later_0.4.0-1PIGSTY~noble_amd64.deb
postgresql-14-pg-later 0.4.0 u24.aarch64 pigsty 1.1 MiB postgresql-14-pg-later_0.4.0-1PIGSTY~noble_arm64.deb

Source

pig build pkg pg_later;# build rpm/deb

Install

Make sure PGDG and PIGSTY repo available:

pig repo add pgsql -u # add both repo and update cache

Install this extension with pig:

pig install pg_later;# install via package name, for the active PG version  pig install pg_later -v 18; # install for PG 18 pig install pg_later -v 17; # install for PG 17 pig install pg_later -v 16; # install for PG 16 pig install pg_later -v 15; # install for PG 15 pig install pg_later -v 14; # install for PG 14

Config this extension to shared_preload_libraries:

shared_preload_libraries = 'pg_later';

Create this extension with:

CREATE EXTENSION pg_later CASCADE; -- requires pgmq

Usage

pg_later: Execute SQL now and get the results later

A PostgreSQL extension to execute queries asynchronously. Built on pgmq.

Getting Started

Initialize the extension’s backend:

CREATE EXTENSION pg_later CASCADE; SELECT pglater.init();

Execute a SQL query now:

SELECT pglater.exec(  'SELECT * FROM pg_available_extensions ORDER BY name LIMIT 2' ) AS job_id;
 job_id --------  1

Come back at some later time, and retrieve the results by providing the job id:

SELECT pglater.fetch_results(1);
{  "query": "select * from pg_available_extensions order by name limit 2",  "job_id": 1,  "result": [  {  "name": "adminpack",  "comment": "administrative functions for PostgreSQL",  "default_version": "2.1",  "installed_version": null  },  {  "name": "amcheck",  "comment": "functions for verifying relation integrity",  "default_version": "1.3",  "installed_version": null  }  ],  "status": "success" }
Last updated on