以下の内容はhttps://takuya-1st.hatenablog.jp/entry/2019/09/14/003014より取得しました。


PostgreSQLでtimestamp/now() を文字列にする char キャスト

PostgreSQL でタイムスタンプを文字列として取り出したい

char にキャストするときに長さをつける

now() の場合

select now()::char(30);

実行結果

sample> select now()::char(30);
+--------------------------------+
| now                            |
|--------------------------------|
| 2019-09-13 15:27:51.427441+00  |
+--------------------------------+
SELECT 1
Time: 0.086s

current_timestamp の場合

select current_timestamp::char(29)

実行結果

sample> select current_timestamp::char(29)
+-------------------------------+
| now                           |
|-------------------------------|
| 2019-09-13 15:29:01.630241+00 |
+-------------------------------+
SELECT 1
Time: 0.067s
sample>

あんまり美しいやり方ではないけれど




以上の内容はhttps://takuya-1st.hatenablog.jp/entry/2019/09/14/003014より取得しました。
このページはhttp://font.textar.tv/のウェブフォントを使用してます

不具合報告/要望等はこちらへお願いします。
モバイルやる夫Viewer Ver0.14