Skip site navigation (1) Skip section navigation (2)

Re: wrong behavior using to_char()

From: Bruce Momjian <bruce(at)momjian(dot)us>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: Euler Taveira de Oliveira <euler(at)timbira(dot)com>, pgsql-bugs(at)postgresql(dot)org
Subject: Re: wrong behavior using to_char()
Date: 2006-09-14 22:55:17
Message-ID: 200609142255.k8EMtI815065@momjian.us (view raw or flat)
Thread:
Lists: pgsql-bugspgsql-patches
Tom Lane wrote:
> "Euler Taveira de Oliveira" <euler(at)timbira(dot)com> writes:
> > In the pt_BR locale, the thousand separator is "". So it should return
> > 12345,670. Looking at the source, I saw that the test cases for locale
> > properties are independent among them. I think that the correct form is to
> > have all-or-nothing test case or didn't test *lconv->property ("" is
> > evaluated to false). Attached is a patch that fixes it using the second
> > option.
> 
> Not unless you have a solution to the problem seen in this thread:
> http://archives.postgresql.org/pgsql-patches/2006-02/msg00172.php

I was going to point him to these commits to formatting.c:

	date: 2006/02/12 23:48:23;  author: momjian;  state: Exp;  lines: +3 -4
	Revert because C locale uses "" for thousands_sep, meaning "n/a", while
	French uses "" for "don't want".  Seems we have to keep the existing
	behavior.
	----------------------------
	revision 1.105
	date: 2006/02/12 19:52:06;  author: momjian;  state: Exp;  lines: +5 -4
	Support "" for thousands separator and plus sign in to_char(), per
	report from French Debian user.  psql already handles "" fine.

One idea would be to handle C locale behavior differently from non-C
locale.

-- 
  Bruce Momjian   bruce(at)momjian(dot)us
  EnterpriseDB    http://www.enterprisedb.com

  + If your life is a hard drive, Christ can be your backup. +

In response to

Responses

pgsql-bugs by date

Next:From: Jorge GodoyDate: 2006-09-15 00:44:09
Subject: Re: wrong behavior using to_char()
Previous:From: Tom LaneDate: 2006-09-14 22:52:36
Subject: Re: wrong behavior using to_char()

pgsql-patches by date

Next:From: Bruce MomjianDate: 2006-09-14 23:22:50
Subject: Fix postgresql.conf alignment
Previous:From: Tom LaneDate: 2006-09-14 22:52:36
Subject: Re: wrong behavior using to_char()

Privacy Policy | About PostgreSQL
Copyright © 1996-2014 The PostgreSQL Global Development Group