Constraint allowing value up to 2 times but no more than 2 times - Mailing list pgsql-general

From Dara Unglaube
Subject Constraint allowing value up to 2 times but no more than 2 times
Date
Msg-id CA+ca-rquDV-=ytRoBi6KM-v=w-78YS7piT+jOeCkyZRiHa-R6g@mail.gmail.com
Whole thread Raw
Responses Re: Constraint allowing value up to 2 times but no more than 2 times
List pgsql-general
Greeetings.
I'm trying to come up with a way to allow one column to have the same value up to two times, but no more than two times. I attempted adding a constraint to check the count of the value in the field  - count (trsqqq) <=2 but aggregate functions are not allowed in constraints. Is there another way to do this? Any help would be greatly appreciated.
Thanks in advance.
Dara

--
Dara J. Olson Unglaube
Aquatic Invasive Species Coordinator, Spatial Database Manager
Great Lakes Indian Fish & Wildlife Commission
P.O. Box 9, 72682 Maple Street
Odanah, WI 54861
(715) 682-6619 ext.2129

pgsql-general by date:

Previous
From: Steve Pribyl
Date:
Subject: Re: BDR workers exiting?
Next
From: Jim Nasby
Date:
Subject: Re: Constraint allowing value up to 2 times but no more than 2 times