Обсуждение: suggestion for "psql"

Поиск
Список
Период
Сортировка

suggestion for "psql"

От
Holger Klawitter
Дата:
-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Hi there,

I haven't found a way to set the client encoding of a psql connection other
then "\encoding" which is arkward for batch processing. As .psqlrc is being
ignored during batch processing and the internal encoding is being set
*after* "-v", I have to resort to arkward solutions in order to read data via
scripts. (To whom it may concern: instead of using "-c" you can pipe your
command from stdin).

Shouldn't psql honour the current locale setting (LC_CTYPE) or/and have a
command line option to set the encoding?

Mit freundlichem Gruß / With kind regards
    Holger Klawitter
- --
lists <at> klawitter <dot> de
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.2.2 (GNU/Linux)

iD8DBQFBmGry1Xdt0HKSwgYRAgBYAJ4yxnCSDn3MgTvuLUs8t/bffC7HDwCeMDr2
j8np4ISSUI5AvjQE30AfvCM=
=4f1P
-----END PGP SIGNATURE-----

Re: suggestion for "psql"

От
Peter Eisentraut
Дата:
Holger Klawitter wrote:
> Shouldn't psql honour the current locale setting (LC_CTYPE) or/and
> have a command line option to set the encoding?

The environment variable PGCLIENTENCODING serves this purpose.

--
Peter Eisentraut
http://developer.postgresql.org/~petere/


Re: suggestion for "psql"

От
Richard Huxton
Дата:
Holger Klawitter wrote:
> -----BEGIN PGP SIGNED MESSAGE-----
> Hash: SHA1
>
> Hi there,
>
> I haven't found a way to set the client encoding of a psql connection other
> then "\encoding" which is arkward for batch processing. As .psqlrc is being
> ignored during batch processing and the internal encoding is being set
> *after* "-v", I have to resort to arkward solutions in order to read data via
> scripts. (To whom it may concern: instead of using "-c" you can pipe your
> command from stdin).

set client_encoding=MyEncoding;

--
   Richard Huxton
   Archonet Ltd