summaryrefslogtreecommitdiff
path: root/httemplate/misc/dump.cgi
blob: e8f4b6f383f45279b0fbb051f91064e6ec9d2b23 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
%
%  if ( driver_name =~ /^Pg$/ ) {
%    my $dbname = (split(':', datasrc))[2];
%    if ( $dbname =~ /[;=]/ ) {
%      my %elements = map { /^(\w+)=(.*)$/; $1=>$2 } split(';', $dbname);
%      $dbname = $elements{'dbname'};
%    }
%    open(DUMP,"pg_dump $dbname |");
%  } else {
%    eidiot "don't (yet) know how to dump ". driver_name. " databases\n";
%  }
%
%  http_header('Content-Type' => 'text/plain' );
%
%  while (<DUMP>) {
%    print $_;
%  }
%  close DUMP;
%