Re: insert on duplicate update?

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Richard Huxton <dev(at)archonet(dot)com>
Cc: Peter Filipov <pfilipov(at)netissat(dot)bg>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: insert on duplicate update?
Date: 2005-11-09 15:20:28
Message-ID: 15449.1131549628@sss.pgh.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

Richard Huxton <dev(at)archonet(dot)com> writes:
> Peter Filipov wrote:
>> is there in postgres anything similar to:
>> insert .... on duplicate update?
>> here is the problem i need a solution for:
>> I need to insert in pg_type a row which was previously selected from
>> there and
>> with slight modifications, the problem is that when i try to insert the row
>> there might be a row with the same 'typname' which is sort of primary key.
>> The second problem is that when doing those operations i don't want to
>> depend
>> on the specific structure of the pg_type catalog.

> Are you certain it will always be safe to do this?

What makes you think that modifying pg_type directly is a sane idea in
the first place? When (not if) it breaks, you'll not get a lot of sympathy.

regards, tom lane

In response to

Browse pgsql-general by date

  From Date Subject
Next Message A. Kretschmer 2005-11-09 15:20:51 Re: Question on Insert / Update
Previous Message Csaba Nagy 2005-11-09 15:08:28 Re: Question on Insert / Update