??? wrote:
> I want detail usage introduction about constraint,such as how
> to constrain a string to be exactly 4 character and start with 'z'.
> Where can I find the reference of CHECK? detail usage.
Documentation:
http://www.postgresql.org/docs/current/static/ddl-constraints.html#AEN2254
The check you want would look similar to this:
CHECK (length(val) = 4 AND substr(val, 1, 1) = 'z')
Yours,
Laurenz Albe