Re: Check whether a NOT NULL check constraint has been validated - Mailing list pgsql-general

From Stuart Campbell
Subject Re: Check whether a NOT NULL check constraint has been validated
Date
Msg-id CAAZ6SnyOHAcMHwAhj4fYUN2jp8FMQzSgTotifRG8Rz4tpGEMWQ@mail.gmail.com
Whole thread Raw
In response to Re: Check whether a NOT NULL check constraint has been validated  (Adrian Klaver <adrian.klaver@aklaver.com>)
List pgsql-general
Hi Adrian,
 
Now I am not sure what you did.

Are you saying you used a CHECK constraint to check for NULL values?

That's right. Something like:

  ALTER TABLE foo ADD CONSTRAINT bar_not_null CHECK (bar IS NOT NULL) NOT VALID 
 
If so then pg_constraint.convalidated would work.

You're right. I didn't immediately find what I was looking for, and when I looked at the docs for pg_constraints, I guess I confused myself with this comment:

> Not-null constraints are represented in the pg_attribute catalog, not here.
 
Thanks for the assistance.

This communication and any attachments may contain confidential information and are intended to be viewed only by the intended recipients. If you have received this message in error, please notify the sender immediately by replying to the original message and then delete all copies of the email from your systems.


pgsql-general by date:

Previous
From: hubert depesz lubaczewski
Date:
Subject: Re: How to use index in simple select
Next
From: Aleš Zelený
Date:
Subject: After upgrade from Pg11.2 to 17.7 logical replication prevents database instance shutdown