Search Postgresql Archives

timestamp(0) vs. timestamp

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi all!

This may seem unimportant, but I still would like to know.

I have columns for timestamps without fractional digits, so I could
define them as timestamp(0).
However, there is no way fractions could ever enter anyway, because
triggers and / or checks guarantee values without fractional seconds.

Is it advantageous to define the column as timestamp(0) or simply as
timestamp?
Does the query planner or any other part of the RDBMS profit from the
additional information in the definition?
Or do I just create an overhead of useless checks or conversions
(however small)?

In a scenario like that, what would be (however slightly) preferable:
CREATE TABLE x
(
   ...
   log_in timestamp(0) without time zone NOT NULL DEFAULT
(now())::timestamp without time zone
or
   log_in timestamp without time zone NOT NULL DEFAULT
(now())::timestamp(0) without time zone
or
   log_in timestamp(0) without time zone NOT NULL DEFAULT
(now())::timestamp(0) without time zone


TIA
Erwin Brandstetter


-- 
Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-general


[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux