Re: ignore unique violation OR check row exists

From: Jasen Betts <jasen(at)xnet(dot)co(dot)nz>
To: pgsql-sql(at)postgresql(dot)org
Subject: Re: ignore unique violation OR check row exists
Date: 2012-01-04 08:58:28
Message-ID: je14bk$1jq$1@reversiblemaps.ath.cx
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

On 2012-01-03, Misa Simic <misa(dot)simic(at)gmail(dot)com> wrote:
> If exists is better, though insert line by line and check if exists may
> be very slow...
>
> The best would be if you can use copy command from csv to staging table
> (without constraints) and then
>
> Insert to live from stage where stage constraint column not exist in
> live...
>

Its a good idea to check that the staging table doesn't
conflict with itself, before tryign to insert it.

--
⚂⚃ 100% natural

In response to

Browse pgsql-sql by date

  From Date Subject
Next Message Andreas Kretschmer 2012-01-04 09:08:38 Re: ignore unique violation OR check row exists
Previous Message Misa Simic 2012-01-03 21:53:53 Re: ignore unique violation OR check row exists