PostgreSQL间隔错误

时间:2017-06-26 19:54:52

标签: postgresql

我正在尝试运行以下查询。不确定,我在做什么错误:

select min(p.start_timestamp AT TIME ZONE p.timezone AT TIME ZONE 'America/Los_Angeles' ) as Date,
 'America/Los_Angeles' AS Timezone, sum(GREATEST(0, p.value)) as Value  
from main.production_m p 
where 
p.start_timestamp AT TIME ZONE p.timezone >= '2017-02-18' 
and p.start_timestamp AT TIME ZONE  p.timezone < '2017-02-22' + INTERVAL '1 day' 

收到以下错误:

ERROR:  invalid input syntax for type interval: "2017-02-20"
LINE 5: ...and p.start_timestamp AT TIME ZONE  p.timezone <= '2017-02-2...

感谢您的意见。 谢谢 Karthey

1 个答案:

答案 0 :(得分:1)

PSQL认为您的日期应该是出于某种原因的间隔;你可以通过施放来解决这个问题:

8.length