Received: from localhost (maia-1.hub.org [200.46.204.191]) by postgresql.org (Postfix) with ESMTP id AED8A9FB893 for ; Sun, 4 Mar 2007 15:27:02 -0400 (AST) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.204.191]) (amavisd-new, port 10024) with ESMTP id 55474-02 for ; Sun, 4 Mar 2007 15:26:57 -0400 (AST) X-Greylist: from auto-whitelisted by SQLgrey-1.7.4 Received: from mail06.svc.cra.dublin.eircom.net (mail06.svc.cra.dublin.eircom.net [159.134.118.22]) by postgresql.org (Postfix) with SMTP id E1E3C9FB88E for ; Sun, 4 Mar 2007 15:26:56 -0400 (AST) Received: (qmail 16952 messnum 2900679 invoked from network[83.71.89.140/83-71-89-140.b-ras1.mvw.galway.eircom.net]); 4 Mar 2007 19:26:55 -0000 Received: from 83-71-89-140.b-ras1.mvw.galway.eircom.net (HELO ?127.0.0.1?) (83.71.89.140) by mail06.svc.cra.dublin.eircom.net (qp 16952) with SMTP; 4 Mar 2007 19:26:55 -0000 Message-ID: <45EB1D7D.7000102@iol.ie> Date: Sun, 04 Mar 2007 19:26:53 +0000 From: Raymond O'Donnell Reply-To: rod@iol.ie User-Agent: Thunderbird 1.5.0.10 (Windows/20070221) MIME-Version: 1.0 To: pgsql-general@postgresql.org Subject: Re: date format References: <200703041247.05097.garry@schoolteachers.co.uk> <200703041705.44507.garry@schoolteachers.co.uk> <20070304170935.GC11685@svana.org> <200703041856.20139.garry@schoolteachers.co.uk> In-Reply-To: <200703041856.20139.garry@schoolteachers.co.uk> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Antivirus: avast! (VPS 000721-1, 03/03/2007), Outbound message X-Antivirus-Status: Clean X-Virus-Scanned: Maia Mailguard 1.0.1 X-Spam-Status: No, hits=0.176 tagged_above=0 required=5 tests=AWL, BAYES_50 X-Spam-Level: X-Archive-Number: 200703/217 X-Sequence-Number: 110407 On 04/03/2007 18:56, Garry Saddington wrote: >> # select now(); >> now >> ------------------------------- >> 2007-03-04 18:07:54.626267+01 >> (1 row) >> >> Which is precisely what I expect. > Which is precisely what I get, but I want 04-03-2007. Ahh! Then you need to use to_char(). The datestyle setting in postgresql.conf differentiates *only* between European and American date formats - i.e. the relative order of day and month. It doesn't set the exact output format. Ray. --------------------------------------------------------------- Raymond O'Donnell, Director of Music, Galway Cathedral, Ireland rod@iol.ie ---------------------------------------------------------------