agora inbox for pgsql-hackers@postgresql.org  
help / color / mirror / Atom feed
From: Vik Fearing <vik@postgresfriends.org>
To: Thom Brown <thom@linux.com>
Cc: PostgreSQL Hackers <pgsql-hackers@lists.postgresql.org>
Subject: Re: Logical Implication
Date: Fri, 11 Sep 2026 18:06:50 +0200
Message-ID: <43d5a3f4-30b9-4fa5-9f8f-97aa2dd7cf7c@postgresfriends.org> (raw)
In-Reply-To: <CAA-aLv5r-3s4DWgSxfqmhmQsVASkj6VX2iJDDV3zNsnUCfrPgA@mail.gmail.com>
References: <37c76707-e6fa-4ee3-b57f-aa0bf1b0bba8@postgresfriends.org>
	<CAA-aLv5r-3s4DWgSxfqmhmQsVASkj6VX2iJDDV3zNsnUCfrPgA@mail.gmail.com>

Hi Thom,

Thanks for taking a look at it.


On 11/09/2026 16:41, Thom Brown wrote:
> What behaviour should be expected for the following cases:
>
> a IMPLIES b IMPLIES c


a IMPLIES (b IMPLIES c), it is right associative. I put this exact case 
in the documentation.

It deparses to  (NOT a) OR (NOT b) OR c.


> CHECK (a IMPLIES b) -- where b is NULL
> -- And what does that deparse to?


This is in the documentation as well, it deparses to  NOT a OR NULL  
which is either TRUE or UNKNOWN depending on what a is.  In both cases 
the CHECK passes.


> a IMPLIES (100 / b > 10)


This is an error because the operator only applies to booleans.

-- 

Vik Fearing






view thread (18+ messages)  latest in thread

Message-ID: <43d5a3f4-30b9-4fa5-9f8f-97aa2dd7cf7c@postgresfriends.org>
Permalink:  ../43d5a3f4-30b9-4fa5-9f8f-97aa2dd7cf7c@postgresfriends.org/
Also on:    postgresql.org/message-id/43d5a3f4-30b9-4fa5-9f8f-97aa2dd7cf7c@postgresfriends.org

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: vik@postgresfriends.org, thom@linux.com, pgsql-hackers@lists.postgresql.org
  Subject: Re: Logical Implication
  In-Reply-To: <43d5a3f4-30b9-4fa5-9f8f-97aa2dd7cf7c@postgresfriends.org>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by agora; see mirroring instructions
for how to clone and mirror all data and code used for this inbox