+sub _execute_initial_sql {
+ my ($db) = @_;
+
+ return if $_initial_sql_executed{$db} || !%::myconfig || !$::myconfig{dateformat};
+
+ $_initial_sql_executed{$db} = 1;
+
+ # Don't rely on dboptions being set properly. Chose them from
+ # dateformat instead.
+ my $pg_dateformat = $_dateformats{ $::myconfig{dateformat} };
+ $db->dbh->do("set DateStyle to '${pg_dateformat}'") if $pg_dateformat;
+}
+