-
Notifications
You must be signed in to change notification settings - Fork 111
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
NULL=NULL is NULL in Postgres #199
Comments
Maybe this should be reworded to specifically talk about uniqueness constraints? Postgres, MySQL, and SQLite will all allow duplicate NULL values in a column with a unique index, whereas in Haskell, |
I think it might just be that it's misleading (at least from the SQL perspective) to suggest that nullable columns in SQL are just like |
Can you elaborate? |
Apologies for the long delay getting back to this: I was not trying to address the relationship of
To the best of my knowledge (I don't have the standard open at the moment) the answer to that question should not contribute to the putative ambiguity of uniqueness constraints: I think it's misleading to suggest nullable columns are just like A Haskell programmer expects the equality function to be boolean valued (i.e., -- I'm using the same postgres 9.6.5 from above
create table foo (bar int unique);
insert into foo values (1);
insert into foo values (2);
insert into foo values (3);
insert into foo values (null);
insert into foo values (null);
insert into foo values (4);
insert into foo values (null); In Haskell (under the foo :: [Maybe Int]
foo = [Just 1, Just 2, Just 3, Nothing, Nothing, Just 4, Nothing] So we try Let's try So now we try Then there's outer joins, |
Are you asking for a change in Persistent behavior, or just a change to the docs? If just a change to the docs, can you suggest a revision of how you think they could be made more accurate? |
I am not addressing the behavior
I think it would be nice to add some verbiage addressing the fidelity-or-lack-thereof of |
The section on persistent says:
My understanding had alway been that
NULL=NULL
gaveNULL
, and indeed in the Postgres on my machine at the moment (9.6.5) as well as the sqlite,select (null = null) is null
evaluates totrue
. The article on SQL Nulls believes the distinction is worth calling out in its own section.The text was updated successfully, but these errors were encountered: