Re: Thread-unsafe coding in ecpg
От
Tom Lane
Тема
Re: Thread-unsafe coding in ecpg
Дата
Msg-id
24002.1547944649@sss.pgh.pa.us
Ответ на
Re: Thread-unsafe coding in ecpg (Michael Meskes)
Список
Дерево обсуждения
Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Michael Meskes <meskes@postgresql.org>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Michael Meskes <meskes@postgresql.org>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Michael Meskes <meskes@postgresql.org>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
RE: Thread-unsafe coding in ecpg "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
RE: Thread-unsafe coding in ecpg "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
RE: Thread-unsafe coding in ecpg "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
RE: Thread-unsafe coding in ecpg "Tsunakawa, Takayuki" <tsunakawa.takay@jp.fujitsu.com>
Re: Thread-unsafe coding in ecpg Andres Freund <andres@anarazel.de>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg "Joshua D. Drake" <jd@commandprompt.com>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: Thread-unsafe coding in ecpg Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: Thread-unsafe coding in ecpg Andres Freund <andres@anarazel.de>
Re: Thread-unsafe coding in ecpg Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Michael Meskes <meskes@postgresql.org>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Michael Meskes <meskes@postgresql.org>
Re: Thread-unsafe coding in ecpg Andrew Dunstan <andrew.dunstan@2ndquadrant.com>
Re: Thread-unsafe coding in ecpg Andres Freund <andres@anarazel.de>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Re: Thread-unsafe coding in ecpg Michael Meskes <meskes@postgresql.org>
Re: Thread-unsafe coding in ecpg Andrew Gierth <andrew@tao11.riddles.org.uk>
Re: Thread-unsafe coding in ecpg Tom Lane <tgl@sss.pgh.pa.us>
Michael Meskes writes: >> While (b) has more theoretical purity, I'm inclined to think it >> doesn't really improve anybody's life compared to (a), because >> --disable-thread-safety doesn't actually stop anyone from using >> libpq or ecpglib in threaded environments. It just makes it >> more likely to fail when they do. > The question is, what do we do on those platforms? Use setlocale() or > fallback to (a) and document that ecpg has to run in a C locale? No, we shouldn't use setlocale(), because it clearly is hazardous even on platforms where it doesn't fail outright. I don't see anything so wrong with just documenting the hazard. The situation isn't noticeably more dangerous than simple use of the C library; sscanf, strtod, etc are all likely to do surprising things when LC_NUMERIC isn't C. > We could also rewrite the parsing of numbers to not be locale > dependent. Perhaps, but that seems like a giant undertaking. I'm not excited about duplicating strtod(), for instance. regards, tom lane
В списке pgsql-hackers по дате отправления
От: Paul Martinez
Дата: