Hi,
I would like to store intervals in a table.
When I write '55:39', it's shown (in pgAdmin) as '55:39'. So it's not somewhat normalized.
What does it mean then? 55 minutes and 39 seconds or 55 hours and 39 minutes?
When I create a view that divides two intervals, I get results like '08:23:01.543116' (shown in the view in pgAdmin).
Can I format it somehow to show only minutes and seconds, preferrably in the view itself?
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?
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?
Details in the manual: http://www.postgresql.org/docs/current/static/datatype-datetime.html#DATATYPE-INTERVAL-INPUT
mydb=# select duration from vds_run;
duration
----------
00:55:39
What durations do we see here?
hour:minute:second?
Magnus Warker <magnux@mailinator.com> writes:
# set intervalstyle to 'postgres_verbose';
SET
# select interval '00:55:39';
interval
-------------------
@ 55 mins 39 secs
(1 row)
Magnus Warker schrieb am 06.01.2016 um 13:39:
I don't know what you mean with "dividing" intervals.
Dividing a duration by another does not really make sense to me....
Btw: you are betting off posting to the Postgres mailing lists than to comp.databases.postgresql.
If you prefer newsgroup style reading (as I do) you can register with
the mailing list with the option to not deliver mail, and then subscribe
to the ntp mirrors of the mailing lists on news.gmane.org
Magnus Warker schrieb am 06.01.2016 um 13:39:
When I write '55:39', it's shown (in pgAdmin) as '55:39'. So it's not
somewhat normalized.
What does it mean then? 55 minutes and 39 seconds or 55 hours and 39
minutes?
select justify_hours(interval '55:43')
returns: 0 years 0 mons 2 days 7 hours 43 mins 0.00 secs
Sysop: | Keyop |
---|---|
Location: | Huddersfield, West Yorkshire, UK |
Users: | 399 |
Nodes: | 16 (2 / 14) |
Uptime: | 40:31:04 |
Calls: | 8,336 |
Calls today: | 13 |
Files: | 13,155 |
Messages: | 5,891,363 |
Posted today: | 1 |