Getting a list of a table's attributes that are sortable sorted by uniqueness

From: Tim Landscheidt <tim(at)tim-landscheidt(dot)de>
To: pgsql-sql(at)postgresql(dot)org
Subject: Getting a list of a table's attributes that are sortable sorted by uniqueness
Date: 2011-12-30 01:07:39
Message-ID: m3vcoyx3xg.fsf@passepartout.tim-landscheidt.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

Hi,

I frequently use pg_dump to dump databases and compare them
with diff. To get rid of most "false positives", I'd like
to patch pg_dump to sort the table so that its dumped order
isn't changed more than necessary by insertions & Co.

So I'm looking for a query that will return a list of a
table's attributes that are sortable (e. g. no XML fields)
and sorted by "uniqueness", i. e. first attributes repre-
senting the primary key, then other unique keys, then the
rest.

Before I dive into the depths of PostgreSQL's system cata-
logues, has anyone already solved this problem?

TIA,
Tim

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Jan Bakuwel 2011-12-30 04:25:22 Current transaction is aborted, commands ignored until end of transaction block
Previous Message Steve Crawford 2011-12-29 22:20:28 Re: internal format of timstamp?