Re: thread-safe libpq and DBD::Pg

Поиск
Список
Период
Сортировка
От Goran Thyni
Тема Re: thread-safe libpq and DBD::Pg
Дата
Msg-id 35CD5AE4.DE2DF2B8@bildbasen.se
обсуждение исходный текст
Ответ на Re: [HACKERS] thread-safe libpq and DBD::Pg  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: [INTERFACES] Re: thread-safe libpq and DBD::Pg  (Tom Lane <tgl@sss.pgh.pa.us>)
Список pgsql-interfaces
Tom Lane wrote:
>
> Goran Thyni <goran@bildbasen.se> writes:
> > Has anyone any experience of the thread-safeness of libpq?
>
> PQconnectdb() is not thread-safe, because it scribbles temporary
> data in the static PQconninfoOptions array.  You can get around
> that easily enough by not using PQconnectdb (or PQconndefaults)
> --- use PQsetdbLogin() instead.  In any case the problem exists
> only if different threads try to open database connections
> at the same time.
> [...}

Tom,
thanks for the reply.
DBD::Pg dos indeed use PQconnectdb(),
but at least in my light test I get SEGV in $sth->fetch.
The problems are probably somewhere in DBDI or DBD::Pg or
somewhere in the interaction of the parts.

I am looking into how much work a "pure Perl" interface
should amount to. Using native perl IO and pgsql-fe/be-protocol
should make "pgsql-clienting" even more portable over platforms.

    regards,
        Göran

В списке pgsql-interfaces по дате отправления:

Предыдущее
От: Bruce Momjian
Дата:
Сообщение: Re: [HACKERS] thread-safe libpq and DBD::Pg
Следующее
От: Tom Lane
Дата:
Сообщение: Re: [INTERFACES] Re: thread-safe libpq and DBD::Pg