dbTalk Databases Forums  

'NOW' in UTC with no timezone

comp.databases.postgresql.general comp.databases.postgresql.general


Discuss 'NOW' in UTC with no timezone in the comp.databases.postgresql.general forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Tom Lane
 
Posts: n/a

Default Re: 'NOW' in UTC with no timezone - 10-14-2004 , 05:56 AM






Stuart Bishop <stuart (AT) stuartbishop (DOT) net> writes:
Quote:
How much overhead is there in storing a timestamp with timezone as
opposed to one without?
Exactly zero. You have a misconception about what the datatype really
does --- see other responses in this thread.

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 3: if posting/reading through Usenet, please send an appropriate
subscribe-nomail command to majordomo (AT) postgresql (DOT) org so that your
message can get through to the mailing list cleanly



Reply With Quote
  #12  
Old   
Stuart Bishop
 
Posts: n/a

Default Re: 'NOW' in UTC with no timezone - 10-14-2004 , 11:12 PM






-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Tom Lane wrote:
Quote:
Stuart Bishop <stuart (AT) stuartbishop (DOT) net> writes:

How much overhead is there in storing a timestamp with timezone as
opposed to one without?


Exactly zero. You have a misconception about what the datatype really
does --- see other responses in this thread.
Indeed - I was under the impression that the timezone would be preserved
(which is the case in the external datetime libraries I use), but I now
see that PostgreSQL will lose this information.

- --
Stuart Bishop <stuart (AT) stuartbishop (DOT) net>
http://www.stuartbishop.net/
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.4 (GNU/Linux)

iD8DBQFBb05DAfqZj7rGN0oRAnz3AJwLqPBMY1MNxjeXjg/orFWNI4+MrwCfSTyG
wSZ0Hmo6Bg9y6ZgfItJOf3w=
=xSUI
-----END PGP SIGNATURE-----

---------------------------(end of broadcast)---------------------------
TIP 8: explain analyze is your friend



Reply With Quote
  #13  
Old   
Jaromir Dolecek
 
Posts: n/a

Default Re: 'NOW' in UTC with no timezone - 10-14-2004 , 11:48 PM



Stuart Bishop wrote:
Quote:
Indeed - I was under the impression that the timezone would be preserved
(which is the case in the external datetime libraries I use), but I now
see that PostgreSQL will lose this information.
Err - how come, lose?

Jaromir
--
Jaromir Dolecek <jdolecek (AT) NetBSD (DOT) org> http://www.NetBSD.cz/
-=- We should be mindful of the potential goal, but as the Buddhist -=-
-=- masters say, ``You may notice during meditation that you -=-
-=- sometimes levitate or glow. Do not let this distract you.'' -=-

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faqs/FAQ.html



Reply With Quote
  #14  
Old   
Martijn van Oosterhout
 
Posts: n/a

Default Re: 'NOW' in UTC with no timezone - 10-15-2004 , 04:43 AM



On Fri, Oct 15, 2004 at 06:48:40AM +0200, Jaromir Dolecek wrote:
Quote:
Stuart Bishop wrote:
Indeed - I was under the impression that the timezone would be preserved
(which is the case in the external datetime libraries I use), but I now
see that PostgreSQL will lose this information.

Err - how come, lose?
It doesn't remember what timezone to gave when you entered the data. It
converts it to a date/time and displays it in your local timezone.

In other words, postgresql, treats the following as identical:

# select '2004-09-01 12:0:0 CEST'::timestamptz;
timestamptz
------------------------
2004-09-01 12:00:00+02
(1 row)

# select '2004-09-01 20:0:0 AEST'::timestamptz;
timestamptz
------------------------
2004-09-01 12:00:00+02
(1 row)

The answer is correct, but you're getting less out than you put in..

--
Martijn van Oosterhout <kleptog (AT) svana (DOT) org> http://svana.org/kleptog/
Quote:
Patent. n. Genius is 5% inspiration and 95% perspiration. A patent is a
tool for doing 5% of the work and then sitting around waiting for someone
else to do the other 95% so you can sue them.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.0.6 (GNU/Linux)
Comment: For info see http://www.gnupg.org

iD8DBQFBb5vFY5Twig3Ge+YRAkzUAKCizElL7axhWxsMUg0oFO Qu0omhBQCfUNFx
3xa3MpKXnY5+pgWqbzcfIOo=
=Ya98
-----END PGP SIGNATURE-----



Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.