Re: Collation rules and multi-lingual databases

From: Joe Conway <mail(at)joeconway(dot)com>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: Stephan Szabo <sszabo(at)megazone(dot)bigpanda(dot)com>, Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, pgsql-hackers(at)postgresql(dot)org
Subject: Re: Collation rules and multi-lingual databases
Date: 2003-08-23 21:08:14
Message-ID: 3F47D7BE.3090505@joeconway.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Greg Stark wrote:
> Joe Conway <mail(at)joeconway(dot)com> writes:
>
>
>>> if (sigsetjmp(Warn_restart, 1) != 0)
>>> {
>>> memcpy(&Warn_restart, &save_restart, sizeof(Warn_restart));
>>> newlocale = setlocale(LC_COLLATE, oldlocale);
>>> if (!newlocale)
>>> elog(PANIC, "setlocale failed to reset locale: %s", localestr);
>>> siglongjmp(Warn_restart, 1);
>>> }
>
>
> Well presumably we want FATAL not PANIC.

Yeah, that was a bit overzealous. I really intended FATAL.

> And do we still need HOLD_INTERRUPTS() .. RESUME_INTERRUPTS() ?

I'm not sure, but I think not.

> I was afraid that was getting into bed too much with the error handling. I
> have an implementation that restores the locale around the palloc and
> increases the initial guess for future calls to avoid degenerate behaviour.

Well the intention of the sigsetjmp was to avoid the need to flip the
locale to-and-fro. Increasing the initial guess might be good, but it
will further restrict the length of the input string you can work with.
But I'd guess you'll not want to use this with extremely long strings
anyway.

Joe

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Peter Eisentraut 2003-08-23 21:56:39 Re: Header files installed for contrib modules?
Previous Message Dave Cramer 2003-08-23 20:03:36 ambiguous sql states