PostgreSQL

select current_timestamp;  //

select current_date;  //

select current_time;  //

select to_timestamp(some_char_column, 'yyyymmdd') from some_table;  //

select to_date(some_char_column, 'yy-mm-dd') from some_table;  //

 

CHAR(n)
CHARACTER(n) 
包含固定长度的字符串,用空格填充到长度 n。

VARCHAR(n)
CHARACTER VARYING(n)
存储可变长度的字符串,最大长度为 n。不存储末尾的空格。

跟ORACLE中的CHAR和VARCHAR2相比的话,相差不大。

原文地址:https://www.cnblogs.com/voctrals/p/3893503.html