pg.ddx.io  pgsql-interfaces@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Dana Burd <DBurd@cpr.org>
To: 'pgsql-interfaces@postgresql.org' <pgsql-interfaces@postgresql.org>
Subject: Set DateStyle not working
Date: Fri, 25 Feb 2000 14:04:31 -0700
Message-ID: <893CF1EC58DAD211A2C00060089BB15D04C67A@COLORADO> (raw)

I am trying to get my output of a "timestamp" feild to look like "Wed Dec 17
07:37:16 1997 PST"

I have tried from a psql prompt the following:

cprn_apl=> SET DATESTYLE TO 'Postgres';
SET VARIABLE
cprn_apl=> select event_date from events;
event_date
----------------------
2000-04-05 04:34:00-06
2000-03-11 04:34:00-07
2000-03-02 14:23:00-07
2000-03-02 14:23:00-07
2000-06-18 14:23:00-06
2000-06-18 14:23:00-06
(6 rows)

cprn_apl=>

But as you can see, output is still set to 'ISO'.  
****I have also added the following line in my /etc/profile

PGDATESTYLE=Postgres

I logged out and back in.  At the linux prompt I can type 'set' and I can
see the 'PGDATESTYLE=Postgres' enviroment variable set.  But starting up
psql and doing the same select statement above gives me the same ISO output.

I don't even really want the output within psql to be Postgres, I really
just want it to be for the output for my web based application using Pg in
Perl.  I don't really know how to set variables for postgres (like
PGDATESTYLE) when there is no shell being invoked.  Once I can get atleast
psql to output what I want how can I get a output set for a web invoked
perl/cgi program or is that also simply set in the /etc/profile file as
well.

Thanks in advance
dburd@cpr.org



Message-ID: <893CF1EC58DAD211A2C00060089BB15D04C67A@COLORADO>
Permalink:  ../893CF1EC58DAD211A2C00060089BB15D04C67A@COLORADO/
Also on:    postgresql.org/message-id/893CF1EC58DAD211A2C00060089BB15D04C67A@COLORADO

 · 

reply

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 using the --to and --cc options:
  reply via email

  To: pgsql-interfaces@postgresql.org
  Cc: DBurd@cpr.org
  Subject: Re: Set DateStyle not working
  In-Reply-To: <893CF1EC58DAD211A2C00060089BB15D04C67A@COLORADO>

* 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