stahl...@dbs.uni-hannover.de wrote:
> Consider these two tables:
> 
> CREATE TABLE tab1 (x INTEGER PRIMARY KEY);
> CREATE TABLE tab2 (x         PRIMARY KEY REFERENCES tab1);
> 
> Assuming they contain the same rows, I expect any query against 'tab1' to
> return the same rows as against 'tab2'.

Why would you expect that? You keep saying this, but I don't understand the 
basis of your expectations - unless it's just the good old wishful thinking.

> (I don't know what the SQL Standard has to say about this situation

I'm pretty sure the second CREATE TABLE statement is syntactically invalid, per 
the standard. The column type is mandatory, if I recall correctly.

> but I do think that most users would share my expectation.)

I'm not sure what you base this belief on, either. I don't seem to see your 
argument enjoying widespread support on this thread.

> However with SQLite there are queries which yield incoherent results:

Define "incoherent". As far as I can tell, you use this term to mean "results 
you personally dislike". The results SQLite produces are in agreement - in 
other words, in coherence - with the product documentation.

> INSERT INTO tab1 VALUES (42);
> INSERT INTO tab2 VALUES (42);
> 
> SELECT * FROM tab1 WHERE x = '42'; --> one row
> SELECT * FROM tab2 WHERE x = '42'; --> no rows
> 
> I understand that this behavior is documented, but I do think it is simply
> wrong *for this case*.

You seem to hold this truth to be self-evident, but I honestly don't understand 
why. Could you explain your reasoning to me? I assume there's more to it than 
just you finding the outcome aesthetically displeasing.

> Also I don't really care *how* this is fixed

As best I can tell, so far there's no agreement that it's broken, so discussing 
how to fix it seems a bit premature.
-- 
Igor Tandetnik

_______________________________________________
sqlite-users mailing list
sqlite-users@sqlite.org
http://sqlite.org:8080/cgi-bin/mailman/listinfo/sqlite-users

Reply via email to