Re: pg_dump making schema output consistent.

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: James Lawrence <jljatone(at)gmail(dot)com>
Cc: pgsql-admin(at)postgresql(dot)org
Subject: Re: pg_dump making schema output consistent.
Date: 2017-09-12 12:25:00
Message-ID: 32034.1505219100@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-admin

James Lawrence <jljatone(at)gmail(dot)com> 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

In response to

Browse pgsql-admin by date

  From Date Subject
Next Message Don Seiler 2017-09-12 21:57:17 Upgrade master/slave: rsync?
Previous Message James Lawrence 2017-09-12 04:20:56 Re: pg_dump making schema output consistent.