From: Markus Schaber <schabi@logix-tt.com>
To: Andreas Joseph Krogh <andreak@officenet.no>
Cc: pgsql-sql@postgresql.org
Subject: Re: Constraint question
Date: Fri, 19 May 2006 10:38:43 +0200
Message-ID: <446D8413.8060303@logix-tt.com> (raw)
In-Reply-To: <200605182105.55753.andreak@officenet.no>
References: <200605181541.54299.andreak@officenet.no>
<446CA301.20305@logix-tt.com>
<200605182105.55753.andreak@officenet.no>
Hi, Andreas,
Andreas Joseph Krogh wrote:
>>CREATE UNIQUE INDEX foo ON onp_crm_businessfield_company(company_id)
>>WHERE is_prefferred;
> I also figured out that an index like this also works:
> UNIQUE(company_id, is_preferred)
> This works because NULL = NULL is false. But I guess your solution is cleaner.
Yes, it works, but it needs more disk space (it has to index all rows,
and it needs to save both columns), and thus is slower, too.
HTH,
Markus
--
Markus Schaber | Logical Tracking&Tracing International AG
Dipl. Inf. | Software Development GIS
Fight against software patents in EU! www.ffii.org www.nosoftwarepatents.org
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Reply to all the recipients using the --to and --cc options:
reply via email
To: pgsql-sql@postgresql.org
Cc: schabi@logix-tt.com, andreak@officenet.no
Subject: Re: Constraint question
In-Reply-To: <446D8413.8060303@logix-tt.com>
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox