News for hackers. Stuff that matters.
Re:Reactive PostgreSQL for Meteor by netghost on Thursday April 16, 2015 @11:02AM (#9388376)
If you're not using meteor, but are interested in using this in node, take a look at the library it's built on: https://github.com/numtel/pg-live-select

At a glance it looks like it creates triggers on the fly and tears them down. I'm curious how scaleable this is, is trigger creation a locking activity in postgres?

Re:Reactive PostgreSQL for Meteor by buckbova on Thursday April 16, 2015 @12:03PM (#9388880)
Creating views and triggers on the fly does sound like insanity. There's got to be a better way.
Re:Reactive PostgreSQL for Meteor by nunwuo on Thursday April 16, 2015 @12:17PM (#9388963)
There is: logical decoding http://www.postgresql.org/docs/9.4/static/logicaldecoding.ht... I wonder why the author chose to waste time on this instead of doing things the proper way.
Re:Reactive PostgreSQL for Meteor by numtel on Thursday April 16, 2015 @06:32PM (#9391118)
See this issue: https://github.com/numtel/pg-live-select/issues/1

I would love to see a pull request for the "proper way." Thank you for your help.

Re:Reactive PostgreSQL for Meteor by justinsb on Thursday April 16, 2015 @02:02PM (#9389636)
Logical decoding was only recently added in Postgres (9.4)? I'm not sure on the privileges required for logical decoding in postgres, but typically it requires 'root' access because it lets you see all the data in the system. So triggers can often be used on a shared database, where you might not be allowed to access the transaction log.
Re:Reactive PostgreSQL for Meteor by ivarv on Thursday April 16, 2015 @01:03PM (#9389244)
I'd guess ignorance? I'd never heard of 'logical decoding' before and the name of the feature doesn't lend itself to easy understanding.

That said, thanks for pointing this out - it looks like yet another very useful PG feature!

Re:Reactive PostgreSQL for Meteor by hammerandtongs on Thursday April 16, 2015 @01:13PM (#9389314)
At times it feels as if the entire Nosql industry was created by people not reading the Postgresql manual.

edit: thanks for the link to logical decoding, looks very useful.

Re:Reactive PostgreSQL for Meteor by 15155 on Thursday April 16, 2015 @12:15PM (#9388954)
Create triggers, fire all events off to a proper message broker for fanout.

Events can be triggered directly in PG using an extension for AMQP or something, or in a standalone service, using whatever you can dream up.

Re:Reactive PostgreSQL for Meteor by justinsb on Thursday April 16, 2015 @01:50PM (#9389564)
I think it's great to see this. I was really impressed by the insight/design of allowing the user to specify the invalidation functions, rather than trying to solve the (very difficult) problem of automatically determining the exact set of invalidation criteria. It may be that the user can determine a better invalidation function anyway, because they have domain-specific knowledge (e.g. how often a table changes).

(I'm a meteorite, but commenting in my personal capacity)

Re:Reactive PostgreSQL for Meteor by pinouchon on Thursday April 16, 2015 @01:47PM (#9389548)
Whether this is the right approach or not, I'm glad to see people trying to make the meteor sql support happen. Many people aren't really to adopt Meteor unless it has sql support.
Re:Reactive PostgreSQL for Meteor by Ciantic on Thursday April 16, 2015 @12:57PM (#9389202)
There was (or is?) also fork of PostgreSQL which implemented streamed queries.

It was way ahead it's time, maybe it's dead by now. But they still have the site here, weirdly named TelegraphCQ: http://telegraph.cs.berkeley.edu/

Direct link to 2.1 last version: http://telegraph.cs.berkeley.edu/telegraphcq/v2.1/

Re:Reactive PostgreSQL for Meteor by numtel on Thursday April 16, 2015 @06:35PM (#9391125)
Interesting... I'll take a look at this.

It would be awesome to write a Postgres extension in C to implement Live Selects directly. Due to this project's developmental legacy this was considered from the start but is definitely on my radar.

Re:Reactive PostgreSQL for Meteor by McDoogle on Thursday April 16, 2015 @01:42PM (#9389503)
This is a cool hack, but no latency compensation or database only on the server. I would rather use a package that adhered to the core principles of Meteor.
Re:Reactive PostgreSQL for Meteor by taylorwc on Thursday April 16, 2015 @01:46PM (#9389543)
Agreed. Can't wait for the baked-in psql support in Meteor.
Re:Reactive PostgreSQL for Meteor by joeyspn on Thursday April 16, 2015 @10:44AM (#9388235)
Looks great! Does this have something to do with the official SQL support that Mateor has in the pipeline?
Re:Reactive PostgreSQL for Meteor by Everhusk on Thursday April 16, 2015 @10:59AM (#9388354)
I don't think this was developed by MDG [1]. Just as amazing work though!

[1] Author - https://numtel.github.io/