Re: question about \encoding option of psql

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: question about \encoding option of psql
Date: 2011-12-15 06:26:12
Message-ID: 4EE99304.7080708@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

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

--
john r pierce N 37, W 122
santa cruz ca mid-left coast

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Mike Christensen 2011-12-15 06:57:35 Re: Correct syntax to create partial index on a boolean column
Previous Message Xiaobo Gu 2011-12-15 06:12:40 question about \encoding option of psql