Re: Importing/Appending to Existing Table

From: Greg Williamson <gwilliamson39(at)yahoo(dot)com>
To: Rich Shepard <rshepard(at)appl-ecosys(dot)com>, pgsql-general(at)postgresql(dot)org
Subject: Re: Importing/Appending to Existing Table
Date: 2011-02-02 09:56:45
Message-ID: 212306.72652.qm@web46115.mail.sp1.yahoo.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Rich --
>
>

> I have an existing table with 15,492 rows and want to add additional rows
> from a .csv file. If I use 'COPY <tablename> from <filename> with delimiter
> as ":" csv quote as "'" ' will this overwrite existing rows in the table or
> append rows?

It will not overwrite any existing data; if the table has constraints that will
prevent duplicates then the entire load will fail if any item fails (it is a
single transaction).

If the table doesn't have such constraints then duplicate data in the copy file
will result in duplicate rows.

HTH,

Greg Williamson

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Adarsh Sharma 2011-02-02 09:59:23 Re: Installation Issue of PostgresPlus-9.0
Previous Message Marko Kreen 2011-02-02 09:52:28 Re: Problem with encode () and hmac() in pgcrypto