Re: formating a select from a timestamp column - Mailing list pgsql-novice

From Keith Worthington
Subject Re: formating a select from a timestamp column
Date
Msg-id 439B9139.6050403@NarrowPathInc.com
Whole thread Raw
In response to formating a select from a timestamp column  (stig erikson <stigerikson_nospam_@yahoo.se>)
List 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 by date:

Previous
From: Mag Gam
Date:
Subject: Book Application
Next
From: "Omar Zevallos"
Date:
Subject: Hi, connecting PostgreSQL 8.1 to GeoServer1.3