The old PostGIS model before 2.x used constraints like in the question. The newer style uses typmods like geometry(Point, 4326)
.
The old style can set up manually using the appropriate DDL, or with the utility function AddGeometryColumn with use_typmod=false
.
The newer typmod style is typically recommended over the older constraints-based style.