Re: NOTIFY with tuples - Mailing list pgsql-hackers

From Thomas Munro
Subject Re: NOTIFY with tuples
Date
Msg-id CADLWmXWMvo5JHh4hivCea7vZ8dUcMv+xAcbFgaw_gYqzg2bAjA@mail.gmail.com
Whole thread Raw
In response to Re: NOTIFY with tuples  (Merlin Moncure <mmoncure@gmail.com>)
List pgsql-hackers
On 14 December 2011 15:10, Merlin Moncure <mmoncure@gmail.com> wrote:
> As to the wider point I'm wondering why you can't layer your API on
> top of existing facilities (tables, notifications, etc). PGQ (have you
> seen that?) does this and it's an absolute marvel.  Meaning, I bet you
> could do this with an 'all sql (or plpgsql)' implementation.  That's a
> good thing -- C code significantly raises the bar in terms of putting
> your code in the hands of people who might be interested in using it.

Well I was interested in the idea of using the NOTIFY payload somehow
for high performance (it's not backed by a table that gets fsynced and
needs to be vacuumed etc, and it delivers data to clients without an
extra round trip), and I guess also really like the idea of streams
being first class objects in a kind of StreamSQL-lite language
extension.

But I've been playing around with Robert's suggestion, and I realised
that I can dress up the foo_read and foo_write functions (probably
written in pure plpgsql) with a VIEW so that I can INSERT and SELECT
tuples, and to be able to join it against other tables.  Here's what I
have working so far:

https://github.com/macdice/pg_stream/blob/master/hack.sql

I guess at this point this becomes off topic for pgsql-hackers.
Thanks all for the pointers and ideas.

PGQ looks interesting, I'll check it out.


pgsql-hackers by date:

Previous
From: Simon Riggs
Date:
Subject: Re: [REVIEW] pg_last_xact_insert_timestamp
Next
From: Tom Lane
Date:
Subject: Re: [PATCH] PostgreSQL fails to build with 32bit MinGW-w64