Skip to main content
PostgreSQL 时间类型

官网 datetime 介绍

首先,postgre 并没有 datetime 类型,只有如下这些类型。

Name Storage Size Description Low Value High Value Resolution
timestamp [ (*p*) ] [ without time zone ] 8 bytes both date and time (no time zone) 4713 BC 294276 AD 1 microsecond
timestamp [ (*p*) ] with time zone 8 bytes both date and time, with time zone 4713 BC 294276 AD 1 microsecond
date 4 bytes date (no time of day) 4713 BC 5874897 AD 1 day
time [ (*p*) ] [ without time zone ] 8 bytes time of day (no date) 00:00:00 24:00:00 1 microsecond
time [ (*p*) ] with time zone 12 bytes time of day (no date), with time zone 00:00:00+1559 24:00:00-1559 1 microsecond
interval [ *fields* ] [ (*p*) ] 16 bytes time interval -178000000 years 178000000 years 1 microsecond

MarshioLess than 1 minutepostgresql
pg命令

前言

以下命令中[]表示可选项,

角色/用户

在postgres13中,用户和角色共用一张表,用户和角色的关系通过rolcanlogin区分,能LOGIN的是user,不能LOGIN的是role(目前来看,不保准后面会有特例)。 参考 https://www.postgresql.org/docs/15/sql-alterrole.html


MarshioAbout 6 minpostgresql