Beefy Boxes and Bandwidth Generously Provided by pair Networks
P is for Practical
 
PerlMonks  

Re^3: DBI:to sort tables according to their dependencies

by marto (Cardinal)
on Dec 21, 2011 at 10:42 UTC ( [id://944580]=note: print w/replies, xml ) Need Help??


in reply to Re^2: DBI:to sort tables according to their dependencies
in thread DBI:to sort tables according to their dependencies

moritz isn't marto ;) Perhaps you could show us what you did to install the module, the code you are running, and what doesn't work. See How do I post a question effectively? (again).

  • Comment on Re^3: DBI:to sort tables according to their dependencies

Replies are listed 'Best First'.
Re^4: DBI:to sort tables according to their dependencies
by ansh batra (Friar) on Dec 21, 2011 at 10:56 UTC
    oops sorry moritz :)
    i have this with me
    my $sth = $dbh->prepare("select tablename from pg_tables where schema +name=?"); $sth->execute($schema); my @tables; while (my @t = $sth->fetchrow_array) { push @tables, @t; } $sth->finish;
    and from the example in Sort::Topological i have
    my %children = ( 'a' => [ 'b', 'c' ], 'c' => [ 'x' ], 'b' => [ 'x' ], 'x' => [ 'y' ], 'y' => [ 'z' ], 'z' => [ ], ); sub children { @{$children{$_[0]} || []}; } my @unsorted = ( 'z', 'a', 'x', 'c', 'b', 'y' ); my @sorted = toposort(\&children, \@unsorted);
    so i am planning something like foreach element in @tables i should call get_deps which will return the contents to be put inside a => 'here'

      Your previous post talks about problems installing Sort::Topological (and dependencies) you've not mentioned any of this here?

        i was installing it from source may be thats why i was facing problems
        but when i did it from cpan then it was ok

Log In?
Username:
Password:

What's my password?
Create A New User
Domain Nodelet?
Node Status?
node history
Node Type: note [id://944580]
help
Chatterbox?
and the web crawler heard nothing...

How do I use this?Last hourOther CB clients
Other Users?
Others exploiting the Monastery: (4)
As of 2024-04-23 15:54 GMT
Sections?
Information?
Find Nodes?
Leftovers?
    Voting Booth?

    No recent polls found