Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.databases.postgresql > #698

Re: work with intervals

From Harry Tuttle <SOZRBLNTLEEE@spammotel.com>
Newsgroups comp.databases.postgresql
Subject Re: work with intervals
Date 2016-01-09 10:07 +0100
Message-ID <dfc0vhF7oj6U1@mid.individual.net> (permalink)
References <n6j1un$lbj$1@news.m-online.net> <df9esaFih4aU1@mid.individual.net> <n6q7du$lfn$1@news.m-online.net>

Show all headers | View raw


Magnus Warker schrieb am 09.01.2016 um 06:56:
>>     select justify_hours(interval '55:43')
>> returns: 0 years 0 mons 2 days 7 hours 43 mins 0.00 secs
>
> So '55:39' means 55 hours and 39 minutes?
> Does this mean that when leaving out the microseconds the right most number is treated as minutes?
>
> What do I have to enter (in pgAdmin) if I want 53 minutes and 51 seconds?

There are several different ways of specfiying an interval:

    select interval '00:53:51'

or

    select interval '54H 51s'


Details in the manual: http://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-INTERVAL-INPUT


> When I enter "53:51" it is saved as is. Do I have to change it to "53:51:00" then?
> The same vor timestamps:
> I enter "2016-01-09 05:26" and pgAdmin stores this value exactly as I entered it. Do I have to change it to "2016-01-09 05:26:00" then?

I don't use pgAdmin.

A timestamp is always saved with all parts (but without any formatting).

My guess is that pgAdmin simply does not display the seconds.



Back to comp.databases.postgresql | Previous | NextPrevious in thread | Next in thread | Find similar


Thread

work with intervals Magnus Warker <magnux@mailinator.com> - 2016-01-06 13:39 +0100
  Re: work with intervals Harry Tuttle <SOZRBLNTLEEE@spammotel.com> - 2016-01-08 10:46 +0100
    Re: work with intervals Magnus Warker <magnux@mailinator.com> - 2016-01-08 19:57 +0100
    Re: work with intervals Magnus Warker <magnux@mailinator.com> - 2016-01-09 06:56 +0100
      Re: work with intervals Harry Tuttle <SOZRBLNTLEEE@spammotel.com> - 2016-01-09 10:07 +0100
        Re: work with intervals Magnus Warker <magnux@mailinator.com> - 2016-01-19 06:43 +0100
          Re: work with intervals Dimitri Fontaine <dimitri@2ndQuadrant.fr> - 2016-01-19 10:20 +0100
            Re: work with intervals Magnus Warker <magnux@mailinator.com> - 2016-01-31 06:04 +0100

csiph-web