0

I'm trying to create a table where in the constraint is that the name to be added needs to be in the form "abc-123". I'm trying to do this by using CONSTRAINT pname CHECK(pname ~ '^[A-Za-z]+(?(?=\.)[a-z]+|)\-[0-9]*$'). However, when I try to insert anything into the table (for eg. (1,'name-123','blue') it gives me the error invalid regular expression: quantifier operand invalid and I'm unsure why or how to fix it.

0 Answers0