create db with -E

Started by Kathy Zhualmost 23 years ago6 messagesgeneral
Jump to latest
#1Kathy Zhu
Kathy.Zhu@Sun.COM

Hi,

how do dynamically (in script) figure out which encoding to use ("-E xxx")
depending on the OS.

for example:

(on Japanese OS)
create db -E EUC_JP japandb

(on US OS)
create db -E SQL_ASCII usdb

thanks,
kathy

#2Karsten Hilbert
Karsten.Hilbert@gmx.net
In reply to: Kathy Zhu (#1)
Re: create db with -E

Kathy,

how do dynamically (in script) figure out which encoding to use ("-E xxx")
depending on the OS.

(on Japanese OS)
create db -E EUC_JP japandb

(on US OS)
create db -E SQL_ASCII usdb

echo $LANG
echo $LC_*
echo $LOCALE
echo $LANGUAGE

man locale

Karsten
--
GPG key ID E4071346 @ wwwkeys.pgp.net
E167 67FD A291 2BEA 73BD 4537 78B9 A9F9 E407 1346

#3Peter Eisentraut
peter_e@gmx.net
In reply to: Kathy Zhu (#1)
Re: create db with -E

Kathy Zhu writes:

how do dynamically (in script) figure out which encoding to use ("-E xxx")
depending on the OS.

locale -k charmap

--
Peter Eisentraut peter_e@gmx.net

#4Kathy Zhu
Kathy.Zhu@Sun.COM
In reply to: Peter Eisentraut (#3)
Re: create db with -E

When I do, I got a list back. I wonder how to get the property name whose value
is "en_US.UTF-8" ?? That's the value I want to get to pass to -E.
Thanks,
kathy

#lang -a
POSIX
common
en_US.UTF-8
C
iso_8859_1

Show quoted text

X-Unix-From: peter_e@gmx.net Tue May 13 03:25:23 2003
Date: Tue, 13 May 2003 11:27:23 +0200 (CEST)
From: Peter Eisentraut <peter_e@gmx.net>
X-X-Sender: peter@peter.localdomain
To: Kathy Zhu <Kathy.Zhu@sun.com>
cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] create db with -E

Kathy Zhu writes:

how do dynamically (in script) figure out which encoding to use ("-E xxx")
depending on the OS.

locale -k charmap

--
Peter Eisentraut peter_e@gmx.net

#5Csaba Nagy
nagy@ecircle-ag.com
In reply to: Kathy Zhu (#4)
Re: create db with -E

On my system (redhat linux) that's:
echo $LANG
i.e. the LANG environment variable is used by all well behaved programs
to set their character encoding.

HTH,
Csaba.

Show quoted text

On Fri, 2003-05-16 at 16:57, Kathy Zhu wrote:

When I do, I got a list back. I wonder how to get the property name whose value
is "en_US.UTF-8" ?? That's the value I want to get to pass to -E.
Thanks,
kathy

#lang -a
POSIX
common
en_US.UTF-8
C
iso_8859_1

X-Unix-From: peter_e@gmx.net Tue May 13 03:25:23 2003
Date: Tue, 13 May 2003 11:27:23 +0200 (CEST)
From: Peter Eisentraut <peter_e@gmx.net>
X-X-Sender: peter@peter.localdomain
To: Kathy Zhu <Kathy.Zhu@sun.com>
cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] create db with -E

Kathy Zhu writes:

how do dynamically (in script) figure out which encoding to use ("-E xxx")
depending on the OS.

locale -k charmap

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)

#6Kathy Zhu
Kathy.Zhu@Sun.COM
In reply to: Csaba Nagy (#5)
Re: create db with -E

echo $LANG returns "C".
I think postgres needs "EUC_US", "EUC_JP" ...

Subject: Re: [GENERAL] create db with -E
From: Csaba Nagy <nagy@ecircle-ag.com>
To: Kathy Zhu <Kathy.Zhu@sun.com>
Cc: peter_e@gmx.net, Postgres general mailing list

<pgsql-general@postgresql.org>

Content-Transfer-Encoding: 7bit
Date: 16 May 2003 17:33:42 +0200

On my system (redhat linux) that's:
echo $LANG
i.e. the LANG environment variable is used by all well behaved programs
to set their character encoding.

HTH,
Csaba.

On Fri, 2003-05-16 at 16:57, Kathy Zhu wrote:

When I do, I got a list back. I wonder how to get the property name whose

value

is "en_US.UTF-8" ?? That's the value I want to get to pass to -E.
Thanks,
kathy

#lang -a
POSIX
common
en_US.UTF-8
C
iso_8859_1

X-Unix-From: peter_e@gmx.net Tue May 13 03:25:23 2003
Date: Tue, 13 May 2003 11:27:23 +0200 (CEST)
From: Peter Eisentraut <peter_e@gmx.net>
X-X-Sender: peter@peter.localdomain
To: Kathy Zhu <Kathy.Zhu@sun.com>
cc: pgsql-general@postgresql.org
Subject: Re: [GENERAL] create db with -E

Kathy Zhu writes:

how do dynamically (in script) figure out which encoding to use ("-E

xxx")

Show quoted text

depending on the OS.

locale -k charmap

--
Peter Eisentraut peter_e@gmx.net

---------------------------(end of broadcast)---------------------------
TIP 2: you can get off all lists at once with the unregister command
(send "unregister YourEmailAddressHere" to majordomo@postgresql.org)