Path: csiph.com!fu-berlin.de!uni-berlin.de!individual.net!not-for-mail From: Harry Tuttle Newsgroups: comp.databases.postgresql Subject: Re: work with intervals Date: Sat, 9 Jan 2016 10:07:55 +0100 Lines: 34 Message-ID: References: Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit X-Trace: individual.net XMxWWhzKe5GkPKnBSgzTHw2ZIIMd3a9VUCqerO75nLNXBY7kw= Cancel-Lock: sha1:JPoevQ/3W8RQSApLTv4aQ5VCbTs= User-Agent: Mozilla/5.0 (Windows; U; Windows NT 5.1; de; rv:1.8.1.21) Gecko/20090302 Thunderbird/2.0.0.21 Mnenhy/0.7.5.666 In-Reply-To: Xref: csiph.com comp.databases.postgresql:698 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.