Re: pulling libpqtypes from queue

From: "Merlin Moncure" <mmoncure(at)gmail(dot)com>
To: "Andrew Chernow" <ac(at)esilo(dot)com>
Cc: "Tom Lane" <tgl(at)sss(dot)pgh(dot)pa(dot)us>, "Alvaro Herrera" <alvherre(at)commandprompt(dot)com>, "Martijn van Oosterhout" <kleptog(at)svana(dot)org>, tomas(at)tuxteam(dot)de, PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: pulling libpqtypes from queue
Date: 2008-04-15 19:29:35
Message-ID: b42b73150804151229x68673c95x790cc7d4c5d5fc5b@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, Apr 15, 2008 at 3:13 PM, Andrew Chernow <ac(at)esilo(dot)com> wrote:
> Tom Lane wrote:
> > Andrew Chernow <ac(at)esilo(dot)com> writes:
> >
> > > Installing it per-conn doesn't get you anything. pqtypes has already
> been linked in. If you use PQexec and PQgetvalue, the pqtypes code pretty
> much does nothing. So, a per-conn install seems redundant. You are
> installing the same function pointers under the same name over and over. If
> you link with, it should just be available.
> > >
> >
> > I don't really agree with that argument; it's not impossible that you'd
> > want it on some connections and not others. The server version for
> > instance could affect the choice.
> >
> > Per-conn install also gets you out of a bunch of thread safety issues
> > (because we've already decreed that it's the app's problem to ensure
> > that only one thread touches a PGconn at a time).

> AFAICS, thread-safety is the big problem. I didn't really like the locking

Maybe if there was PQinitGlobalHooks so that all PGconn structs
created would inherit the hooks automatically...this allows per conn
initialization (if desired) and global initialization which is often
easier. As I understand this, no locking is required, except the init
function needs to be called before any real libpq code takes place (in
threaded environments).

merlin

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Bruce Momjian 2008-04-15 19:34:49 Re: Re: [COMMITTERS] pgsql: Add pg_terminate_backend() to allow terminating only a single
Previous Message Andrew Chernow 2008-04-15 19:13:32 Re: pulling libpqtypes from queue