Categories
Database Development

practical effect of not validating FKs in Postgres?

I need to add a foreign key definition to a very large table in Postgres. (Let’s assume for the moment that I’m positive that every FK value is actually valid.) I know that I can specify NOT VALID in order to prevent Postgres from taking aggressive locks on the table while validating the foreign key. […]

Categories
Database Development

practical effect of not validating FKs in Postgres?

I need to add a foreign key definition to a very large table in Postgres. (Let’s assume for the moment that I’m positive that every FK value is actually valid.) I know that I can specify NOT VALID in order to prevent Postgres from taking aggressive locks on the table while validating the foreign key. […]