in reply to Postgresql output to file
See the documentation at https://metacpan.org/pod/DBI#fetchrow_array. (This assumes that your log may be large. If not you could use https://metacpan.org/pod/DBI#fetchall_arrayref.)my $dbh = DBI->connect($dsn, $userid, $password, { RaiseError => 1 } +) or die $DBI::errstr; my $query = "SELECT * FROM logs_column WHERE logged_in > NOW()::timest +amp - interval '24hour'"; my $sth = $dbh->prepare($query); $sth->execute(); while (my @row = $sth->fetchrow_array) { print "@row\n"; }
Hope this helps!
|
|---|