Re: Implementing pg_dump_sort.c topological sorting in sql/plpgsql/plperl?

From: David Fetter <david(at)fetter(dot)org>
To: Joel Jacobson <joel(at)gluefinance(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Implementing pg_dump_sort.c topological sorting in sql/plpgsql/plperl?
Date: 2011-01-04 16:53:40
Message-ID: 20110104165339.GA25139@fetter.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Jan 04, 2011 at 09:29:55AM +0100, Joel Jacobson wrote:
> Hi hackers,
>
> The project I'm currently working with fsnapshot[1], is written in
> plain plpgsql and I need to sort all the oids in their
> creatable/droppable order. This has already been properly
> implemented in pg_dump_sort.c using Knuth's algorithm for
> topological sorting, with some special magic to find and break
> dependency loops.
>
> It's not possible to use a plain recursive query to do the trick
> (due to 'i' bidirectional dependencies and dependency loops).

I believe it is possible. I'll try to do it this evening.

Cheers,
David.
--
David Fetter <david(at)fetter(dot)org> http://fetter.org/
Phone: +1 415 235 3778 AIM: dfetter666 Yahoo!: dfetter
Skype: davidfetter XMPP: david(dot)fetter(at)gmail(dot)com
iCal: webcal://www.tripit.com/feed/ical/people/david74/tripit.ics

Remember to vote!
Consider donating to Postgres: http://www.postgresql.org/about/donate

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message David Fetter 2011-01-04 17:02:26 Re: ALTER EXTENSION UPGRADE patch v1
Previous Message Dimitri Fontaine 2011-01-04 16:51:16 Re: Implementing pg_dump_sort.c topological sorting in sql/plpgsql/plperl?