Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.80) (envelope-from ) id 1aVxSo-00009A-H5 for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Feb 2016 08:27:58 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84) (envelope-from ) id 1aVxSn-00022Z-Vj for pgsql-hackers@arkaria.postgresql.org; Wed, 17 Feb 2016 08:27:58 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84) (envelope-from ) id 1aVxSn-00022T-Ev for pgsql-hackers@postgresql.org; Wed, 17 Feb 2016 08:27:57 +0000 Received: from mail.anarazel.de ([217.115.131.40]) by magus.postgresql.org with esmtp (Exim 4.84) (envelope-from ) id 1aVxSk-0004K3-ET for pgsql-hackers@postgresql.org; Wed, 17 Feb 2016 08:27:56 +0000 Received: by mail.anarazel.de (Postfix, from userid 108) id 948683AFE4E; Wed, 17 Feb 2016 09:27:53 +0100 (CET) X-Spam-Checker-Version: SpamAssassin 3.2.5 (2008-06-10) on mail X-Spam-Level: X-Spam-Status: No, score=-5.3 required=5.0 tests=ALL_TRUSTED,AWL,BAYES_00, FS_REPLICA autolearn=no version=3.2.5 Received: from anarazel.de (pD9F6ACF0.dip0.t-ipconnect.de [217.246.172.240]) (Authenticated sender: andres@anarazel.de) by mail.anarazel.de (Postfix) with ESMTPSA id BD8943AFE4F; Wed, 17 Feb 2016 09:27:50 +0100 (CET) Received: by anarazel.de (Postfix, from userid 1000) id 17EDE102C7F; Wed, 17 Feb 2016 09:27:50 +0100 (CET) Date: Wed, 17 Feb 2016 09:27:50 +0100 From: Andres Freund To: Craig Ringer Cc: obartunov@gmail.com, Bruce Momjian , "Joshua D. Drake" , Petr Jelinek , PostgreSQL-development Subject: Re: pglogical - logical replication contrib module Message-ID: <20160217082749.GI25464@awork2.anarazel.de> References: <5685BB86.5010901@2ndquadrant.com> <56A84422.2030309@commandprompt.com> <20160216143820.GC31273@momjian.us> MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline In-Reply-To: X-Pg-Spam-Score: -4.2 (----) List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-hackers Precedence: bulk Sender: pgsql-hackers-owner@postgresql.org On 2016-02-17 09:33:56 +0800, Craig Ringer wrote: > Some DDL operations don't translate well to a series of replicatable > actions. The case I hit the most is > > ALTER TABLE mytable ADD COLUMN somecolumn sometype NOT NULL DEFAULT > some_function(); > > This is executed (simplified) by taking an ACCESS EXCLUSIVE lock, changing > the catalogs but not making the changes visible yet, rewriting the table, > and committing to make the rewritten table and the catalog changes visible. > > That won't work well with logical replication. FWIW, I think this is much less a fundamental, and more an implementation issue. Falling back to just re-replicating the table, and then optimizing a few common cases (only immutable DEFALUT/USING involved) should be enough for a while. Lets get the basics right, before reaching for the moon. Greetings, Andres Freund -- Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-hackers