Re: pg_locale (Was: Re: Problem with setlocale (found in libecpg)...)

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
Cc: pgsql-patches <pgsql-patches(at)postgresql(dot)org>, Christof Petig <christof(at)petig-baender(dot)de>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Subject: Re: pg_locale (Was: Re: Problem with setlocale (found in libecpg)...)
Date: 2001-09-28 19:37:41
Message-ID: 200109281937.f8SJbfE13805@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers pgsql-patches


Your patch has been added to the PostgreSQL unapplied patches list at:

http://candle.pha.pa.us/cgi-bin/pgpatches

I will try to apply it within the next 48 hours.

> On Thu, Sep 27, 2001 at 12:08:29AM -0400, Tom Lane wrote:
> > >> Well at least on glibc-2.2 it seems that setlocale retuns a pointer to
> > >> malloced memory, and frees this pointer on subsequent calls to
> > >> setlocale.
> > >> So I would kindly ask you to take a second look at every invokation of
> > >> setlocale.
> >
> > I looked around, and am worried about the behavior of PGLC_current()
> > in src/backend/utils/adt/pg_locale.c. It doesn't change locale but
> > does retrieve several successive setlocale() results. Does that work
> > in glibc?
>
> The patch is attached. Now it's independent on glibc's game of setlocale()
> results and free/strdup. It works for me...
>
> Thanks to Christof!
>
> Karel
>
> --
> Karel Zak <zakkr(at)zf(dot)jcu(dot)cz>
> http://home.zf.jcu.cz/~zakkr/
>
> C, PostgreSQL, PHP, WWW, http://docs.linux.cz, http://mape.jcu.cz

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 853-3000
+ If your life is a hard drive, | 830 Blythe Avenue
+ Christ can be your backup. | Drexel Hill, Pennsylvania 19026

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2001-09-28 19:50:12 Re: [PHP] [BUGS] PostgreSQL / PHP Overrun Error
Previous Message Bruce Momjian 2001-09-28 19:33:38 Re: Fragmenting tables in postgres

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2001-09-28 19:43:36 Re: psql microsecond timing patch
Previous Message Bruce Momjian 2001-09-28 19:28:20 Re: More fixes for missing double quotes in the shell scripts