pg.ddx.io pgsql-sql@postgresql.org mailing list archive
help / color / mirror / Atom feedChange date format through an environmental variable?
10+ messages / 6 participants
[nested] [flat]
* Change date format through an environmental variable?
@ 2006-03-01 17:32 Mark Fenbers <Mark.Fenbers@noaa.gov>
0 siblings, 3 replies; 10+ messages in thread
From: Mark Fenbers @ 2006-03-01 17:32 UTC (permalink / raw)
To: pgsql-sql
I want to get Pg (v7.4.7) to output a date field in a different format
than yyyy-mm-dd through the use of an environmental variable (because I
have no access the SQL). Is this possible? I know about the DATESTYLE
variable, but that seems to work only within a query transaction, and
has no effect if trying to set it as an envvar.
Mark
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-01 18:47 Andrew Sullivan <ajs@crankycanuck.ca>
parent: Mark Fenbers <Mark.Fenbers@noaa.gov>
2 siblings, 0 replies; 10+ messages in thread
From: Andrew Sullivan @ 2006-03-01 18:47 UTC (permalink / raw)
To: pgsql-sql
On Wed, Mar 01, 2006 at 12:32:26PM -0500, Mark Fenbers wrote:
> have no access the SQL). Is this possible? I know about the DATESTYLE
> variable, but that seems to work only within a query transaction, and
> has no effect if trying to set it as an envvar.
No, it won't work as an environment variable. You can alter the
postgresql.conf file, though.
A
--
Andrew Sullivan | ajs@crankycanuck.ca
When my information changes, I alter my conclusions. What do you do sir?
--attr. John Maynard Keynes
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-01 19:20 Mark Fenbers <Mark.Fenbers@noaa.gov>
parent: Mark Fenbers <Mark.Fenbers@noaa.gov>
2 siblings, 2 replies; 10+ messages in thread
From: Mark Fenbers @ 2006-03-01 19:20 UTC (permalink / raw)
To: pgsql-sql
I found PGDATESTYLE that solves my problem, but ever since, I've been
looking for a comprehensive list of environmental variables that Pg
recognizes, but haven't been able to find such a list in any of the
books I looked in or the man pages. Anyone know where I can find such a
list?
Mark
Mark Fenbers wrote:
> I want to get Pg (v7.4.7) to output a date field in a different format
> than yyyy-mm-dd through the use of an environmental variable (because
> I have no access the SQL). Is this possible? I know about the
> DATESTYLE variable, but that seems to work only within a query
> transaction, and has no effect if trying to set it as an envvar.
>
> Mark
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-01 19:26 Andrew Sullivan <ajs@crankycanuck.ca>
parent: Mark Fenbers <Mark.Fenbers@noaa.gov>
1 sibling, 0 replies; 10+ messages in thread
From: Andrew Sullivan @ 2006-03-01 19:26 UTC (permalink / raw)
To: pgsql-sql
On Wed, Mar 01, 2006 at 02:20:57PM -0500, Mark Fenbers wrote:
> I found PGDATESTYLE that solves my problem, but ever since, I've been
> looking for a comprehensive list of environmental variables that Pg
> recognizes, but haven't been able to find such a list in any of the
> books I looked in or the man pages. Anyone know where I can find such a
> list?
That's a client variable, and it works for libpq-based clients that
don't do something funny with them (none of them ought to, but one
can't guarantee others' programs). So you're not modifying for other
clients, AFAIK, just for you. (If that's what you want, well, good,
but it's important to know what it does.)
The list for 8.1 is in the docs:
http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html
A
--
Andrew Sullivan | ajs@crankycanuck.ca
A certain description of men are for getting out of debt, yet are
against all taxes for raising money to pay it off.
--Alexander Hamilton
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-01 19:42 Michael Fuhr <mike@fuhr.org>
parent: Mark Fenbers <Mark.Fenbers@noaa.gov>
1 sibling, 1 reply; 10+ messages in thread
From: Michael Fuhr @ 2006-03-01 19:42 UTC (permalink / raw)
To: Mark Fenbers <Mark.Fenbers@noaa.gov>; +Cc: pgsql-sql
On Wed, Mar 01, 2006 at 02:20:57PM -0500, Mark Fenbers wrote:
> I found PGDATESTYLE that solves my problem, but ever since, I've been
> looking for a comprehensive list of environmental variables that Pg
> recognizes, but haven't been able to find such a list in any of the
> books I looked in or the man pages. Anyone know where I can find such a
> list?
The libpq documentation has a list of environment variables, although
it's not complete:
http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html
--
Michael Fuhr
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-02 06:16 Tom Lane <tgl@sss.pgh.pa.us>
parent: Michael Fuhr <mike@fuhr.org>
0 siblings, 1 reply; 10+ messages in thread
From: Tom Lane @ 2006-03-02 06:16 UTC (permalink / raw)
To: Michael Fuhr <mike@fuhr.org>; +Cc: Mark Fenbers <Mark.Fenbers@noaa.gov>; pgsql-sql
Michael Fuhr <mike@fuhr.org> writes:
> The libpq documentation has a list of environment variables, although
> it's not complete:
> http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html
Er, what's not complete about it? Feel free to send a doc patch ...
regards, tom lane
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-02 07:33 Michael Fuhr <mike@fuhr.org>
parent: Tom Lane <tgl@sss.pgh.pa.us>
0 siblings, 2 replies; 10+ messages in thread
From: Michael Fuhr @ 2006-03-02 07:33 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Mark Fenbers <Mark.Fenbers@noaa.gov>; pgsql-sql
On Thu, Mar 02, 2006 at 01:16:47AM -0500, Tom Lane wrote:
> Michael Fuhr <mike@fuhr.org> writes:
> > The libpq documentation has a list of environment variables, although
> > it's not complete:
> > http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html
>
> Er, what's not complete about it? Feel free to send a doc patch ...
Missing from that page are mostly standard variables that aren't
specific to PostgreSQL but that applications like psql might use.
Documented elsewhere are:
EDITOR (psql)
PAGER (psql)
PGDATA (various)
PSQL_EDITOR (psql)
SHELL (psql)
TMPDIR (psql)
TZ (postmaster)
VISUAL (psql)
I see LC_COLLATE and LC_CTYPE in a few places but not in the
documentation for postgres/postmaster, which is where they appear
to be used (backend/main/main.c). Should those pages mention them?
A couple of variables are used in the code but aren't mentioned in
the documentation. Are they worth documenting?
COMSPEC (psql, Win32 only)
PG_DBPATH (ecpg, Informix mode)
--
Michael Fuhr
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-02 07:42 Michael Fuhr <mike@fuhr.org>
parent: Michael Fuhr <mike@fuhr.org>
1 sibling, 0 replies; 10+ messages in thread
From: Michael Fuhr @ 2006-03-02 07:42 UTC (permalink / raw)
To: Tom Lane <tgl@sss.pgh.pa.us>; +Cc: Mark Fenbers <Mark.Fenbers@noaa.gov>; pgsql-sql
On Thu, Mar 02, 2006 at 12:33:31AM -0700, Michael Fuhr wrote:
> On Thu, Mar 02, 2006 at 01:16:47AM -0500, Tom Lane wrote:
> > Michael Fuhr <mike@fuhr.org> writes:
> > > The libpq documentation has a list of environment variables, although
> > > it's not complete:
> > > http://www.postgresql.org/docs/8.1/interactive/libpq-envars.html
> >
> > Er, what's not complete about it? Feel free to send a doc patch ...
>
> Missing from that page are mostly standard variables that aren't
> specific to PostgreSQL but that applications like psql might use.
By "missing" and "incomplete" I didn't mean to suggest that the
other variables belong in the libpq documentation; I just meant
that various components of PostgreSQL use variables that aren't
mentioned there.
--
Michael Fuhr
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-02 08:46 Peter Eisentraut <peter_e@gmx.net>
parent: Michael Fuhr <mike@fuhr.org>
1 sibling, 0 replies; 10+ messages in thread
From: Peter Eisentraut @ 2006-03-02 08:46 UTC (permalink / raw)
To: pgsql-sql; +Cc: Michael Fuhr <mike@fuhr.org>; Tom Lane <tgl@sss.pgh.pa.us>; Mark Fenbers <Mark.Fenbers@noaa.gov>
Am Donnerstag, 2. März 2006 08:33 schrieb Michael Fuhr:
> I see LC_COLLATE and LC_CTYPE in a few places but not in the
> documentation for postgres/postmaster, which is where they appear
> to be used (backend/main/main.c). Should those pages mention them?
No, these variables are not used there, only by initdb.
--
Peter Eisentraut
http://developer.postgresql.org/~petere/
^ permalink raw reply [nested|flat] 10+ messages in thread
* Re: Change date format through an environmental variable?
@ 2006-03-02 15:33 george young <gry@ll.mit.edu>
parent: Mark Fenbers <Mark.Fenbers@noaa.gov>
2 siblings, 0 replies; 10+ messages in thread
From: george young @ 2006-03-02 15:33 UTC (permalink / raw)
To: pgsql-sql
Try the PGDATESTYLE environment variable.
Works in 7.4 and 8.1, though it is claimed to be deprecated.
-- George Young
On Wed, 01 Mar 2006 12:32:26 -0500
Mark Fenbers <Mark.Fenbers@noaa.gov> threw this fish to the penguins:
> I want to get Pg (v7.4.7) to output a date field in a different format
> than yyyy-mm-dd through the use of an environmental variable (because I
> have no access the SQL). Is this possible? I know about the DATESTYLE
> variable, but that seems to work only within a query transaction, and
> has no effect if trying to set it as an envvar.
>
> Mark
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: don't forget to increase your free space map settings
>
--
"Are the gods not just?" "Oh no, child.
What would become of us if they were?" (CSL)
^ permalink raw reply [nested|flat] 10+ messages in thread
end of thread, other threads:[~2006-03-02 15:33 UTC | newest]
Thread overview: 10+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2006-03-01 17:32 Change date format through an environmental variable? Mark Fenbers <Mark.Fenbers@noaa.gov>
2006-03-01 18:47 ` Andrew Sullivan <ajs@crankycanuck.ca>
2006-03-01 19:20 ` Mark Fenbers <Mark.Fenbers@noaa.gov>
2006-03-01 19:26 ` Andrew Sullivan <ajs@crankycanuck.ca>
2006-03-01 19:42 ` Michael Fuhr <mike@fuhr.org>
2006-03-02 06:16 ` Tom Lane <tgl@sss.pgh.pa.us>
2006-03-02 07:33 ` Michael Fuhr <mike@fuhr.org>
2006-03-02 07:42 ` Michael Fuhr <mike@fuhr.org>
2006-03-02 08:46 ` Peter Eisentraut <peter_e@gmx.net>
2006-03-02 15:33 ` george young <gry@ll.mit.edu>
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