How to use Italian locale for Postgres messages On Oracle I have set:

export NLS_LANG=Italian_ITALY.UTF8


.. on Unix shell and now I get status and error message in Italian.

How to set in Postgres shell (psql)?
I have set:

SET lc_messages TO 'it_IT.UTF-8';


But it is all in English:

prova
video-# ;
ERROR:  syntax error at or near "prova"
LINE 1: prova
        ^
video=# select count(*) from generale ;
 count 
-------
  2170
(1 row)
First of all, this is an error message from PostgreSQL, which is not the same as psql (the command-line client). The SET command sets run-time parameters of the Postgres server, which is completely independent from the client (psql in this case).

Either way, it works for me. Testing the standard distribution of Postgres 9.4.1 on a Windows client set to a German locale (German_Germany.1252):

test=# SET LC_MESSAGES TO 'it_IT.UTF-8';
SET
test=# SELECT 1/0;
ERRORE:  divisione per zero

test=# SET lc_messages  = 'C';
SET
test=# SELECT 1/0;
ERROR:  division by zero

test=# RESET lc_messages;
RESET
test=# SELECT 1/0;
FEHLER:  Division durch Null


The same works on a Debian machine (where the respective locales are available!). And I can reproduce the same from any other client (like pgAdmin).

Maybe you are not running both commands in the same session?
Either way, Postgres uses locale support from the underlying OS. Per documentation:


  What locales are available on your system under what names depends on
  what was provided by the operating system vendor and what was
  installed. On most Unix systems, the command locale -a will provide a
  list of available locales. Windows uses more verbose locale names,
  such as German_Germany or Swedish_Sweden.1252, but the principles are
  the same.


And natural language support (--enable-nls) must be enabled at compile time which is the default and is the case for standard distributions. Details in the manual here.
Are you running a non-standard version? Compiled it yourself maybe?