timestamp typedefs

Started by Warren Turkalover 18 years ago6 messageshackers
Jump to latest
#1Warren Turkal
wturkal@gmail.com

Hello,

I have created the following patch in an effort to start cleaning up
the timestamp datatype. Please let me know if something like this will
help so that I know whether to keep going. BTW, it passes a "make
check" AFAICT.

Thanks,
wt

#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Warren Turkal (#1)
Re: timestamp typedefs

"Warren Turkal" <wturkal@gmail.com> writes:

I have created the following patch in an effort to start cleaning up
the timestamp datatype. Please let me know if something like this will
help so that I know whether to keep going. BTW, it passes a "make
check" AFAICT.

Do we really need "fhour_t" and "fminute_t" on top of "fsec_t"?
This seems like a bad factorization ...

regards, tom lane

#3Tom Lane
tgl@sss.pgh.pa.us
In reply to: Tom Lane (#2)
Re: timestamp typedefs

I wrote:

Do we really need "fhour_t" and "fminute_t" on top of "fsec_t"?
This seems like a bad factorization ...

After some more thought: I think that what's bugging me is that "fsec_t"
is intended to denote "fractional seconds". The other cases you have
here seem not to be intended to be "fractional hours" or "fractional
minutes". I'm not quite sure what the right abstraction is, but it
doesn't seem to be that.

regards, tom lane

#4Warren Turkal
wturkal@gmail.com
In reply to: Tom Lane (#3)
Re: timestamp typedefs

On Jan 3, 2008 8:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I wrote:

Do we really need "fhour_t" and "fminute_t" on top of "fsec_t"?
This seems like a bad factorization ...

After some more thought: I think that what's bugging me is that "fsec_t"
is intended to denote "fractional seconds". The other cases you have
here seem not to be intended to be "fractional hours" or "fractional
minutes". I'm not quite sure what the right abstraction is, but it
doesn't seem to be that.

I thought it meant "field seconds". That's why I used fhour_t and
fminute_t. I'll think about a better name.

wt

#5Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Warren Turkal (#4)
Re: timestamp typedefs

Warren Turkal escribi�:

On Jan 3, 2008 8:54 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

I wrote:

Do we really need "fhour_t" and "fminute_t" on top of "fsec_t"?
This seems like a bad factorization ...

After some more thought: I think that what's bugging me is that "fsec_t"
is intended to denote "fractional seconds". The other cases you have
here seem not to be intended to be "fractional hours" or "fractional
minutes". I'm not quite sure what the right abstraction is, but it
doesn't seem to be that.

I thought it meant "field seconds". That's why I used fhour_t and
fminute_t. I'll think about a better name.

Perhaps what you want here is to define a type for calculation results
(double/int64). Whether it is used in the code for minutes or hours is
irrelevant to the typedef.

--
Alvaro Herrera http://www.CommandPrompt.com/
The PostgreSQL Company - Command Prompt, Inc.

#6Warren Turkal
wturkal@gmail.com
In reply to: Alvaro Herrera (#5)
Re: timestamp typedefs

On Jan 4, 2008 4:20 AM, Alvaro Herrera <alvherre@commandprompt.com> wrote:

Perhaps what you want here is to define a type for calculation results
(double/int64). Whether it is used in the code for minutes or hours is
irrelevant to the typedef.

Okay...that sounds good. Do you have a good name for it?
Alternatively, we could just use a TimestampTZ, I guess.

wt