| From: | Roland Roberts <roland(at)astrofoto(dot)org> | 
|---|---|
| To: | pgsql-sql(at)postgresql(dot)org | 
| Subject: | Re: my pgsql error? | 
| Date: | 2001-03-14 17:53:15 | 
| Message-ID: | m2itlcgruc.fsf@tycho.rlent.pnet | 
| Views: | Whole Thread | Raw Message | Download mbox | Resend email | 
| Thread: | |
| Lists: | pgsql-sql | 
>>>>> "Tom" == Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us> 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(at)rlenter(dot)com                     76-15 113th Street, Apt 3B
rbroberts(at)acm(dot)org                          Forest Hills, NY 11375
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Andrew Perrin | 2001-03-14 18:04:42 | Re: Rule/currval() issue | 
| Previous Message | Tim Perdue | 2001-03-14 17:50:15 | Rule/currval() issue |