Re: environment variables, output format & setting current - Mailing list pgsql-general

From Thalis A. Kalfigopoulos
Subject Re: environment variables, output format & setting current
Date
Msg-id Pine.LNX.4.21.0202212011370.18175-100000@aluminum.cs.pitt.edu
Whole thread Raw
In response to environment variables, output format & setting current date  (Brent Wood <baw@frc.niwa.cri.nz>)
List pgsql-general
It looks that you want the date, for usage at the shell level. Why not just do "date +%Y-%m-%d" ?

cheers,
thalis



On Fri, 22 Feb 2002, Brent Wood wrote:

>
> Three questions:
>
>
> 1. In a script, how do I set the value of a date attr to the current
> date. I've tried a few obvious approaches but nothing works yet.
>
>
>
> 2.If I do:
>           psql <db> -c "select current_date;"
> I get:
>
>     date
> ------------
>  2002-02-23
> (1 row)
>
> I can use:
>           psql <db> -c "select current_date;" | tail -3 | head -1
> to just get the date value, but is there simpler way?
>
>
> And lastly, I believe there are a few environmental variables used to
> control various PostgreSQL behaviours, eg: date/time format. Where is
> there a list of these? (I can't find them in the docs)
>
> Thanks
>
>
> =============================================================================
>
>        _-''-_    <Brent Wood> b.wood@niwa.cri.nz  Ph: +64(4)386-0300
>       'o     \/  NIWA, Box 14901,
>       > )    /\  Kilbirnie, Wellington, New Zealand
>       `-===-'    #include <std_disclaimer>
>
>
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: Have you searched our list archives?
>
> http://archives.postgresql.org
>


pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: PL/pgSQL Memory Management?
Next
From: Rip
Date:
Subject: metadata and views