From: Tom Lane <tgl@sss.pgh.pa.us>
To: Randal Flagg <flagg_randal@hotmail.com>
Cc: pgsql-sql@hub.org
Subject: Re: [SQL] external environment variable
Date: Thu, 15 Apr 1999 10:54:26 -0400
Message-ID: <11045.924188066@sss.pgh.pa.us> (raw)
In-Reply-To: <199904150300.XAA93902@hub.org>
"Randal Flagg" <flagg_randal@hotmail.com> writes:
> I've a little problem. I've installed Apache JServ 1.03b and it
> works very good, I've also installed PostreSQL 6.4 and I set the
> environment variable PGDATESTYLE in the /etc/profile file. When I use
> PostgreSQL directly, date's fields are shown according to the
> PGDATESTYLE but, when I query a table across the Web using a Servlet
> PostreSQL ignore PGDATESTYLE and use it's default.
You didn't give any details about how the servlet is constructed,
but for anything based on libpq, the PGDATESTYLE setting at the client
is what matters, not the setting in the server machine's environment.
(libpq automatically issues SET commands for datestyle and a couple of
other variables during connection startup, using whatever values it
finds in its environment variables.)
In particular, setting /etc/profile isn't making things work the way
you want on the server machine because of putting PGDATESTYLE into
the postmaster/backend environment. Rather, it's affecting the *client*
environment in which psql or other client apps run, and that setting
is getting transmitted to the backend process.
So, either set up the environment values you want for the client servlet,
or issue the desired SET commands "by hand" within the servlet.
regards, tom lane
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients from your mail client; the link fills in
the headers below: reply via email
Some clients, webmail especially, drop In-Reply-To and References from
a link, and the reply then starts a new thread: use the mbox below.
To: pgsql-sql@postgresql.org
Cc: tgl@sss.pgh.pa.us, flagg_randal@hotmail.com, pgsql-sql@hub.org
Subject: Re: [SQL] external environment variable
In-Reply-To: <11045.924188066@sss.pgh.pa.us>
References: <199904150300.XAA93902@hub.org> <11045.924188066@sss.pgh.pa.us>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox