Received: from sss.sss.pgh.pa.us (sss.pgh.pa.us [206.210.65.6]) by hub.org (8.9.2/8.9.1) with ESMTP id KAA99003 for ; Thu, 15 Apr 1999 10:55:46 -0400 (EDT) (envelope-from tgl@sss.pgh.pa.us) Received: from sss.sss.pgh.pa.us (localhost [127.0.0.1]) by sss.sss.pgh.pa.us (8.9.1/8.9.1) with ESMTP id KAA11047; Thu, 15 Apr 1999 10:54:27 -0400 (EDT) To: "Randal Flagg" cc: pgsql-sql@hub.org Subject: Re: [SQL] external environment variable In-reply-to: Your message of Wed, 14 Apr 1999 23:00:34 -0400 (EDT) <199904150300.XAA93902@hub.org> Date: Thu, 15 Apr 1999 10:54:26 -0400 Message-ID: <11045.924188066@sss.pgh.pa.us> From: Tom Lane "Randal Flagg" 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