dbTalk Databases Forums  

SQL deferred constraints (a bit O/T, I know)

comp.databases.theory comp.databases.theory


Discuss SQL deferred constraints (a bit O/T, I know) in the comp.databases.theory forum.



Reply
 
Thread Tools Display Modes
  #11  
Old   
David BL
 
Posts: n/a

Default Re: SQL deferred constraints (a bit O/T, I know) - 04-04-2011 , 12:38 AM






On Apr 2, 11:21 pm, Erwin <e.sm... (AT) myonline (DOT) be> wrote:

Quote:
This has been documented before. MVCC and database constraint
checking do not fit together.
I thought in normal practice only read only transactions access old
versions so MVCC doesn't upset constraint checking at all.

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

Default Re: SQL deferred constraints (a bit O/T, I know) - 04-04-2011 , 04:17 AM






Erwin wrote:

Quote:
On 31 mrt, 21:42, Roy Hann <specia... (AT) processed (DOT) almost.meat> wrote:
This is probably not the proper place to pose a question about how SQL
"should" work, but I don't know of a better one. *Any suggestions? *

I am curious to know the moment to which a deferred constraint should be
understood to be deferred. *I assume it should be after the last
update in a transaction (signalled by a COMMIT) but before the
transaction surrenders read consistency. *But if that's the case,
one can construct a pair of concurrent transactions that
severally satisfy all constraints yet jointly leave the database
inconsistent. * So what's the defined behaviour? *(At this moment I'm
not interested in what we'd like it to be; I want to know what the
standards define it to be.)

--
Roy

Roy, I am curious to know what kind of concurrent transactions you are
thinking of fabricating.

Are you thinking of scenario's in which the concurrency control
mechanism is MVCC, and the constraint checking too happens under
MVCC ?
Yes, but when I posed the question I was unaware that the SQL standard
requires constraint checking to done using serializable isolation
*regardless* of the isolation level of the updating transaction.
Obviously if you insist on serializable isolation a lot of
easy-to-contrive violations are impossible.

--
Roy

Reply With Quote
  #13  
Old   
Erwin
 
Posts: n/a

Default Re: SQL deferred constraints (a bit O/T, I know) - 04-04-2011 , 07:03 AM



On 4 apr, 04:12, David BL <davi... (AT) iinet (DOT) net.au> wrote:
Quote:
On Apr 2, 11:28 pm, Erwin <e.sm... (AT) myonline (DOT) be> wrote:

TWO : the goal is NOT that "at the end of the session, all constraints
must be _TRUE_", the goal is that at the end of the session, all
constraints must be _SATISFIED_.

Are you saying that because you don't regard a constraint as a boolean
valued expression or function, or because you would never use
terminology that ignores the distinction between an expression and
what it evaluates to?
The latter. I was complaining about sloppiness in the language.
Wouldn't you agree that "ignoring the distinction that you mention" is
indeed sloppy language (or sloppy use thereof) ?

Reply With Quote
  #14  
Old   
Erwin
 
Posts: n/a

Default Re: SQL deferred constraints (a bit O/T, I know) - 04-04-2011 , 07:11 AM



On 4 apr, 07:38, David BL <davi... (AT) iinet (DOT) net.au> wrote:
Quote:
On Apr 2, 11:21 pm, Erwin <e.sm... (AT) myonline (DOT) be> wrote:

This has been documented before. *MVCC and database constraint
checking do not fit together.

I thought in normal practice only read only transactions access old
versions so MVCC doesn't upset constraint checking at all.
Yes. That is probably because DBMS builders are quite aware of the
problem.

The OP, however, didn't seem to be (as also evidenced by his own
reply).

Reply With Quote
  #15  
Old   
David BL
 
Posts: n/a

Default Re: SQL deferred constraints (a bit O/T, I know) - 04-04-2011 , 07:50 AM



On Apr 4, 8:03 pm, Erwin <e.sm... (AT) myonline (DOT) be> wrote:
Quote:
On 4 apr, 04:12, David BL <davi... (AT) iinet (DOT) net.au> wrote:

On Apr 2, 11:28 pm, Erwin <e.sm... (AT) myonline (DOT) be> wrote:

TWO : the goal is NOT that "at the end of the session, all constraints
must be _TRUE_", the goal is that at the end of the session, all
constraints must be _SATISFIED_.

Are you saying that because you don't regard a constraint as a boolean
valued expression or function, or because you would never use
terminology that ignores the distinction between an expression and
what it evaluates to?

The latter. I was complaining about sloppiness in the language.
Wouldn't you agree that "ignoring the distinction that you mention" is
indeed sloppy language (or sloppy use thereof) ?
I agree the distinction is important, but I'm not sure about whether
we should expect everyone to clarify that distinction in natural
language because it's not normally a source of confusion. E.g. it is
quite common to make statements like

"x > 10 is true"

rather than

"x > 10 evaluates to true".

or

"the circumference of the circle with radius r is 2*PI*r"

rather than

"2*PI*r evaluates to the circumference of the circle with radius
r"

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.