copy from file and overwrite existing entries?

Поиск
Список
Период
Сортировка
От Mattes Sarcander
Тема copy from file and overwrite existing entries?
Дата
Msg-id 20050627163359.5e7b3639@carnivore.local
обсуждение исходный текст
Ответы Re: [despammed] copy from file and overwrite existing entries?  (Andreas Kretschmer <akretschmer@despammed.com>)
Список pgsql-novice
Hi,
I am really new to database administration, so forgive me if I overlook
something obvious ;>

I want to import data from a csv file into an existing, non-empty table.
My problem is the fact that I get an "ERROR:  duplicate key violates
unique constraint", because, as psql correctly grumbles, some entries
are already inside the tables. I would like to overwrite these existing
entries, as the data from the csv files is newer.
I have seen the UPDATE command, but I don't know how to combine that
with import from a file.

How can I accomplish that import? And what is the technically correct
description of my problem, so I can use a search engine next time?

Thanks in advance,
Mattes

Вложения

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

Предыдущее
От: Minal
Дата:
Сообщение: Problem with startup
Следующее
От: Andreas Kretschmer
Дата:
Сообщение: Re: [despammed] copy from file and overwrite existing entries?