Re: selective export for subsequent import (COPY)

Поиск
Список
Период
Сортировка
От chrisj
Тема Re: selective export for subsequent import (COPY)
Дата
Msg-id 10090719.post@talk.nabble.com
обсуждение исходный текст
Ответ на Re: selective export for subsequent import (COPY)  ("Harvey, Allan AC" <HarveyA@OneSteel.com>)
Ответы Re: selective export for subsequent import (COPY)
Re: selective export for subsequent import (COPY)
Список pgsql-general
Thanks Alan,
This helped a lot, but ideally I want a tab field delimiter and -F '\t' does
not seem to work, any ideas??

I noticed one other post on this same problem of the fieldsep '\t' not
working but the only advise offered was to use \pset.  Can \pset be used on
the command line, I can only get it to work within the psql command
processor.


Harvey, Allan AC wrote:
>
> Chris,
>
>> I know about: psql dbname -tc "select * from tableX where whatever" >
>> tableX.dat
>
> What about
> psql $DATABASEHOST -U $DATABASEUSER -d $DATABASE -q -P footer -A -F , -c
> "$DETAIL_SQL" >table.csv
>
> To produce a comma separated file of tuples only.
> If I'm not mistaken, as happens quite a bit, you can then use COPY to
> import the csv file.
>
> Allan
>
>
> The material contained in this email may be confidential, privileged or
> copyrighted. If you are not the intended recipient, use, disclosure or
> copying of this information is prohibited. If you have received this
> document in error, please advise the sender and delete the document.
> Neither OneSteel nor the sender accept responsibility for any viruses
> contained in this email or any attachments.
>
> ---------------------------(end of broadcast)---------------------------
> TIP 6: explain analyze is your friend
>
>

--
View this message in context:
http://www.nabble.com/selective-export-for-subsequent-import-%28COPY%29-tf3604927.html#a10090719
Sent from the PostgreSQL - general mailing list archive at Nabble.com.


В списке pgsql-general по дате отправления:

Предыдущее
От: Tom Lane
Дата:
Сообщение: Re: Building PG 8.2.3 for x86_64 on Mac OS X 10.4.9
Следующее
От: Tom Lane
Дата:
Сообщение: Re: selective export for subsequent import (COPY)