pg.ddx.io pgsql-hackers@postgresql.org mailing list archive
help / color / mirror / Atom feed From: Jeff Davis <pgsql@j-davis.com>
To: David G. Johnston <david.g.johnston@gmail.com>
Cc: Yugo NAGATA <nagata@sraoss.co.jp>
Cc: Tom Lane <tgl@sss.pgh.pa.us>
Cc: Peter Eisentraut <peter@eisentraut.org>
Cc: David Rowley <dgrowleyml@gmail.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Document NULL
Date: Tue, 10 Dec 2024 10:52:53 -0800
Message-ID: <5fbbebb78a9e5ecea8adbbc1ba720dd0ca6d5205.camel@j-davis.com> (raw )
In-Reply-To: <CAKFQuwZoeWrM0WuH2io+MoiFKtQjp+Y+8gO1PUDRs8iEzwj16w@mail.gmail.com >
References: <CAKFQuwbwNue2bDA4_SW2UZ-Yrj91FVre76SJXVsvBrJf2cteUQ@mail.gmail.com >
<CAApHDvpPjq461bFPznAP6WEybmV4yaQ8ngY5K59VOwEg31a4og@mail.gmail.com >
<2074118.1714625223@sss.pgh.pa.us >
<CAKFQuwZ5=WYz0bLXj3ryqqecFvZRbxP20fo1GiDMFiqh-qODeg@mail.gmail.com >
<6c11f5a2-478c-42af-9208-e82bb710e78a@eisentraut.org >
<CAKFQuwZgmwUDegus9WFK5WgKRp9i89b7g0ea4dXzBJNysuHHuw@mail.gmail.com >
<2674591.1714751043@sss.pgh.pa.us >
<CAKFQuwbsd-ktyf--vL1+uLFzGzzkt9RtM8ULUHif666TNnz6vQ@mail.gmail.com >
<CAKFQuwZVC49Cf6953J3CYSo=_Ra9JGf4ntNj6YJ7cDtqwhX=og@mail.gmail.com >
<20240619123412.7bd1f5fd827120192a24674a@sraoss.co.jp >
<CAKFQuwb5cDjoBLmoRWojBrR1MP4Z6+WYmPEmqpT2qkVNVA0fLA@mail.gmail.com >
<20240619141520.9fefb69d051fb112f41bf1d1@sraoss.co.jp >
<54757.1718775943@sss.pgh.pa.us >
<CAKFQuwbwXMUrPiGhqgZecgicsHyD+e0KgeUsf8OxaOaJbNoCOQ@mail.gmail.com >
<20240627121425.e0b6fa51b8f3682da11b3a6c@sranhm.sraoss.co.jp >
<CAKFQuwbHuT82b3jYwH+yhuKrpLoa0Ebr+sT6mTFS+nfjAAGUFQ@mail.gmail.com >
<505f9dfcc6e84a442c6fbdf600ab1df1e5030603.camel@j-davis.com >
<CAKFQuwZoeWrM0WuH2io+MoiFKtQjp+Y+8gO1PUDRs8iEzwj16w@mail.gmail.com >
On Mon, 2024-12-09 at 15:27 -0700, David G. Johnston wrote:
> I have not done this. This is already a large patch and this kind of
> example doesn't seem like our norm. I'm not opposed to more content
> like this but for now would leave considering it as something an
> interested party can propose once this goes in.
Fair enough
Though I think it's a great example and I'd like to find some place to
put it.
>
> <para>
> The presence of null values in the system results in three-valued
> logic.
> In conventional two-valued (binary) logic every outcome is either
> true or false.
> In three-valued logic the concept of unknown, represented using
> the null value, is
> also an outcome. This results in falsifying the common-sense
> notion
> that "p OR NOT p" is always true.
> </para>
Thank you.
I might reword the final sentence as more of an example, like: "Unknown
values can lead to surprising behavior, for instance "NULL OR NOT NULL"
evaluates to the null value."
>
> When executing an aggregate or window function the state tracking
> component
> (which may be initialized to a non-null value, e.g., 0 for the
> count function)
> will remain unchanged even if the underlying processing
> function returns a null value, whether from being defined strict
> or it simply returns a null value upon execution.
Thank you.
> Since count doesn't have an input function to check the only way to
> see zero such rows is if the underlying thing being counted is empty.
While true for COUNT(*), technically that's incorrect for COUNT(x),
which counts the rows for which x is non-null. That doesn't invalidate
your point, though: the initial state is unchanged either way.
Regards,
Jeff Davis
view thread (93+ messages) latest in thread
Message-ID: <5fbbebb78a9e5ecea8adbbc1ba720dd0ca6d5205.camel@j-davis.com>
Permalink: ../5fbbebb78a9e5ecea8adbbc1ba720dd0ca6d5205.camel@j-davis.com/
Also on: postgresql.org/message-id/5fbbebb78a9e5ecea8adbbc1ba720dd0ca6d5205.camel@j-davis.com
copy link · copy postgr.es
reply Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-hackers@postgresql.org
Cc: pgsql@j-davis.com, david.g.johnston@gmail.com, nagata@sraoss.co.jp, tgl@sss.pgh.pa.us, peter@eisentraut.org, dgrowleyml@gmail.com, pgsql-hackers@lists.postgresql.org
Subject: Re: Document NULL
In-Reply-To: <5fbbebb78a9e5ecea8adbbc1ba720dd0ca6d5205.camel@j-davis.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox