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

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

datestyle setting

От
Kenneth Gonsalves
Дата:
hi,
i have a website with a postgresql backend. Being a shared site, i
have no root access. i do have shell access to the database, but
cannot create or drop the database. I access the database through
python scripts using the psycopg adapter. My question is, how do i
set the pgdatestyle in the database as 'European,sql'?
--
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.sourceforge.net
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!


Re: datestyle setting

От
Tom Lane
Дата:
Kenneth Gonsalves <lawgon@thenilgiris.com> writes:
> i have a website with a postgresql backend. Being a shared site, i 
> have no root access. i do have shell access to the database, but 
> cannot create or drop the database. I access the database through 
> python scripts using the psycopg adapter. My question is, how do i 
> set the pgdatestyle in the database as 'European,sql'?

If it's a reasonably recent version of PG, either ALTER DATABASE SET
or ALTER USER SET might serve.
        regards, tom lane


Re: datestyle setting

От
Kenneth Gonsalves
Дата:
On Wednesday 09 Mar 2005 11:57 am, Tom Lane wrote:
> Kenneth Gonsalves <lawgon@thenilgiris.com> writes:
> > i have a website with a postgresql backend. Being a shared site,
> > i have no root access. i do have shell access to the database,
> > but cannot create or drop the database. I access the database
> > through python scripts using the psycopg adapter. My question is,
> > how do i set the pgdatestyle in the database as 'European,sql'?
>
> If it's a reasonably recent version of PG, either ALTER DATABASE
> SET or ALTER USER SET might serve.

postgresql 7.4. when i type:

alter database set datestyle to 'European'

i get 'syntax error at or near "datestyle" at character 20'
--
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.sourceforge.net
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!


Re: datestyle setting

От
Richard Huxton
Дата:
Kenneth Gonsalves wrote:
> On Wednesday 09 Mar 2005 11:57 am, Tom Lane wrote:
>>
>>If it's a reasonably recent version of PG, either ALTER DATABASE
>>SET or ALTER USER SET might serve.
> 
> 
> postgresql 7.4. when i type:
> 
> alter database set datestyle to 'European'
> 
> i get 'syntax error at or near "datestyle" at character 20'

I keep making this mistake, you need to include the database name:  ALTER DATABASE my_db_name SET datestyle TO 'ISO';

--   Richard Huxton  Archonet Ltd


Re: datestyle setting

От
Kenneth Gonsalves
Дата:
On Wednesday 09 Mar 2005 1:40 pm, Richard Huxton wrote:

>
> I keep making this mistake, you need to include the database name:
>    ALTER DATABASE my_db_name SET datestyle TO 'ISO';

er ... doesnt seem to be in the docs? Anyway it worked, thanx

--
regards
kg

http://www.livejournal.com/users/lawgon
tally ho! http://avsap.sourceforge.net
ಇಂಡ್ಲಿನಕ್ಸ வாழ்க!


Re: datestyle setting

От
Richard Huxton
Дата:
Kenneth Gonsalves wrote:
> On Wednesday 09 Mar 2005 1:40 pm, Richard Huxton wrote:
> 
> 
>>I keep making this mistake, you need to include the database name:
>>   ALTER DATABASE my_db_name SET datestyle TO 'ISO';
> 
> 
> er ... doesnt seem to be in the docs? Anyway it worked, thanx

http://www.postgresql.org/docs/7.4/static/sql-alterdatabase.html

Synopsis

ALTER DATABASE name SET parameter { TO | = } { value | DEFAULT }
ALTER DATABASE name RESET parameter

--   Richard Huxton  Archonet Ltd