X-Original-To: pgsql-sql-postgresql.org@postgresql.org Received: from localhost (mx1.hub.org [200.46.208.251]) by postgresql.org (Postfix) with ESMTP id C282F9FA395 for ; Sat, 1 Jul 2006 09:54:09 -0300 (ADT) Received: from postgresql.org ([200.46.204.71]) by localhost (mx1.hub.org [200.46.208.251]) (amavisd-new, port 10024) with ESMTP id 16726-06 for ; Sat, 1 Jul 2006 09:54:05 -0300 (ADT) X-Greylist: from auto-whitelisted by SQLgrey- Received: from myemma.com (db1.e2ma.net [66.179.147.163]) by postgresql.org (Postfix) with ESMTP id 865C59FA140 for ; Sat, 1 Jul 2006 09:54:04 -0300 (ADT) Received: from localhost (localhost.localdomain [127.0.0.1]) by myemma.com (Postfix) with ESMTP id DDC7323CE0; Sat, 1 Jul 2006 08:34:33 -0500 (CDT) Received: from myemma.com ([127.0.0.1]) by localhost (velma [127.0.0.1]) (amavisd-new, port 10024) with ESMTP id 31568-04; Sat, 1 Jul 2006 08:34:33 -0500 (CDT) Received: from [192.168.2.14] (c-68-53-113-70.hsd1.tn.comcast.net [68.53.113.70]) by myemma.com (Postfix) with ESMTP id 9F13823CD4; Sat, 1 Jul 2006 08:34:33 -0500 (CDT) Message-ID: <44A6706C.6000503@myemma.com> Date: Sat, 01 Jul 2006 07:54:04 -0500 From: Erik Jones User-Agent: Thunderbird 1.5.0.4 (Windows/20060516) MIME-Version: 1.0 To: Richard Broersma Jr Cc: General Postgresql List Subject: Re: Alternative to Select in table check constraint References: <20060701014108.79890.qmail@web31811.mail.mud.yahoo.com> In-Reply-To: <20060701014108.79890.qmail@web31811.mail.mud.yahoo.com> Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: by amavisd-new-20030616-p10 (Debian) at myemma.com X-Virus-Scanned: Maia Mailguard 1.0.1 X-Archive-Number: 200607/3 X-Sequence-Number: 25577 Richard Broersma Jr wrote: > But now that I think about it, using the authors suggestion (if it actually worked), how would > would it be possible to change the active status from one badge to another? > Well, the check constraint as you wrote it requires that there always be a badge listed as active for each employee. If you changed the contstraint to: CHECK ( 2 > .....) then you'd be able to unset the active status and then set a new one to active. -- erik jones software development emma(r)