PostgreSQL查询结果中去掉时区和精度


原来一直使用PostgreSQL的函数来拼凑,今天突然发现竟然可以这么简单,直接用timestamp(0)来解决就好了:

  1. ls=> select createtime::timestamp(0) without time zone from users;
  2.      createtime
  3. ---------------------
  4.  2015-10-03 01:32:03
  5.  2015-10-03 01:32:03
  6.  2015-10-03 01:32:03
  7. (3 行记录)
  8. ls=> select createtime::timestamp without time zone from users;
  9.          createtime
  10. ----------------------------
  11.  2015-10-03 01:32:03.080415
  12.  2015-10-03 01:32:03.080415
  13.  2015-10-03 01:32:03.080415
  14. (3 行记录)

------------------------------------华丽丽的分割线------------------------------------

Ubuntu Server 14.04 下安装 PostgreSQL 9.3.5 数据库 

CentOS 6.3环境下yum安装PostgreSQL 9.3

PostgreSQL缓存详述

Windows平台编译 PostgreSQL

Ubuntu下LAPP(Linux+Apache+PostgreSQL+PHP)环境的配置与安装

Ubuntu上的phppgAdmin安装及配置

CentOS平台下安装PostgreSQL9.3

PostgreSQL配置Streaming Replication集群

如何在CentOS 7/6.5/6.4 下安装PostgreSQL 9.3 与 phpPgAdmin 

------------------------------------华丽丽的分割线------------------------------------

PostgreSQL 的详细介绍:请点这里
PostgreSQL 的下载地址:请点这里

本文永久更新链接地址

相关内容