[postgis-users] Convert from character to timestamptz
Mathieu Basille
basille at ase-research.org
Sun Dec 18 19:56:42 PST 2011
Le 01/10/2011 03:02, Sandro Santilli a écrit :
> On Fri, Sep 30, 2011 at 09:10:27PM -0400, Mathieu Basille wrote:
>> Le 30/09/2011 17:49, Sandro Santilli a écrit :
>>>> You're right, I'm being too vague (in my defence, error messages are
>>>> in French for me!).
>>>
>>> See if exporting LANG=C helps there.
>>
>> Did you mean at the command line or in the SQL query window? I tried
>> both with no success.
>> I also tried to launch pgAdmin with 'LC_ALL=C pgadmin3', but error
>> messages were still in French. What's weird is that the whole
>> software runs in English!
>
> You probably need that variable to be in the backend environment, as
> that's where the messages originate from. But a user-driven language
> support would make much more sense so maybe it _is_ possible to do,
> seek the web about it, there might be a way to signal the desired
> language from the frontend to the backend (some set variable thing)
> and if not you could file a feature request for pgsql hackers :)
For the record (after a long silence): I managed to get error messages in
English after doing the following (under Debian Wheezy):
1) edit the postgresql.conf
# nano /etc/postgresql/8.4/main/postgresql.conf
Look at the 'CLIENT CONNECTION DEFAULTS' section, 'Locale and Formatting'
subsection, and change the 'lc_messages' variable:
lc_messages = 'en_US.UTF-8'
2) restart the PostgreSQL server:
service postgresql restart
Now messages are in English. Example:
$ psql -h localhost -d geodb -U caribou -q -c "blabla"
ERROR: syntax error at or near "blabla"
LIGNE 1 : blabla
^
All the best,
Mathieu.
>> ALTER TABLE test
>> ALTER COLUMN date TYPE timestamptz
>> USING date::timestamptz;
>>
>> I have now date as a 'timestamptz'!
>
> Great !
>
> --strk;
>
> () Free GIS & Flash consultant/developer
> /\ http://strk.keybit.net/services.html
> _______________________________________________
> postgis-users mailing list
> postgis-users at postgis.refractions.net
> http://postgis.refractions.net/mailman/listinfo/postgis-users
--
~$ whoami
Mathieu Basille, Post-Doc
~$ locate
Laboratoire d'Écologie Comportementale et de Conservation de la Faune
+ Centre d'Étude de la Forêt
Département de Biologie
Université Laval, Québec
~$ info
http://ase-research.org/basille
~$ fortune
``If you can't win by reason, go for volume.''
Calvin, by Bill Watterson.
More information about the postgis-users
mailing list