Fastest way to import only ONE column into a table? (COPY doesn't work) - Mailing list pgsql-general

From Phoenix Kiula
Subject Fastest way to import only ONE column into a table? (COPY doesn't work)
Date
Msg-id e373d31e0708152146n6da0e4ddwbaad8e0d3c8cd534@mail.gmail.com
Whole thread Raw
Responses Re: Fastest way to import only ONE column into a table? (COPY doesn't work)  (Rodrigo De León <rdeleonp@gmail.com>)
List 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 by date:

Previous
From: Decibel!
Date:
Subject: Re: Interpreting statistics collector output
Next
From: Rodrigo De León
Date:
Subject: Re: Fastest way to import only ONE column into a table? (COPY doesn't work)