strxfrm implementation

Lists: pgsql-hackers
From: Greg Stark <gsstark(at)mit(dot)edu>
To: pgsql-hackers(at)postgresql(dot)org
Subject: strxfrm implementation
Date: 2005-01-25 18:06:12
Message-ID: 877jm12xkb.fsf@stark.xeocode.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers


Today someone posted (or tried to post, I didn't get the attachment) an
implementation of strxfrm using setlocale again. I think this is the second or
third time someone has tried their hand at this. Clearly there's a demand for
it and I fear some of the users trying to do this aren't aware of all the
problems that were identified a couple years ago on this list.

I think the best implementation so far is Joe Conway's that used
sigsetjmp/siglongjmp to catch errors safely. I would strongly suggest putting
this implementation in contrib to save all those people from repeating the
same mistakes I made and others have made. Especially since the consequences
of those mistakes include potentially corrupting the database.

I would suggest it be put in the core system except that as has been pointed
out the performance isn't satisfactory on every platform. The only platform we
have confirmation that the performance is reasonable is glibc-based systems.

Attachment Content-Type Size
strxfrm2.c text/x-csrc 4.4 KB

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Greg Stark <gsstark(at)mit(dot)edu>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: strxfrm implementation
Date: 2005-01-25 18:14:50
Message-ID: 5384.1106676890@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-hackers

Greg Stark <gsstark(at)mit(dot)edu> writes:
> I think the best implementation so far is Joe Conway's that used
> sigsetjmp/siglongjmp to catch errors safely.

... which has been obsoleted by PG_TRY/PG_CATCH ...

regards, tom lane