Re: Add CREATE support to event triggers

From: Jim Nasby <Jim(dot)Nasby(at)BlueTreble(dot)com>
To: Andres Freund <andres(at)2ndquadrant(dot)com>, Christopher Browne <cbbrowne(at)gmail(dot)com>
Cc: Robert Haas <robertmhaas(at)gmail(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, Alvaro Herrera <alvherre(at)2ndquadrant(dot)com>, Michael Paquier <michael(dot)paquier(at)gmail(dot)com>, Pg Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Add CREATE support to event triggers
Date: 2014-11-11 02:02:10
Message-ID: 54616E22.9030708@BlueTreble.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On 11/10/14, 4:58 PM, Andres Freund wrote:
> But the main reason all this is interesting isn't so much CREATE
> itself. But that it can be (and Alvaro has mostly done it!) for ALTER as
> well. And there it imo becomes really interesting. Because you can quite
> easily check whether the affected relation is being replicated you can
> just emit the DDL when that's the case. And that makes DDL in a
> logically replicated setup*much* easier.

+1. Adding columns is a PITA, you have to manually ensure you do it on all slaves first.

Drop is somewhat worse, because you have to do it on the master first, opposite of the (more usual) case of adding a column.

RENAME is a complete disaster.

Handing scripts to your replication system to execute isn't a very good alternative either; it assumes that you actually have a script (bad assumption with ORMs), and that you have a reasonable way to get that script to wherever you run your replication system.

I will also weigh in that there are a LOT of cases that binary replication doesn't cover. I find it interesting that prior to creating built in replication, the community stance was "We won't build that because there's too many different use cases", but now some folks are saying that everyone should just use streaming rep and be done with it. :P
--
Jim Nasby, Data Architect, Blue Treble Consulting
Data in Trouble? Get it in Treble! http://BlueTreble.com

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Alvaro Herrera 2014-11-11 02:14:02 Re: BRIN indexes - TRAP: BadArgument
Previous Message Amit Langote 2014-11-11 01:53:07 Re: On partitioning