Logical Implication - Mailing list pgsql-hackers

From Vik Fearing
Subject Logical Implication
Date
Msg-id 37c76707-e6fa-4ee3-b57f-aa0bf1b0bba8@postgresfriends.org
Whole thread
List pgsql-hackers
Hi.


I would like to intruduce an IMPLIES operator for booleans that reads 
better than its developed formula.  That is, I think

     a IMPLIES b

is better in CHECK constraints and elsewhere than

     NOT a OR b

.


I plan on submitting this to the SQL committee as well, but I've learned 
that they like an implementation to have it first, and I cannot imagine 
that they would quibble over the keyword used.


The first patch is a restructure of the documentation for NOT/AND/OR 
because IMPLIES is not symmetric about the diagonal and I didn't want it 
to stand out like a sore thumb. The second patch is the actual 
implementation.


It does not survive a round trip which has precedence with IN being 
changed to =ANY, BETWEEN changing to <= and >= (BETWEEN SYMMETRIC is 
even worse), etc; so I don't think that is a problem.


Thanks,

-- 

Vik Fearing


PS: based off of c1c5d28f4a2

Attachment

pgsql-hackers by date:

Previous
From: Noah Misch
Date:
Subject: Re: pg_get_*_ddl() needs a redesign
Next
From: Robert Haas
Date:
Subject: Re: PGQ catalog representation and pg_dump support