Thread: BUG #13203: XOR Check looks missing parens in \d

BUG #13203: XOR Check looks missing parens in \d

From
robertmassaioli@gmail.com
Date:
The following bug has been logged on the website:

Bug reference:      13203
Logged by:          Robert Massaioli
Email address:      robertmassaioli@gmail.com
PostgreSQL version: 9.4.1
Operating system:   OSX
Description:

This is simple to reproduce. First create the following database table and
then run the psql session as documented here:
https://bitbucket.org/snippets/robertmassaioli/rqpz

Now, the issue is that when you do \d and view the table that has been
created the CHECK block is missing parens that show that it really will
behave as an XOR. I think this is a bug that ould be great to fix. Please
let me know if you need more information. Cheers!

Re: BUG #13203: XOR Check looks missing parens in \d

From
Tom Lane
Date:
robertmassaioli@gmail.com writes:
> Now, the issue is that when you do \d and view the table that has been
> created the CHECK block is missing parens that show that it really will
> behave as an XOR. I think this is a bug that ould be great to fix. Please
> let me know if you need more information. Cheers!

It's not a bug that we print check constraints without unnecessary parens,
any more than it is that we don't reproduce whitespace exactly.

Those parens are unnecessary, because per the SQL standard AND binds more
tightly than OR.

            regards, tom lane