menu
techminis

A naukri.com initiative

google-web-stories
Home

>

Databases

>

PostgreSQL...
source image

Dbi-Services

1M

read

330

img
dot

PostgreSQL 18: Allow NOT NULL constraints to be added as NOT VALID

  • In PostgreSQL 17 and earlier versions, NOT NULL constraints are enforced immediately upon creation.
  • To bypass the constraint, users had to drop it and then re-add it after loading data.
  • PostgreSQL 18 introduces the ability to add NOT NULL constraints as NOT VALID.
  • This allows data loading even if constraints would initially be violated.
  • Constraints added as NOT VALID will not be enforced until validation occurs.
  • The new feature provides flexibility for data loading and constraint management.
  • Users can manually fix data inconsistencies before validating constraints.
  • PostgreSQL 18 now supports adding constraints as NOT VALID for better control.
  • This enhancement streamlines the process of loading data with constraints.
  • Users can now add NOT NULL constraints that are deferred until validation.

Read Full Article

like

19 Likes

For uninterrupted reading, download the app