dbTalk Databases Forums  

[Info-Ingres] Rules vs. table structure..who wins?

comp.databases.ingres comp.databases.ingres


Discuss [Info-Ingres] Rules vs. table structure..who wins? in the comp.databases.ingres forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
Roy Hann
 
Posts: n/a

Default Re: [Info-Ingres] Rules vs. table structure..who wins? - 04-29-2010 , 09:56 AM






James K. Lowden wrote:

Quote:
Ingres Forums wrote:

How do other databases handle errors in rule(trigger) fired db
procedures?

The ones I know roll back the transaction and cancel the command batch.

It must be so, else user code could subvert the atomic guarantees made by
the RDBMS. If the procedure code could catch and "deal with" RI errors,
how could the server continue to ensure said RI? At some point, it's not
up to the code.

The only right way to prevent RI errors in procedural code is to verify
preconditions *before* affecting the data.
Any way that is indistinguishable from what would happen if everything
were done simultaneously/atomically is right. I am wary of references
to "before" and "after" *within* a transaction. In principle the order
shouldn't matter as long as all the constraints are satisfied when you
commit. (Obviously SQL doesn't do a great job of sustaining the
illusion of atomic operations, but it's best not to exploit that
weakness.)

--
Roy

UK Ingres User Association Conference 2010 will be on Tuesday June 8 2010
Go to http://www.iua.org.uk/join to get on the mailing list.

Reply With Quote
  #12  
Old   
Roy Hann
 
Posts: n/a

Default Re: [Info-Ingres] Rules vs. table structure..who wins? - 04-29-2010 , 11:38 AM






Roy Hann wrote:

Quote:
In principle the order
shouldn't matter as long as all the constraints are satisfied when you
commit.
Just to clarify what I meant by this: I don't mean just the constraints
actually defined on the database. I mean all the constraints that
should be defined *in principle*. i.e. even the ones that are
theoretically desirable but are impractical for reasons of speed or
other product limitations. Just because we haven't told the DBMS what
the rules are doesn't mean we're free to break them.

--
Roy

UK Ingres User Association Conference 2010 will be on Tuesday June 8 2010
Go to http://www.iua.org.uk/join to get on the mailing list.

Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.