Fastest way to import only ONE column into a table? (COPY doesn't work)

Поиск
Список
Период
Сортировка
От Phoenix Kiula
Тема Fastest way to import only ONE column into a table? (COPY doesn't work)
Дата
Msg-id e373d31e0708152146n6da0e4ddwbaad8e0d3c8cd534@mail.gmail.com
обсуждение исходный текст
Ответы Re: Fastest way to import only ONE column into a table? (COPY doesn't work)
Список pgsql-general
What is the fastest way to import the values of *only one* column into
an already existing table? Say the table looks like this:

  id (primary key)
  description
  created_on

I want to import only a new column so the table looks like this:

  id (primary key)
  title
  description
  created_on

So I have a large-ish text file with the following format:

   id1||title1
   id2||title2
   id3||title3
   id4||title4
   id5||title5
   id6||title6

I try to import it in with

   COPY table1 (id, title) from "/usr/tmp/titles.txt"

But this doesn't seem to be working, because COPY doesn't know how to
UPDATE values, it just inserts. Appreciate any tips, because it would
be nasty to have to do this with millions of UPDATE statements!

TIA

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

Предыдущее
От: Decibel!
Дата:
Сообщение: Re: Interpreting statistics collector output
Следующее
От: Rodrigo De León
Дата:
Сообщение: Re: Fastest way to import only ONE column into a table? (COPY doesn't work)