From: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
---|---|
To: | Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us> |
Cc: | Andrew Dunstan <andrew(at)dunslane(dot)net>, PostgreSQL-patches <pgsql-patches(at)postgresql(dot)org> |
Subject: | Re: Relocatable locale |
Date: | 2004-06-03 00:06:49 |
Message-ID: | 200406030006.i5306oI25269@candle.pha.pa.us |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-patches |
With no one coming up with a better idea, this applied patch adds PGETC
(for pg_service.conf) and PGLOCALE (for locale dir) environment variable
processing to libpq.
The patch also adds code to our client apps so we set the environment
variable directly based on our binary location, unless it is already
set. This will allow our applications to emit proper locale messages
that are generated in libpq.
---------------------------------------------------------------------------
Bruce Momjian wrote:
> Andrew Dunstan wrote:
> >
> >
> > Bruce Momjian wrote:
> >
> > >Peter Eisentraut wrote:
> > >
> > >
> > >>Andrew Dunstan wrote:
> > >>
> > >>
> > >>>I'm confused. Can you explain the problem more clearly, please? Do we
> > >>>need to distinguish known apps with a known (relative) message
> > >>>location, from unknown libpq clients?
> > >>>
> > >>>
> > >>The problem boils down to the fact that libpq needs to find its data
> > >>files (in this case locale data, but it could be anything), but it
> > >>doesn't know its own location, so it can't use a relative path
> > >>reference as has been proposed.
> > >>
> > >>
> > >
> > >I am wondering if we should use environment variables, and have our apps
> > >use putenv() to set it to the proper relative path.
> > >
> > >
> >
> > It seems a bit roundabout, but might make sense. Maybe they shouldn't
> > override any value already present in the environment, just set it if
> > there is nothing there? Then the library could use the environment if
> > set, or fall back on a hardcoded path.
>
> Yes, that is what I was thinking. Call it PGLOCALEDIR.
>
> --
> 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
>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend
>
--
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
Attachment | Content-Type | Size |
---|---|---|
unknown_filename | text/plain | 17.6 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Bruce Momjian | 2004-06-03 00:12:27 | Re: Compiling libpq with VisualC |
Previous Message | Laurent Ballester | 2004-06-02 22:33:29 | Re: eventlog fix |