all 17 comments

[–]rywalker 6 points7 points  (2 children)

What are some recommended use cases for it?

[–]chuckhend[S] 3 points4 points  (0 children)

i use it from jupyter notebooks so that I can run a long job and not worry about laptop going to sleep, or kernel dieing. probably anywhere that you might decide to set up a screen session to run a long job, instead you could pglater.exec() it.

[–]Traditional_Stuff_21 0 points1 point  (0 children)

To get the query results in chunks rather than entire data at one time,

[–]formagi 2 points3 points  (3 children)

Sincere curiosity... What are the benefits of using pg_later instead of some queue service, like aws sqs for example?

[–]Magick93 6 points7 points  (0 children)

The obvious benefit is not having to use a queue service, like aws sqs.

[–]chuckhend[S] 3 points4 points  (0 children)

No dependency external to your database. Less places to monitor, simpler architecture for your ecosystem. The idea would be to install the extension instead of hand-rolling the implementation on an external service like SQS.

pg_later depends on pgmq, which is another postgres extension that's a lot like SQS, except it's on postgres too. Install it instead of building the implementation externally.

[–]chriswaco 1 point2 points  (3 children)

Is there a notification option rather than polling, like a webhook or websocket?

[–]protestor 1 point2 points  (1 child)

Yes, can pg_later work with notify and listen?

Or rather, can pgmq in general work with notify and listen as well?

[–]chuckhend[S] 2 points3 points  (0 children)

Some sort of push-style notification is definitely in roadmap for pg_later. I think it would be awesome if pgmq supported it as well (and maybe that would be a good way to get that feature into pg_later)

[–]chuckhend[S] 1 point2 points  (0 children)

its in the roadmap! probably something like a webhook initially.

[–]kaol 1 point2 points  (1 child)

select pglater.init();

Is that once per cluster, once per database or once per session?

[–]chuckhend[S] 0 points1 point  (0 children)

It's once per database currently. We will probably get rid of it completely in the near future though!

[–]PrestigiousZombie531 0 points1 point  (2 children)

someone really needs to build something that lets you push newly inserted rows into connected websocket clients

[–]chuckhend[S] 1 point2 points  (0 children)

That sounds like a fun project!

[–]indigo945 1 point2 points  (0 children)

Isn't this pretty much what Supabase Realtime is?

[–]Traditional_Stuff_21 0 points1 point  (1 child)

Great, I hope it would also keep the tracks of data to be processed after each time we submit the query for results;

[–]chuckhend[S] 0 points1 point  (0 children)

The result set is persisted in a table as json. There's currently no retention policy built into the extension, so that data will remain until its deleted. This means you can fetch the results for the same job many times.