NEWBIE: How do I use \copy to populate from a flat file

Поиск
Список
Период
Сортировка
От Brian Burton-Cundall
Тема NEWBIE: How do I use \copy to populate from a flat file
Дата
Msg-id 36DBC846.83453B7C@graith.co.uk
обсуждение исходный текст
Ответы Re: [GENERAL] NEWBIE: How do I use \copy to populate from a flat file
Список pgsql-general
I've used mSQL before and managed to import flat files exported from MS Access
(needs must) into that. I need to import flat files into PostGreSQL. I've
created the table using psql - POSTGRESQL interactive sql monitor:

I can see the command from the help
 \copy table {from | to} <fname>

I've got a flat file with TAB separated values that match the table but when I
use
\copy ENTRY from /u1/www/intranet/brian/ENTRY.txt

I get
Broken Pipe

and it returns to the shell prompt. Any ideas?

(I don't want to have to create 20,000+ INSERT  SQL commands or even automate
it)

Thanks
Brian
Graith Internet - http://www.graith.co.uk


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

Предыдущее
От: Nick Urbanik
Дата:
Сообщение: Indexes created when insert blobs--problems!
Следующее
От: Bas Peters
Дата:
Сообщение: FW: indexing functions