![]() ![]() PostgreSQL does not store any timezone data with the timestamptz value. It’s important to note that timestamptz value is stored as a UTC value. ![]() (2 rows) Code language: SQL (Structured Query Language) ( sql ) Typname ~ '^timestamp' Code language: SQL (Structured Query Language) ( sql ) typname | typlen Notice that both timestamp and timestamptz uses 8 bytes for storing the timestamp values as shown in the following query: SELECT When you query timestamptz from the database, PostgreSQL converts the UTC value back to the time value of the timezone set by the database server, the user, or the current database connection.When you insert a value into a timestamptz column, PostgreSQL converts the timestamptz value into a UTC value and stores the UTC value in the table.PostgreSQL stores the timestamptz in UTC value. The timestamptz datatype is a time zone-aware date and time data type. The timestamptz datatype is the timestamp with the time zone. ![]() It means that when you change the timezone of your database server, the timestamp value stored in the database will not change automatically. However, it does not have any time zone data. The timestamp datatype allows you to store both date and time.
0 Comments
Leave a Reply. |
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |