Re: [NOVICE] change data type 'money' to '€'

Поиск
Список
Период
Сортировка
От Ognjen Blagojevic
Тема Re: [NOVICE] change data type 'money' to '€'
Дата
Msg-id 4E0CD66B.2020101@gmail.com
обсуждение исходный текст
Ответ на change data type 'money' to '€'  (Mäggi Hieber <mhieber@sunrise.ch>)
Список pgsql-novice
Hi Mäggi,

On 30.6.2011 17:15, Mäggi Hieber wrote:
> In our project table we have a column with costs, using data typ
> "money". By default PostgreSQL always applys '$', but we would like to
> have '€'.
> How can I change the data type "money" (currency) of a column in an
> existing table to '€'?

It is locale specific thing, defined in variable lc_monetary. If your
locale uses $, it will display $. If you want to display EUR instead,
you will need to set lc_monetary to the country using euros (say, Germany).

You may set lc_monetary in postgresql.conf, or within your sql client.
Here is the latter test case:

create table money_test (
   m money not null,
   primary key(m)
);
insert into money_test values ('123');
set lc_monetary="de_DE@euro";
select * from money_test;

-Ognjen

В списке pgsql-novice по дате отправления:

Предыдущее
От: Vincent Michel
Дата:
Сообщение: Fast identifiers table creation
Следующее
От: "Jean-Yves F. Barbier"
Дата:
Сообщение: Re: change data type 'money' to '€'