Re: thread safety tests

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Jan Wieck <JanWieck(at)Yahoo(dot)com>
Cc: PostgreSQL-development <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: thread safety tests
Date: 2004-06-10 04:13:19
Message-ID: 200406100413.i5A4DJn14828@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers


Are people OK with requiring PGUSER, $USER, $LOGNAME, or the username to
be supplied by the connection string in libpq on platforms that want
threads and don't have getpwuid_r() (Solaris, FreeBSD, etc.)?

If so, I can easily create a patch and apply it.

---------------------------------------------------------------------------

Jan Wieck wrote:
> On 6/9/2004 1:44 PM, Bruce Momjian wrote:
>
> > Jan Wieck wrote:
> >> On 6/9/2004 1:04 PM, Bruce Momjian wrote:
> >>
> >> > What we really need is a way to do the uid->username mapping in a
> >> > thread-safe way. Could we check the environment for $USER or $LOGNAME?
> >> > Could we require them to be set for thread builds on OS's without
> >> > getpwuid_r and in cases where the username is not specified in the
> >> > connection string?
> >>
> >> Maybe not as popular, but what about breaking backward compatibility and
> >> require the DB name to be specified, no username fallback? How many
> >> applications really rely on that feature? And people who are used to it
> >> from the commandline can set PGDATABASE in their .profile to get it back.
> >
> > That is only part of where the username is used. I assume it is also
> > used for connections when the username isn't supplied, not just as the
> > default for the database name.
> >
> > Basically on those platforms, either the username would have to be in
> > the environment, or supplied as part of the connection string.
> >
>
> We have PGUSER, PGHOST, PGPORT, PGDATABASE, all of them you can set in
> your .profile, why do we need to lookup the uid at all?
>
>
> Jan
>
> --
> #======================================================================#
> # It's easier to get forgiveness for being wrong than for being right. #
> # Let's break this rule - forgive me. #
> #================================================== JanWieck(at)Yahoo(dot)com #
>

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2004-06-10 05:12:34 Re: Why hash indexes suck
Previous Message Bruce Momjian 2004-06-10 04:11:09 Re: [PATCHES] serverlog function (log_destination file)