--- index.cgi 2009/04/15 15:26:38 13 +++ index.cgi 2009/04/18 12:08:07 17 @@ -11,10 +11,11 @@ our $dsn = 'DBI:Pg:dbname=syslog'; our $user = 'dpavlin'; +our $table = 'log'; require 'config.pl' if -e 'config.pl'; -my $table = param('table') || 'log'; +$table = param('table') || $table; my @columns = param('columns'); @columns = ('*') unless @columns; my $limit = param('limit') || 1000; @@ -37,7 +38,7 @@ while ( my @row = $sth->fetchrow_array ) { my ( $n, $c ) = @row; $n = 'NULL' unless defined $n; - print qq|$c$n|; + print qq|$c$n|; } print qq||; exit; @@ -106,6 +107,14 @@ print $sth->rows, qq| rows in $t s|; +#my @types = map { scalar $dbh->type_info($_)->{TYPE_NAME} } @{ $sth->{TYPE} }; +my $types = dump( $sth->{TYPE} ); +print qq{ + +}; + @columns = @{ $sth->{NAME} } if $#columns == 0 && $columns[0] eq '*'; print qq||;