Subject Re: [Firebird-Architect] REPLACE, again
Author Jim Starkey
Adriano dos Santos Fernandes wrote:
> Alex Peshkov wrote:
>
>> This old trick when singleton is checked at runtime is very bad (it
>> often fails in procedures, that seemed to work for a long time, but
>> start to fail after specific data modification). Taking into account,
>> that REPLACE is supposed to be often used in database update/upgrade
>> scripts, I very much dislike run-time checks there, because fixing such
>> bugs in such scripts is specially problematic - REPLACE may pass on test
>> data in test environment, but fail on real user's data, in the worst
>> case leaving production database in unstable state.
>>
I don't understand this at all. REPLACE has been used in many database
systems for years, and, unless I've missed something, now part of the
standard as MERGE. The Oracle semantics are sane and sensible. The
MySQL semantics are not.
>> I suggest to do as much compile-time checks as possible, and not leave
>> them for run-time. Specially in cases, when pass/fail may depend upon
>> data in tables. When we will be ready RETURNING multiple rows - OK, no
>> problems. Now your suggestion adds one more dangerous place to the engine.
>>
>>
> Although not totally agree, I understand your points.
>
> But if it's to have non MATCHING syntax, then let's have only it for now
> and add MATCHING when we can return result set.
>
It's data sensitive, so it can't be done at compile time.