Re: [GENERAL] Equivalence Classes when using IN

2017-10-10 Thread Nico Williams
On Mon, Oct 09, 2017 at 07:44:50PM -0400, Tom Lane wrote: > David Rowley writes: > > If the only reason that is_simple_subquery() rejects subqueries with > > ORDER BY is due to wanting to keep the order by of a view, then > > couldn't we make is_simple_subquery() a

Re: [GENERAL] Postgresql CDC tool recommendations ?

2017-10-06 Thread Nico Williams
On Thu, Oct 05, 2017 at 10:28:31AM -0700, avi Singh wrote: > Any recommendation on a good CDC tool that can be used to push > postgresql changes to Kafka in json format ? There are quite a few WAL->JSON type tools out there. E.g., https://github.com/eulerto/wal2json I expect this to

Re: [GENERAL] time series data

2017-10-02 Thread Nico Williams
You have these choices: - turn events into INSERTs and UPDATES on a table that represents a single call You might have an events VIEW with INSTED OF insert/update triggers so you can insert events as the interface for updating calls. - store the events and have a VIEW on the events

[GENERAL] COMMIT TRIGGER implementation using CONSTRAINT TRIGGERs

2017-09-14 Thread Nico Williams
I've written an approximation of "commit triggers" for PostgreSQL using CONSTRAINT TRIGGERs (as users have often been told to do who want this feature). Semantics (and a warning) are included in commentary in the source: https://github.com/twosigma/postgresql-contrib/

Re: [GENERAL] Aquameta 0.1 - Request for reviews, contributors

2017-09-08 Thread Nico Williams
Here's a review comment. Just one for now. Looking at the meta module, I see things like this: execute 'select (count(*) = 1) from ' || quote_ident((row_id::meta.schema_id).name) || '.' || quote_ident((row_id::meta.relation_id).name) || ' where ' ||

Re: [GENERAL] Schema/table replication

2017-09-06 Thread Nico Williams
On Wed, Sep 06, 2017 at 08:22:14AM -0700, Steve Atkins wrote: > > On Sep 6, 2017, at 6:00 AM, Marcin Giedz wrote: > > > > Hi, is there any way (3rd party software) to replicate particular > > schema/table not the whole database with streaming replication built-in > >

Re: [GENERAL] Create Action for psql when NOTIFY Recieved

2017-09-05 Thread Nico Williams
On Tue, Sep 05, 2017 at 08:19:13AM -0700, Steve Atkins wrote: > > On Sep 4, 2017, at 10:25 PM, Nico Williams <n...@cryptonector.com> wrote: > > On Mon, Sep 4, 2017 at 4:21 PM Steve Atkins <st...@blighty.com> wrote: > > > https://github.com/wttw/pgsidekick [

Re: [GENERAL] Create Action for psql when NOTIFY Recieved

2017-09-04 Thread Nico Williams
On Mon, Sep 4, 2017 at 4:21 PM Steve Atkins wrote: > > > > Me too. > > https://github.com/wttw/pgsidekick > > Select-based, sends periodic keep-alives to keep the connection open, > outputs payloads in a way that's friendly to pipe into xargs. (Also the > bare bones of a

Re: [GENERAL] Create Action for psql when NOTIFY Recieved

2017-09-03 Thread Nico Williams
On Sun, Sep 03, 2017 at 05:37:57PM -0500, Nico Williams wrote: > What would it take to have pqasyncnotifier [0] adopted by PostgreSQL? Maybe it should be named pqasynclisterner. A \wait command for psql could do the same thing. I could probably write such a patch at some point if ther

Re: [GENERAL] Create Action for psql when NOTIFY Recieved

2017-09-03 Thread Nico Williams
[I meant to send this to the list] On Mon, Aug 28, 2017 at 07:08:28PM -0400, Tom Lane wrote: > "David G. Johnston" writes: > > On Mon, Aug 28, 2017 at 1:28 PM, Jerry Regan < > > jerry.re...@concertoglobalresources.com> wrote: > >> My concern is how, after LISTENing in

Re: [GENERAL] Create Action for psql when NOTIFY Recieved

2017-09-03 Thread Nico Williams
My principal problem with psql(1) relative to NOTIFY/LISTEN is that psql(1) won't check for them until it has had some input on stdin. So it will appear to do nothing when it's idle, even if there millions of notifies for it to respond to! So I wrote a program to just LISTEN:

Re: [GENERAL] Strange SQL result - any ideas.

2017-09-03 Thread Nico Williams
On Fri, Sep 01, 2017 at 11:08:32PM +0100, Paul Linehan wrote: > which is fine (note that the field "mary" is sorted correctly) but > I want "proper" JSON - i.e. with open and close square brackets > i.e. ([ - ]) before and after the fields! I don't know what that means. Do you mean that you want