Re: pg_dump: PATCH for Sorted output - Mailing list pgsql-hackers

From Christof Petig
Subject Re: pg_dump: PATCH for Sorted output
Date
Msg-id 3C15ECCE.E208FB27@petig-baender.de
Whole thread Raw
In response to Re: pg_dump: Sorted output, referential integrity  ("Christopher Kings-Lynne" <chriskl@familyhealth.com.au>)
List pgsql-hackers
Christof Petig wrote:

> Christopher Kings-Lynne wrote:
>
> > > But making a patch to pg_dump is a matter of (say) up to 4 hours.
> > > I'll do it since you seem to like it and nobody started doing it so far.
> >
> > Well, I'm in no way a major developer, so even if I do like it, I don't know
> > what the chances are of it making its way into the tree.
>
> If I stop using C++ comments '//', the chance might grew better ;-) [I
> apologize again]
>
> Since Philip also likes it ...
> I would say it's a good feature to have.

Here's the patch. It's not as efficient as it might be (if dumpTable_order_by had
indinfo around) but it works. I'm not clear about quoting when using sorted output
in 'COPY' style. So if anybody has good test cases around (tables with strange
characters), please check it.

Also I don't know whether the sorting behaviour is sensible when it comes to
inheritance. Can someone using inheritance please check it.

If you like the patch I'll provide documentation patches.

-----

This patch implements:
   -T alias '--sort'  which sorts by primary key / the columns in output order

   Yours
      Christof


Attachment

pgsql-hackers by date:

Previous
From: Kovacs Zoltan
Date:
Subject: Re: Beta4 or RC1 ... ?
Next
From: Peter Eisentraut
Date:
Subject: Re: ODBC functions in gram.y