postgresql 修改datestyle

SET datestyle TO "ISO, MDY";

SELECT current_date;
    date
------------
2012-06-21
(1 row)

SET datestyle TO "ISO, YMD";

SELECT current_date;
    date
------------
2012-06-21
(1 row)

SET datestyle TO "postgres, MDY";

SELECT current_date;
    date
------------
06-21-2012
(1 row)



在postgresql.conf中也有设置。不过好像改了没用,执行sql的时候把转换的语句先执行就OK。

猜你喜欢

转载自tivonhou.iteye.com/blog/2002874
今日推荐