| From: | Guillaume Lelarge <guillaume(at)lelarge(dot)info> |
|---|---|
| To: | John R Pierce <pierce(at)hogranch(dot)com> |
| Cc: | pgsql-general(at)postgresql(dot)org |
| Subject: | Re: question about \encoding option of psql |
| Date: | 2011-12-15 09:24:50 |
| Message-ID: | 1323941090.2275.3.camel@localhost.localdomain |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
On Wed, 2011-12-14 at 22:26 -0800, John R Pierce wrote:
> On 12/14/11 10:12 PM, Xiaobo Gu wrote:
> > I know \encoding is a meta command to set client encoding on psql
> > prompt, but how can I set it inside the psql command line which will
> > be called inside shell scripts,
> >
> > psql -h 192.168.72.7 -U gpadmin -w -d miner_demo -c"\copy demo.store
> > to 'd:\store.csv' with csv header"
> >
> >
> > How can I set the encoding for the export csv file?
>
> one thing that comes to mind, put the \encoding and \copy commands in a
> .sql file, and invoke it with psql .... -f file.sql
>
Using the PGCLIENTENCODING environment variable might be a better
option.
--
Guillaume
http://blog.guillaume.lelarge.info
http://www.dalibo.com
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Harald Fuchs | 2011-12-15 09:37:01 | Re: Controlling complexity in queries |
| Previous Message | Bèrto ëd Sèra | 2011-12-15 08:58:40 | Re: Philosophical question |