Re: formating a select from a timestamp column

Поиск
Список
Период
Сортировка
От Keith Worthington
Тема Re: formating a select from a timestamp column
Дата
Msg-id 439B9139.6050403@NarrowPathInc.com
обсуждение исходный текст
Ответ на formating a select from a timestamp column  (stig erikson <stigerikson_nospam_@yahoo.se>)
Список pgsql-novice
stig erikson 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?
>
> i use postgresql 8.1
>
> thanks
> stig
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
>

Stig,

How about just casting it to a date?

SELECT datum::date from table;

--
Kind Regards,
Keith

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

Предыдущее
От: Mag Gam
Дата:
Сообщение: Book Application
Следующее
От: "Omar Zevallos"
Дата:
Сообщение: Hi, connecting PostgreSQL 8.1 to GeoServer1.3