Re: timestamp typedefs

Lists: pgsql-hackers
From: "Warren Turkal" <wturkal(at)gmail(dot)com>
To: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: timestamp typedefs
Date: 2008-01-04 04:15:54
Message-ID: 7fdf8c4d0801032015t63137cf5na1f942b55fa82b25@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Warren Turkal" <wturkal(at)gmail(dot)com>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: timestamp typedefs
Date: 2008-01-04 04:41:47
Message-ID: 28369.1199421707@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

"Warren Turkal" <wturkal(at)gmail(dot)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


From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: "Warren Turkal" <wturkal(at)gmail(dot)com>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: timestamp typedefs
Date: 2008-01-04 04:54:04
Message-ID: 28482.1199422444@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

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


From: "Warren Turkal" <wturkal(at)gmail(dot)com>
To: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: timestamp typedefs
Date: 2008-01-04 05:27:05
Message-ID: 7fdf8c4d0801032127p6bc2b8dfy96f5c517aa71c391@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jan 3, 2008 8:54 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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


From: Alvaro Herrera <alvherre(at)commandprompt(dot)com>
To: Warren Turkal <wturkal(at)gmail(dot)com>
Cc: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: timestamp typedefs
Date: 2008-01-04 12:20:26
Message-ID: 20080104122026.GA10442@alvh.no-ip.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Warren Turkal escribió:
> On Jan 3, 2008 8:54 PM, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)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.


From: "Warren Turkal" <wturkal(at)gmail(dot)com>
To: "PostgreSQL Hackers" <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: timestamp typedefs
Date: 2008-01-05 07:23:56
Message-ID: 7fdf8c4d0801042323w1dfbb5f4p5638f4065eece51b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

On Jan 4, 2008 4:20 AM, Alvaro Herrera <alvherre(at)commandprompt(dot)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