Re: Preventing duplicate records according to several fields

From: Michael Glaesemann <grzm(at)myrealbox(dot)com>
To: CSN <cool_screen_name90001(at)yahoo(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: Preventing duplicate records according to several fields
Date: 2005-09-21 01:59:37
Message-ID: 279ED533-4E9D-44E3-8B21-3EC535AA31DB@myrealbox.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Sep 21, 2005, at 10:34 AM, CSN wrote:

> id, title, yield, directions
>
> and would like to prevent duplicate records from being
> added (i.e. according to the title, yield, and
> directions fields).

<snip />

> - Create a unique index across the title, yield, and
> directions fields.

This scenario is exactly what the UNIQUE contraint is for.

Michael Glaesemann
grzm myrealbox com

In response to

Browse pgsql-general by date

  From Date Subject
Next Message suresh ramasamy 2005-09-21 04:03:37 Re: help me pls
Previous Message CSN 2005-09-21 01:34:48 Preventing duplicate records according to several fields