Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1drkHO-0008KN-0j for pgsql-admin@arkaria.postgresql.org; Tue, 12 Sep 2017 12:27:02 +0000 Received: from localhost ([127.0.0.1] helo=postgresql.org) by malur.postgresql.org with smtp (Exim 4.84_2) (envelope-from ) id 1drkHN-00014V-Bd for pgsql-admin@arkaria.postgresql.org; Tue, 12 Sep 2017 12:27:01 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drkFZ-0006E5-46 for pgsql-admin@postgresql.org; Tue, 12 Sep 2017 12:25:09 +0000 Received: from sss.pgh.pa.us ([66.207.139.130]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1drkFS-00006A-D7 for pgsql-admin@postgresql.org; Tue, 12 Sep 2017 12:25:07 +0000 Received: from sss1.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.pgh.pa.us (8.14.4/8.14.4) with ESMTP id v8CCP0qU032035; Tue, 12 Sep 2017 08:25:00 -0400 From: Tom Lane To: James Lawrence cc: pgsql-admin@postgresql.org Subject: Re: pg_dump making schema output consistent. In-reply-to: References: <2916.1505162654@sss.pgh.pa.us> Comments: In-reply-to James Lawrence message dated "Tue, 12 Sep 2017 00:20:56 -0400" MIME-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-ID: <32033.1505219100.1@sss.pgh.pa.us> Date: Tue, 12 Sep 2017 08:25:00 -0400 Message-ID: <32034.1505219100@sss.pgh.pa.us> List-Archive: List-Help: List-ID: List-Owner: List-Post: List-Subscribe: List-Unsubscribe: X-Mailing-List: pgsql-admin Precedence: bulk Sender: pgsql-admin-owner@postgresql.org James Lawrence writes: > Your explaination is also a little confusing, just for clarity going to ask > some explicit questions. > 1) 'Ordinarily PG will preserve column order faithfully.' what is column > order? do you just mean the order in which columns were added to a table? > your example implies this. Whatever the table's column order is, as shown by e.g. "SELECT * FROM tab". > 2) what is the difference between 'PG' and pg_dump? (I'm reading it as PG = > postgresql server process, pg_dump as the dump tool). In this case I was using it to mean the whole system, server and pg_dump both. > given that I've correctly understood your email, it doesn't directly > address the issue I'm pointing out with column order in the schema dump. Well, then I'm confused. But you certainly haven't given enough information for anyone to do more than guess at what your issue is. > Given the fact without any schema details you hit on the fact these tables > happen to use table inheritance, I'm inclined to lean towards that being > the root cause of the differences in the schema dumps between machines. It seems likely to me that it's something like this type of difference having bit you when these databases were set up, ie the column orders are already different on your two source databases. Perhaps one was made by dump/restore from the other, and the original had already had some order-affecting DDL done on it. regards, tom lane -- Sent via pgsql-admin mailing list (pgsql-admin@postgresql.org) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-admin