Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x51y4-007ZeF-1C for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 14:11:04 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.96) (envelope-from ) id 1x51y2-00FEFz-2O for pgsql-hackers@arkaria.postgresql.org; Fri, 11 Sep 2026 14:11:02 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.96) (envelope-from ) id 1x51y2-00FEFq-1N for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 14:11:02 +0000 Received: from mail-qk2-x10.google.com ([2607:f8b0:4864:34::10]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256 (Exim 4.98.2) (envelope-from ) id 1x51y0-00000004A4E-0lZf for pgsql-hackers@lists.postgresql.org; Fri, 11 Sep 2026 14:11:02 +0000 Received: by mail-qk2-x10.google.com with SMTP id af79cd13be357-939695b5741so98176585a.1 for ; Fri, 11 Sep 2026 07:11:00 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20251104; t=1789135858; x=1789740658; darn=lists.postgresql.org; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:from:to:cc:subject:date:message-id:reply-to:content-type; bh=AnQ8VH3lu6HdMxLicv9+OKT36ZckURliS+QB8IdZFY0=; b=qxOlXS02AzrmKjjKZdtPBt92BcvhBcxZTbqO/jRWZRwoCcOUntQtwpDG3xU1+hHyKc tGnEQs3a+UzaT56vXrpySl8JJTOpE/u89UR39JrrB1ZZa6XTxLgEhH13F1vllyF3fK5l FOX6fcLLhLk+g60Rxc4aTMd2RqIOyzRcnYCYqqwLdo98RrjjURvuZX755HPyKwcjroUd 4hmeDi80QLwED+sYNdCelKXlJz15NyFtUun+zKJts4M7iX2Pt0DBhgMRTSaj9AjIvfFj FXl4SjNpboNFUEyanDYi9Vj3e/9dpGlWUuEbcyVwUjzUnqtE2GsX3uWK3CAc78fVTmmR zLgA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20251104; t=1789135858; x=1789740658; h=in-reply-to:content-transfer-encoding:content-disposition :content-type:mime-version:references:message-id:subject:cc:to:from :date:x-gm-gg:x-gm-message-state:from:to:cc:subject:date:message-id :reply-to:content-type; bh=AnQ8VH3lu6HdMxLicv9+OKT36ZckURliS+QB8IdZFY0=; b=R5W7JpOAWwzOuvukbhN2q5Uz/yskKHk+92aFTYDjQVbZ9+MJ/vdAxoxGl3x4r3dbbe llIDChbijGJEPag7LYa/O62Ts8mHYic8uAxqVW9xHGQHRpaGsT5cliU2JthEoRLi60q9 V/k0A3M4GCOMuJ3dnOF98XDO8A+AmCffKPuWopBeayEagYu3IF0o4f+YVQ0aLLWrv3OB YOWqH7MRb7t10YXIHmhACD0QAi79I8kNmAlEk96Mh/4t+p+wbSiZ5P+oOT5a295QZPRO f5ZSPn1S3QdMdqEKOnckKsY4zcIzQ7FcnuKj6tBqJZVPnzIY9D+aSTRRyNkycs3BdTzP 77Ug== X-Gm-Message-State: AFuF++m2t11JCDD6eOvvTOcmIVAwdL68sM/Sz6bNNwDK9UCMLp43mRUl XmFCX6sGpc6UafaeeijRAc9ee1lwL4+MnW7xRXhggD1Us0sZaQ2OQmef X-Gm-Gg: AYBFou3bxa0NnanLmCvNpnjCFBmwwEgh3BsgSZOqLFP2jdXTB4LauLaeXkul382hLzI WUsl2Tv7tLmPJnmD9odI2w09C+PN95AC9omcpSG9LwEupQ0EaeWkAbH2pigQqR8h4LxDw2XtHDs vWdQyYKZS04KrVhkQu7NgkTOL1xDbFjLSXRMY+j3cKvyOTFZzV4EVu6sm1XjYJ63OMWqsodghqr R4BQvK/RUJu7ycPrSn/XHFTh/vkzd2lAeTTKXHFE33lYja4BPUlf2EoNAyR+PjFIWZ/g4SCdFgF J+qSQpAE7qhwdOrO4+2yslZQFqb6Cx5kazSkxvyefzt5clAkBme2YxdK/9ap+d4eA/nk+SIpgqh 2FNsm/FruhsXlQl5z4IsSOT/9y6cHYzynpIpstgcTimikboSY7lvEnb48ndLMaOfF2pa3kv0qpv 9eqSt7Nf0dBK3sW6W90XQwsrE8kVJhTlHZf80TJgqSFAyZ15043PiS79pulJAueqPCOeotNhb6V adVk1fBEo/PyyGCcQFqMqpTcE+yYhfH/PJOgFiku3vCQ4PQ8M6+3qViSVnWA2+S0qgcp2KUVCpC xGxeebvnjio1XE1QbdCYREOLIA== X-Received: by 2002:a05:620a:2592:b0:939:91ab:8f0a with SMTP id af79cd13be357-939ea0a9dadmr589523185a.19.1789135857929; Fri, 11 Sep 2026 07:10:57 -0700 (PDT) Received: from nathan (162-195-168-172.lightspeed.stlsmo.sbcglobal.net. [162.195.168.172]) by smtp.gmail.com with ESMTPSA id af79cd13be357-939e80462ccsm251610785a.21.2026.09.11.07.10.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 11 Sep 2026 07:10:57 -0700 (PDT) Date: Fri, 11 Sep 2026 09:10:55 -0500 From: Nathan Bossart To: Vik Fearing Cc: PostgreSQL Hackers Subject: Re: Logical Implication Message-ID: References: <37c76707-e6fa-4ee3-b57f-aa0bf1b0bba8@postgresfriends.org> MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <37c76707-e6fa-4ee3-b57f-aa0bf1b0bba8@postgresfriends.org> List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk On Fri, Sep 11, 2026 at 03:35:57PM +0200, Vik Fearing wrote: > 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 am probably not the target audience for a feature like this, but I'm not sure I find the proposed new syntax to be substantially more readable. For example, something like NOT shipped OR shipped_date IS NOT NULL would translate to shipped IMPLIES shipped_date IS NOT NULL In my head, I read the first as something like "either the package is not shipped or the shipping date is set," and the latter as "if the package is shipped then the shipping date is set." So I guess that does save me one round of negation; ISTM that's the main benefit. > 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. Even though there may be precedence, I think the proposal would be strengthened by teaching it to survive the round trip. Since the benefit is readability, presumably it would be useful in situations where you're reading a CHECK constraint that someone else wrote. -- nathan