timestamp refactor effort

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

So...in the vein of my last mail, I have tried to create another patch
for refactoring out some of the HAVE_INT64_TIMESTAMP ifdefs in the
code in timestamp.c. I have attached the patch. Please let me know if
this patch is acceptable and what I can do to continue this effort.

Thanks,
wt

Attachments:

0001-Add-PackedTime-typedef.patchtext/x-diff; name=0001-Add-PackedTime-typedef.patchDownload+9-22
#2Tom Lane
tgl@sss.pgh.pa.us
In reply to: Warren Turkal (#1)
Re: timestamp refactor effort

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

So...in the vein of my last mail, I have tried to create another patch
for refactoring out some of the HAVE_INT64_TIMESTAMP ifdefs in the
code in timestamp.c. I have attached the patch. Please let me know if
this patch is acceptable and what I can do to continue this effort.

Hmm, PackedTime seems like a fairly random name for the type --- there's
not anything particularly "packed" about it IMO.

I'm a bit inclined to suggest just using the Timestamp typedef.
I guess though that there's some risk of confusion between values
that actually are "timestamp without time zone" and values that need
the same representation but aren't actually intended to represent a
specific point in time.

Maybe "TimeOffset" or "TimeValue" or something like that?

Other than the name game, I think you're headed in the right direction.

regards, tom lane

#3Warren Turkal
turkal@google.com
In reply to: Tom Lane (#2)
Re: timestamp refactor effort

On Jan 12, 2008 5:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Hmm, PackedTime seems like a fairly random name for the type --- there's
not anything particularly "packed" about it IMO.

I'm a bit inclined to suggest just using the Timestamp typedef.
I guess though that there's some risk of confusion between values
that actually are "timestamp without time zone" and values that need
the same representation but aren't actually intended to represent a
specific point in time.

Maybe "TimeOffset" or "TimeValue" or something like that?

I do agree that Timestamp seems to express the same thing PackedTime
does Should we rename Timestamp to TimeOffset?

Other than the name game, I think you're headed in the right direction.

Thanks.

I have a question. Are the low level representations of Timestamp and
TimestampTZ the same?

wt

#4Warren Turkal
turkal@google.com
In reply to: Warren Turkal (#3)
Re: timestamp refactor effort

-my gmail account

Show quoted text

On Jan 13, 2008 12:13 AM, Warren Turkal <turkal@google.com> wrote:

On Jan 12, 2008 5:23 PM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

Hmm, PackedTime seems like a fairly random name for the type --- there's
not anything particularly "packed" about it IMO.

I'm a bit inclined to suggest just using the Timestamp typedef.
I guess though that there's some risk of confusion between values
that actually are "timestamp without time zone" and values that need
the same representation but aren't actually intended to represent a
specific point in time.

Maybe "TimeOffset" or "TimeValue" or something like that?

I do agree that Timestamp seems to express the same thing PackedTime
does Should we rename Timestamp to TimeOffset?

Other than the name game, I think you're headed in the right direction.

Thanks.

I have a question. Are the low level representations of Timestamp and
TimestampTZ the same?

wt

#5Tom Lane
tgl@sss.pgh.pa.us
In reply to: Warren Turkal (#3)
Re: timestamp refactor effort

"Warren Turkal" <turkal@google.com> writes:

I have a question. Are the low level representations of Timestamp and
TimestampTZ the same?

They're the same but the interpretations are different, which is why
I think it's useful to have two typedefs as a way of documenting what
any given value is intended to be. The argument for having a third
typedef would be exactly the same: to help document what a value is
intended to be.

regards, tom lane

#6Warren Turkal
turkal@google.com
In reply to: Tom Lane (#5)
Re: timestamp refactor effort

On Jan 13, 2008 9:21 AM, Tom Lane <tgl@sss.pgh.pa.us> wrote:

"Warren Turkal" <turkal@google.com> writes:

I have a question. Are the low level representations of Timestamp and
TimestampTZ the same?

They're the same but the interpretations are different, which is why
I think it's useful to have two typedefs as a way of documenting what
any given value is intended to be. The argument for having a third
typedef would be exactly the same: to help document what a value is
intended to be.

Makes sense.

wt