Re: Re: REPLACE INTO table a la mySQL - Mailing list pgsql-hackers

From Hannu Krosing
Subject Re: Re: REPLACE INTO table a la mySQL
Date
Msg-id 3B2660B5.1E4FEAF7@tm.ee
Whole thread Raw
In response to Re: Re: REPLACE INTO table a la mySQL  (Alex Pilosov <alex@pilosoft.com>)
Responses Re: Re: REPLACE INTO table a la mySQL  (Jan Wieck <JanWieck@Yahoo.com>)
List pgsql-hackers
Alex Pilosov wrote:
> 
> On Mon, 11 Jun 2001, mlw wrote:
> 
> > >     Adding  another  trigger event type will break every existing
> > >     DB schema that relies on custom triggers  to  ensure  logical
> > >     data  integrity.  Thus  it  is  unacceptable  as  solution to
> > >     support a non-standard feature - period.
> > >
> > >     The question "does this row exist" can only  be  answered  by
> > >     looking  at  the primary key. Now BEFORE triggers are allowed
> > >     to alter the key attributes, so the final primary  key  isn't
> > >     known before they are executed.
> > >
> > >     Thus  the  DELETE then INSERT semantic might be the only way.
> > >     Pretty havy  restriction,  making  the  entire  REPLACE  INTO
> > >     somewhat useless IMHO.
> >
> > The only issue I have with your conclusion about DB schema is that
> > REPLACE is not part of standard SQL, so we do not need be too
> > concerned. Just give them a REPLACE trigger and be done with it. If
> > that isn't good enough, in the FAQ, say that the standard way is
> > insert or update.
> I am not sure I like this: it is possible that someone's security is based
> on triggers, and adding replace as a trigger will let them get around
> it...

BTW, does current LOAD INTO trigger INSERT triggers ?

>Possibly this could be controlled by serverwide option
> 'enable_replace_into' or something like that for people with such setup..?
> 
> -alex
> 
> ---------------------------(end of broadcast)---------------------------
> TIP 1: subscribe and unsubscribe commands go to majordomo@postgresql.org


pgsql-hackers by date:

Previous
From: Hannu Krosing
Date:
Subject: Re: Re: REPLACE INTO table a la mySQL
Next
From: Thomas Swan
Date:
Subject: Re: BLOBs