Re: formating a select from a timestamp column

Поиск
Список
Период
Сортировка
От Bruno Wolff III
Тема Re: formating a select from a timestamp column
Дата
Msg-id 20051123121716.GA7998@wolff.to
обсуждение исходный текст
Ответ на formating a select from a timestamp column  (stig erikson <stigerikson_nospam_@yahoo.se>)
Список pgsql-novice
On Sun, Nov 13, 2005 at 11:30:33 +0100,
  stig erikson <stigerikson_nospam_@yahoo.se> wrote:
> hi i have a column that is declared as:
> datum timestamp DEFAULT ('now'::text)::timestamp(6) with time zone
>
>
> then i do:
> SELECT datum from table;
> and get something like: 2005-11-13 00:00:00
>
> i would like the output to be on the format: 2005-11-13
> how can i change it?

You could cast it to a date. If these times only represent dates, then you
should probably just store dates instead of timestamps.

>
> i use postgresql 8.1
>
> thanks
> stig
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings

В списке pgsql-novice по дате отправления:

Предыдущее
От: Jaime Casanova
Дата:
Сообщение: Re: postgreSQL-8.1-beta4 and C, C++
Следующее
От: Bruno Wolff III
Дата:
Сообщение: Re: Ordering output rows by the maximum value of three virtual columns