Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Celia McInnis
Whoops - I hadn't changed the type of the column in the table that I was inserting into - it was of type "TIME WITHOUT TIMEZONE". Now that I have set the column type to INTERVAL, I can insert the string '25:17:07' into the column without even needing to do any casting. Thank goodness and thanks! C

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Tom Lane
Celia McInnis writes: > Thanks for the suggestion, Steve, but No - when I insert 25:17:07::interval > into my table I get 01:17:07 into the table - i.e., it replaces 25 hours by > (25 mod 24) hours or 1 hour, and this is not what I want. There is definitely something you are not telling us, becau

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Christophe Pettus
> On Mar 19, 2024, at 19:56, Celia McInnis wrote: > > Thanks for the suggestion, Steve, but No - when I insert 25:17:07::interval > into my table I get 01:17:07 into the table - i.e., it replaces 25 hours by > (25 mod 24) hours or 1 hour, and this is not what I want. I really need the > num

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Celia McInnis
Thanks for the suggestion, Steve, but No - when I insert 25:17:07::interval into my table I get 01:17:07 into the table - i.e., it replaces 25 hours by (25 mod 24) hours or 1 hour, and this is not what I want. I really need the number of hours rather than the number of hours mod 24. Do I have to ma

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Steve Baldwin
Could you use an interval data type? For example: b2bcreditonline=# create table interval_example (i interval); CREATE TABLE b2bcreditonline=# insert into interval_example values ('26:15:32'::interval); INSERT 0 1 b2bcreditonline=# select * from interval_example; i -- 26:15:32 (1 row)

Re: How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Ron Johnson
On Tue, Mar 19, 2024 at 10:05 PM Celia McInnis wrote: > Hi: > > I want to store times in a database as hours:minutes:seconds where hours > can be greater than 24. How do I do this? I will want to be able to add > such times. > Try the INTERVAL data type.

How to store in hours:minutes:seconds where hours may be bigger than 24

2024-03-19 Thread Celia McInnis
Hi: I want to store times in a database as hours:minutes:seconds where hours can be greater than 24. How do I do this? I will want to be able to add such times. Thanks, Celia McInnis