public inbox for [email protected]  
help / color / mirror / Atom feed
Threes errors of to_char Examples
3+ messages / 2 participants
[nested] [flat]

* Threes errors of to_char Examples
@ 2015-02-27 08:10 liuyuanyuan <[email protected]>
  2015-02-27 14:21 ` Re: Threes errors of to_char Examples Tom Lane <[email protected]>
  0 siblings, 1 reply; 3+ messages in thread

From: liuyuanyuan @ 2015-02-27 08:10 UTC (permalink / raw)
  To: pgsql-docs

Hi all!

I found three errors in postgresql9.4.1document, they are about to_char
examples.

Maybe other version of document also have those errors. Please Check and
modify~

 

In Chapter 9. Functions and Operators of
<http://www.postgresql.org/docs/9.4/interactive/index.html; PostgreSQL 9.4.1
Documentation, I found this:


expression

result


to_char(148.5, '999D999')

' 148,500'


to_char(3148.5, '9G999D999')

' 3 148,500'


to_char(485, 'PL999')

'+485'

 

But, in fact their result are as follow:

 

postgres=# select to_char(148.5,'999D999');

to_char

----------

  148.500

(1 行记录)

 

postgres=# select to_char(3148.5,'9G999D999');

  to_char

------------

  3,148.500

(1 行记录)

 



 

 

Yuanyuan Liu

Blog: http://my.oschina.net/liuyuanyuangogo



Attachments:

  [image/png] image001.png (2.9K, 3-image001.png)
  download | view image

^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Threes errors of to_char Examples
  2015-02-27 08:10 Threes errors of to_char Examples liuyuanyuan <[email protected]>
@ 2015-02-27 14:21 ` Tom Lane <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: Tom Lane @ 2015-02-27 14:21 UTC (permalink / raw)
  To: liuyuanyuan <[email protected]>; +Cc: pgsql-docs

"liuyuanyuan" <[email protected]> writes:
> I found three errors in postgresql9.4.1document, they are about to_char
> examples.

All the cases you mention vary depending on what locale you're using.

			regards, tom lane


-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs




^ permalink  raw  reply  [nested|flat] 3+ messages in thread

* Re: Threes errors of to_char Examples
@ 2015-02-28 05:14 liuyuanyuan <[email protected]>
  0 siblings, 0 replies; 3+ messages in thread

From: liuyuanyuan @ 2015-02-28 05:14 UTC (permalink / raw)
  To: 'Tom Lane' <[email protected]>; +Cc: pgsql-docs

"liuyuanyuan" <[email protected]> writes:
> I found three errors in postgresql9.4.1document, they are about to_char
> examples.

Tom Lane <[email protected]> writes:
>the cases you mention vary depending on what locale you're using.

Thanks for your reply!
I know pattern D and G depending on locale.
My default locale is zh_cn, but when I init DB using locale=en_us.utf8, I
still got the same result.
I haven't use other locales to test any more, maybe they will bring
different results.
Whatever, I think it's better to report here.
Maybe declaring the locale for the examples is better, if possible.
Regards!

Yuanyuan Liu





-- 
Sent via pgsql-docs mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-docs




^ permalink  raw  reply  [nested|flat] 3+ messages in thread


end of thread, other threads:[~2015-02-28 05:14 UTC | newest]

Thread overview: 3+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2015-02-27 08:10 Threes errors of to_char Examples liuyuanyuan <[email protected]>
2015-02-27 14:21 ` Tom Lane <[email protected]>
2015-02-28 05:14 Re: Threes errors of to_char Examples liuyuanyuan <[email protected]>

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox