PostgreSQL のメモ

PostgreSQL コロン2つとdate
# select now();
              now
-------------------------------
 2010-05-06 12:48:20.849159+09
(1 row)
date(コロン2つとdate)をつけると
# select now()::date;
    now
------------
 2010-05-06
(1 row)
to_char
# select to_char(now(),'yyyy-mm-dd hh24:mi:ss');
       to_char
---------------------
 2010-05-06 12:56:51
(1 row)
クライアントエンコーディングの設定

SET CLIENT_ENCODING TO 'SJIS';