Re: Is it possible to use keywords (date units) in a function definition?

2020-06-09 Thread Alistair Johnson
> > I think you need to be more specific as to what "this" means. > > Looking again after Andrian's comment are you trying to write, in the > script file: > > datetime_diff('start time as string'::timestamp, 'end time as > string'::timestamp, HOUR) > > and get PostgreSQL to recognize the value HOUR

Is it possible to use keywords (date units) in a function definition?

2020-06-08 Thread Alistair Johnson
Hello, I recently tried to write a wrapper function to calculate the difference between two dates, mainly as a convenience. I'd essentially be emulating EXTRACT( FROM date1 - date2), in various ways. I got a bit stuck on allowing specification of the : is this possible in function definitions? I'd