use clock_timestamp() instead of current_date (closes: #83892)

authorAlexandre Fayolle <alexandre.fayolle@logilab.fr>
changesete505f990ed14
branchstable
phasepublic
hiddenno
parent revision#ecdd1a3bcb0c backout b944d435426b. Returning datetime object here is not the right fix (which lies on the cw side)
child revision#30f9d3dc17da default is stable
files modified by this revision
postgres.py
# HG changeset patch
# User Alexandre Fayolle <alexandre.fayolle@logilab.fr>
# Date 1326991845 -3600
# Thu Jan 19 17:50:45 2012 +0100
# Branch stable
# Node ID e505f990ed140adb12bdd35d58503519c639f9ea
# Parent ecdd1a3bcb0cc93626f5b2dc6769ef244e555228
use clock_timestamp() instead of current_date (closes: #83892)

diff --git a/postgres.py b/postgres.py
@@ -217,10 +217,19 @@
1              cmd.append('--no-owner')
2          cmd.append(backupfile)
3          cmds.append(cmd)
4          return cmds
5 
6 +    def sql_current_date(self):
7 +        return 'CAST(clock_timestamp() AS DATE)'
8 +
9 +    def sql_current_time(self):
10 +        return 'CAST(clock_timestamp() AS TIME)'
11 +
12 +    def sql_current_timestamp(self):
13 +        return 'clock_timestamp()'
14 +
15      def sql_regexp_match_expression(self, pattern):
16          """pattern matching using regexp"""
17          return "~ %s" % (pattern)
18 
19      def sql_create_sequence(self, seq_name):