Re: Why length(to_char(1::integer, '9')) = 2 ?

Поиск
Список
Период
Сортировка
От Bruce Momjian
Тема Re: Why length(to_char(1::integer, '9')) = 2 ?
Дата
Msg-id 201103111548.p2BFmj327143@momjian.us
обсуждение исходный текст
Ответ на Re: Why length(to_char(1::integer, '9')) = 2 ?  (Dmitriy Igrishin <dmitigr@gmail.com>)
Список pgsql-general
Dmitriy Igrishin wrote:
> 2011/3/10 Bruce Momjian <bruce@momjian.us>
>
> > Dmitriy Igrishin wrote:
> > > dmitigr=> SELECT '>'||to_char(0.1, '0.99999')||'<' AS v;
> > >      v
> > > ------------
> > >  > 0.10000<
> > >
> > > dmitigr=> SELECT '>'||to_char(0.1, 'FM0.99999')||'<' AS v;
> > >    v
> > > -------
> > >  >0.1<
> > >
> > > So, padding zeroes suppressed by FM is a rest of the value.
> >
> > Any documentation changes suggested?
> >
> I propose to replace "fill mode (suppress padding blanks and zeroes)"
> located here
> http://www.postgresql.org/docs/9.0/static/functions-formatting.html#FUNCTIONS-FORMATTING-NUMERICMOD-TABLE
> with
> "fill mode (suppress padding blanks and trailing zeroes)".

Thanks.  Attached patch applied.

--
  Bruce Momjian  <bruce@momjian.us>        http://momjian.us
  EnterpriseDB                             http://enterprisedb.com

  + It's impossible for everything to be true. +
diff --git a/doc/src/sgml/func.sgml b/doc/src/sgml/func.sgml
index f746ed6..da45970 100644
--- a/doc/src/sgml/func.sgml
+++ b/doc/src/sgml/func.sgml
@@ -5446,7 +5446,7 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
       <tbody>
        <row>
         <entry><literal>FM</literal> prefix</entry>
-        <entry>fill mode (suppress padding blanks and zeroes)</entry>
+        <entry>fill mode (suppress padding blanks and trailing zeroes)</entry>
         <entry><literal>FMMonth</literal></entry>
        </row>
        <row>
@@ -5812,7 +5812,7 @@ SELECT SUBSTRING('XY1234Z', 'Y*?([0-9]{1,3})');
       <tbody>
        <row>
         <entry><literal>FM</literal> prefix</entry>
-        <entry>fill mode (suppress padding blanks and zeroes)</entry>
+        <entry>fill mode (suppress padding blanks and trailing zeroes)</entry>
         <entry><literal>FM9999</literal></entry>
        </row>
        <row>

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

Предыдущее
От: hubert depesz lubaczewski
Дата:
Сообщение: Re: Huge spikes in number of connections doing "PARSE"
Следующее
От: akp geek
Дата:
Сообщение: ERROR: Failed with error 22007-invalid value "" for "mm" vacuumdb