Обсуждение: set datestyle

Поиск
Список
Период
Сортировка

set datestyle

От
"mike"
Дата:
I'm trying to reset my datestyle which works till I have to log out and log back into my shell.
the docs have nothign in them ast to how to keep the datestyle set. is this somethign that can
be done once, or does it have to be done every single time?
 
Mike

Re: set datestyle

От
Tom Lane
Дата:
Peter Eisentraut <peter_e@gmx.net> writes:
> Ideally yes, but they're "special cases" by virtue of behaving specially.
> AFAIR, the behaviour couldn't be fitted in exactly, but maybe with the
> "assign hook" it would work.

Even if these variables can't easily be made table-driven,
it seems like the code in SetPGVariable should be removed and folded
into set_config_option, so that the special-case variable names are
recognized in more cases than just SET.

            regards, tom lane

Re: set datestyle

От
Tom Lane
Дата:
"mike" <matrix@quadrent.net> writes:
> I'm trying to reset my datestyle which works till I have to log out and log=
>  back into my shell.
> the docs have nothign in them ast to how to keep the datestyle set. is this=
>  somethign that can
> be done once, or does it have to be done every single time?

It ought to be possible to set datestyle in postgresql.conf, but AFAICS
it's not at the moment.  (Hey Peter, couldn't the special cases in
SetPGVariable be handled in guc.c instead?)

In the meantime, try starting the postmaster with environment variable
PGDATESTYLE set.

            regards, tom lane

Re: set datestyle

От
Peter Eisentraut
Дата:
Tom Lane writes:

> "mike" <matrix@quadrent.net> writes:
> > I'm trying to reset my datestyle which works till I have to log out and log=
> >  back into my shell.
> > the docs have nothign in them ast to how to keep the datestyle set. is this=
> >  somethign that can
> > be done once, or does it have to be done every single time?
>
> It ought to be possible to set datestyle in postgresql.conf, but AFAICS
> it's not at the moment.  (Hey Peter, couldn't the special cases in
> SetPGVariable be handled in guc.c instead?)

Ideally yes, but they're "special cases" by virtue of behaving specially.
AFAIR, the behaviour couldn't be fitted in exactly, but maybe with the
"assign hook" it would work.

--
Peter Eisentraut   peter_e@gmx.net   http://funkturm.homeip.net/~peter