Re: Implementing pg_dump_sort.c topological sorting in sql/plpgsql/plperl? - Mailing list pgsql-hackers

From David Fetter
Subject Re: Implementing pg_dump_sort.c topological sorting in sql/plpgsql/plperl?
Date
Msg-id 20110104165339.GA25139@fetter.org
Whole thread Raw
In response to Implementing pg_dump_sort.c topological sorting in sql/plpgsql/plperl?  (Joel Jacobson <joel@gluefinance.com>)
List 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@fetter.org> http://fetter.org/
Phone: +1 415 235 3778  AIM: dfetter666  Yahoo!: dfetter
Skype: davidfetter      XMPP: david.fetter@gmail.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


pgsql-hackers by date:

Previous
From: Dimitri Fontaine
Date:
Subject: Re: Implementing pg_dump_sort.c topological sorting in sql/plpgsql/plperl?
Next
From: David Fetter
Date:
Subject: Re: ALTER EXTENSION UPGRADE patch v1