german decimal / locale

From: VRoehl(at)t-online(dot)de (Volker Roehl)
To: pgsql-novice(at)postgresql(dot)org
Subject: german decimal / locale
Date: 2002-05-26 08:45:46
Message-ID: 200205261044.52165.Volker.Roehl@opendraft.de
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-novice

How to perform an german-style numeric output like: '1.234,56' with psql?

I use the SuSE 8.0 standard RPM for postgresql:

postgresql-libs-7.2-70
postgresql-7.2-70
postgresql-docs-7.2-70
postgresql-odbc-7.2-70
postgresql-server-7.2-70
postgresql-tcl-7.2-70
postgresql-tk-7.2-70

This is my enviroment:

version:
========
psql (PostgreSQL) 7.2
contains support for: readline, history, multibyte
Portions Copyright (c) 1996-2001, PostgreSQL Global Development Group
Portions Copyright (c) 1996, Regents of the University of California
Read the file COPYRIGHT or use the command \copyright to see the
usage and distribution terms.

locale (for user and postgres):
===============================

user(at)laptop:~> locale

LANG=de_DE(at)euro
LC_CTYPE="de_DE(at)euro"
LC_NUMERIC="de_DE(at)euro"
LC_TIME="de_DE(at)euro"
LC_COLLATE=POSIX
LC_MONETARY="de_DE(at)euro"
LC_MESSAGES="de_DE(at)euro"
LC_PAPER="de_DE(at)euro"
LC_NAME="de_DE(at)euro"
LC_ADDRESS="de_DE(at)euro"
LC_TELEPHONE="de_DE(at)euro"
LC_MEASUREMENT="de_DE(at)euro"
LC_IDENTIFICATION="de_DE(at)euro"
LC_ALL=

postgres(at)laptop:~> locale

LANG=de_DE(at)euro
LC_CTYPE="de_DE(at)euro"
LC_NUMERIC="de_DE(at)euro"
LC_TIME="de_DE(at)euro"
LC_COLLATE=POSIX
LC_MONETARY="de_DE(at)euro"
LC_MESSAGES="de_DE(at)euro"
LC_PAPER="de_DE(at)euro"
LC_NAME="de_DE(at)euro"
LC_ADDRESS="de_DE(at)euro"
LC_TELEPHONE="de_DE(at)euro"
LC_MEASUREMENT="de_DE(at)euro"
LC_IDENTIFICATION="de_DE(at)euro"
LC_ALL=

encoding:
=========

List of databases
Name | Owner | Encoding
-----------+----------+----------
db1 | vroehl | LATIN1
db2 | vroehl | LATIN1
template0 | postgres | LATIN1
template1 | postgres | LATIN1
(4 rows)

SHOW DateStyle:
===============

NOTICE: DateStyle is German with European conventions
SHOW VARIABLE

Table with Numeric-Typ (price):
===============================

Table "kh"
Column | Type | Modifiers
--------+-----------------------+-----------
artbez | character varying(80) |
artnum | character(8) |
laenge | integer |
br500 | numeric(6,2) |

Select-Statement:
=================

select artbez,artnum,laenge,br500 from kh;

-[ RECORD 1 ]--------------------
artbez | Kaminhaube (Abdeckwelle)
artnum | 461.000
laenge | 500
br500 | 108.60

Problem:
========

The german correct output need a decimal comma, like "108,60".
The function to_char(br500, '9G990D00') return the same result: "108.60".

Browse pgsql-novice by date

  From Date Subject
Next Message Ron Johnson 2002-05-27 00:35:40 Re: Altering a table in Postgres to add a NOT NULL constraint
Previous Message Ron Johnson 2002-05-26 03:22:05 Re: Copy Comand question