SELECT in postgresql does not take records in the time interval

1

I have the following SELECT

SELECT * FROM motoqueiros WHERE now() - INTERVAL '8 SECONDS' <= data_update

It works on my local machine. I created a server in AMAZON, the server has ubuntu 14 64 bits, when I execute the same select it does not bring the results, I have to put 20,000 seconds to get something back to me. I've already changed the time zone for America / Sao Paulo and nothing, has anyone ever been through this kind of thing? Thank you!

    
asked by anonymous 10.08.2016 / 15:01

1 answer

1

I think your problem is still the time zone issue, as your return from now() ends with +00 , and our spindle (America / Sao_Paulo) is -03 .

Try the following:

SELECT * FROM motoqueiros WHERE now() AT TIME ZONE 'America/Sao_Paulo' - INTERVAL '8 SECONDS' <= data_update

To solve the problem at once, edit your postgresql.conf with the following entry:

timezone = 'America/Sao_Paulo' 
    
10.08.2016 / 15:38