Column reordering in pg_dump

From: "hernan gonzalez" <hgonzalez(at)gmail(dot)com>
To: pgsql-hackers(at)postgresql(dot)org
Subject: Column reordering in pg_dump
Date: 2008-11-14 17:21:50
Message-ID: 48692c2d0811140921v4504162ctb2c22b53e2f1b5c9@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi.
As I wanted to change the order of columns of some tables (I know, I
know, my code does not depend
on that; but I prefer that \dt gives me a more organized ouput...)
I've added an option to pg_dump to reorder
columns in the ouput "CREATE TABLE" dump.
The specified order is given in a external file (one column by line,
format "scheme.tablename.colname"),
you only need to write the desired columns to reorder.
I've done it for my own use, minimal testing, etc; but the code is
quite simple and has little coupling
with the rest; and very little risk, IMO.
The code (reoder.c and patched pg_dump.c) is here:
http://hjg.com.ar/tech/prog/pg_dump_reorder/
See the README.txt, and the comments at reorder.c.
If the dev team is interested in adding this little feature to the
core, delighted (in that case, I guess the code
needs some polishing, and perhaps revise terminology, options names,
modify man page, etc)
If not, there it is so the people interested can use it.

BTW: I've been using Postgresql since ten years ago, and it rocks. Congrats.

--
Hernán J. González
http://hjg.com.ar/
Buenos Aires, Argentina

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Heikki Linnakangas 2008-11-14 17:23:51 Re: Synchronous replication patch v2
Previous Message Tom Lane 2008-11-14 17:13:30 Re: pgsql: Enable script to generate preproc.y in build process.