Received: from mail.astrofoto.org (roland-0.dsl.speakeasy.net [216.254.9.145]) by mail.postgresql.org (8.11.1/8.11.1) with ESMTP id f2EHrLx52885 for ; Wed, 14 Mar 2001 12:53:22 -0500 (EST) (envelope-from roland@rlenter.com) Received: (from roland@localhost) by mail.astrofoto.org (8.11.0/8.8.7) id f2EHrGF26383; Wed, 14 Mar 2001 12:53:16 -0500 To: pgsql-sql@postgresql.org Subject: Re: my pgsql error? References: <20010314095433.E00372A683@mainbox.archonet.com> <24923.984581391@sss.pgh.pa.us> From: Roland Roberts Date: 14 Mar 2001 12:53:15 -0500 In-Reply-To: <24923.984581391@sss.pgh.pa.us> Message-ID: Lines: 33 User-Agent: Gnus/5.09 (Gnus v5.9.0) Emacs/21.0.98 MIME-Version: 1.0 Content-Type: text/plain; charset=us-ascii X-Archive-Number: 200103/283 X-Sequence-Number: 1945 >>>>> "Tom" == Tom Lane writes: >> For a moment I thought you could do to_char(now(),'Day DD Month YYYY' >> but you're quite right you need to rtrim() the various pieces. Tom> regression=# select to_char(now()-10,'Day DD Month YYYY'); Tom> to_char Tom> ----------------------------- Tom> Sunday 04 March 2001 Tom> (1 row) Tom> regression=# select to_char(now()-10,'fmDay fmDD fmMonth YYYY'); Tom> to_char Tom> --------------------- Tom> Sunday 4 March 2001 Tom> (1 row) Tom> The 'fm' prefix is not very well explained in the docs at It doesn't seem to be explained at all, just listed in the table. I'd suggest adding the following (and perhaps include your example selects from above) to the usage notes below table 4-11: o to_char() does not remove trailing blanks from fields which are blank padded, e.g., `Day' and `Month', unless the `FM' prefix is used. roland -- PGP Key ID: 66 BC 3B CD Roland B. Roberts, PhD RL Enterprises roland@rlenter.com 76-15 113th Street, Apt 3B rbroberts@acm.org Forest Hills, NY 11375