copy from questions

Поиск
Список
Период
Сортировка
От Kirk Wythers
Тема copy from questions
Дата
Msg-id 0F38C38C-D266-4B5E-9F73-ED94148429D2@gmail.com
обсуждение исходный текст
Ответы Re: copy from questions
Список pgsql-general
I am using version 9.1 and have a large number of files to insert. I am trying to use a simple COPY FROM command but
havea couple questions. 

1. There are a small number of instances where there are duplicate records that are being caught by the primary key (as
itis supposed to do). However, the duplicate records are artifacts of a recording system and can be ignored. I would
liketo be able to simply skip the duplicate or UPDATE the table with the duplicate… Anything that allows the COPY FROM
toproceed while adding only one of the duplicate records to the table.  

2. SInce I have several hundred files to perform a COPY FROM on, I'd like to automate the import in some way… sort of
a,grab all files in the directory approach: 

COPY newtable FROM '/directory_of_files/*' WITH CSV HEADER DELIMITER AS ',' NULL AS 'NA';

Is this possible?

Thanks in advance

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

Предыдущее
От: Jason Ma
Дата:
Сообщение: Re: How to startup the database server?
Следующее
От: Steve Crawford
Дата:
Сообщение: Re: copy from questions