Skip to content

Commit

Permalink
fix logging with postgresql
Browse files Browse the repository at this point in the history
  • Loading branch information
moritz committed Jan 6, 2014
1 parent 0e9208c commit 90f4813
Showing 1 changed file with 7 additions and 3 deletions.
10 changes: 7 additions & 3 deletions lib/Ilbot/Backend/SQL.pm
Original file line number Diff line number Diff line change
Expand Up @@ -30,7 +30,7 @@ our %SQL = (
activity_average => q[SELECT SUM(cache_number_lines), DATEDIFF(DATE(MAX(day)), DATE(MIN(day))) FROM ilbot_day WHERE channel = ?],
log_line => q[CALL ilbot_log_line (?, ?, ?)],
},
Pg => {
pg => {
log_line => q[SELECT ilbot_log_line (?, ?, ?)],
}
);
Expand All @@ -39,8 +39,12 @@ my %post_connect = (
mysql => sub {
$_[0]{mysql_enable_utf8} = 1;
$_[0]{mysql_auto_reconnect} = 1;
$_[0]->do(q[set time_zone = '+0:00'])
if config(backend => 'timezone') ne 'local';
if (config(backend => 'timezone') ne 'local') {
warn "Setting timezone to UTC!";
$_[0]->do(q[set time_zone = '+0:00']);
use Data::Dumper;
warn Dumper $_[0]->selectall_arrayref(q[SELECT DATE(FROM_UNIXTIME(1388531037))]);
}
},
Pg => sub {
$_[0]{pg_enable_utf8} = 1;
Expand Down

0 comments on commit 90f4813

Please sign in to comment.