How to use postgresql timestamp

1 is the original data in the table a numeric value or a formatted time string for Magi Postgresql timestamp?
2, if it is a formatted string, is his own sorting performance very poor?
3, if it is a numerical value, can you check it directly according to the numerical value?

Mar.13,2021

PostgreSQL provides the timestamp data type.

https://www.postgresql.org/do.

so don't store timestamp data as strings or integers, which will cost storage and query performance.


    The internal form of the
  1. TIMESTAMP type stored in the table is an 8-byte value, the expressible time range is 4713 BC to AD 294276 , and the smallest unit is subtle (microsecond)
  2. .
  3. because it's a numerical value, you don't have to worry about its sorting performance
  4. this problem is rather complicated

    Although the

    TIMESTAMP type is an 8-byte value, in order to mask the internal details to the user, its output is in the form of a string to output the timestamp (the format of the timestamp can be specified). Logically, the PG community does not want to expose internal values directly to the outside world.

    if we have to check it out as a numerical type, there seems to be no way to find its original 8-byte value, but we can "save the nation by curve" by converting the TIMESTAMP type to a Unix timestamp (since 00:00:00 GMT on January 1, 1970) followed by an integer:

    suppose you have the following table

      9.9. Date/Time Functions and Operators  

MySQL Query : SELECT * FROM `codeshelper`.`v9_news` WHERE status=99 AND catid='6' ORDER BY rand() LIMIT 5
MySQL Error : Disk full (/tmp/#sql-temptable-64f5-1bc8eca-30953.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
MySQL Errno : 1021
Message : Disk full (/tmp/#sql-temptable-64f5-1bc8eca-30953.MAI); waiting for someone to free some space... (errno: 28 "No space left on device")
Need Help?