Skip to content
pg_later

pg_later

pg_later : Run queries now and get results later

Overview

IDExtensionPackageVersionCategoryLicenseLanguage
1090
pg_later
pg_later
0.4.0
TIME
PostgreSQL
Rust
AttributeHas BinaryHas LibraryNeed LoadHas DDLRelocatableTrusted
--sLd--
No
Yes
Yes
Yes
no
no
Relationships
Schemaspglater
Requires
pgmq
See Also
pg_cron
pg_task
pg_background
timescaledb
timescaledb_toolkit
timeseries
periods
temporal_tables

Packages

TypeRepoVersionPG Major CompatibilityPackage PatternDependencies
EXT
PIGSTY
0.4.0
18
17
16
15
14
pg_laterpgmq
RPM
PIGSTY
0.4.0
18
17
16
15
14
pg_later_$vpgmq_$v
DEB
PIGSTY
0.4.0
18
17
16
15
14
postgresql-$v-pg-laterpostgresql-$v-pgmq
Linux / PGPG18PG17PG16PG15PG14
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
u26.x86_64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
u26.aarch64
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PIGSTY 0.4.0
PackageVersionOSORGSIZEFile URL
pg_later_180.4.0el8.x86_64pigsty1.5 MiBpg_later_18-0.4.0-1PIGSTY.el8.x86_64.rpm
pg_later_180.4.0el8.aarch64pigsty1.3 MiBpg_later_18-0.4.0-1PIGSTY.el8.aarch64.rpm
pg_later_180.4.0el9.x86_64pigsty1.5 MiBpg_later_18-0.4.0-1PIGSTY.el9.x86_64.rpm
pg_later_180.4.0el9.aarch64pigsty1.4 MiBpg_later_18-0.4.0-1PIGSTY.el9.aarch64.rpm
pg_later_180.4.0el10.x86_64pigsty1.5 MiBpg_later_18-0.4.0-1PIGSTY.el10.x86_64.rpm
pg_later_180.4.0el10.aarch64pigsty1.4 MiBpg_later_18-0.4.0-1PIGSTY.el10.aarch64.rpm
postgresql-18-pg-later0.4.0d12.x86_64pigsty1.2 MiBpostgresql-18-pg-later_0.4.0-1PIGSTY~bookworm_amd64.deb
postgresql-18-pg-later0.4.0d12.aarch64pigsty991.3 KiBpostgresql-18-pg-later_0.4.0-1PIGSTY~bookworm_arm64.deb
postgresql-18-pg-later0.4.0d13.x86_64pigsty1.2 MiBpostgresql-18-pg-later_0.4.0-1PIGSTY~trixie_amd64.deb
postgresql-18-pg-later0.4.0d13.aarch64pigsty991.1 KiBpostgresql-18-pg-later_0.4.0-1PIGSTY~trixie_arm64.deb
postgresql-18-pg-later0.4.0u22.x86_64pigsty1.3 MiBpostgresql-18-pg-later_0.4.0-1PIGSTY~jammy_amd64.deb
postgresql-18-pg-later0.4.0u22.aarch64pigsty1.1 MiBpostgresql-18-pg-later_0.4.0-1PIGSTY~jammy_arm64.deb
postgresql-18-pg-later0.4.0u24.x86_64pigsty1.3 MiBpostgresql-18-pg-later_0.4.0-1PIGSTY~noble_amd64.deb
postgresql-18-pg-later0.4.0u24.aarch64pigsty1.1 MiBpostgresql-18-pg-later_0.4.0-1PIGSTY~noble_arm64.deb
postgresql-18-pg-later0.4.0u26.x86_64pigsty2.7 MiBpostgresql-18-pg-later_0.4.0-2PIGSTY~resolute_amd64.deb
postgresql-18-pg-later0.4.0u26.aarch64pigsty2.5 MiBpostgresql-18-pg-later_0.4.0-2PIGSTY~resolute_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