Re: How to create unique constraint on NULL columns

From: "Michael Schmidt" <MichaelMSchmidt(at)msn(dot)com>
To: "PostgreSQL General" <pgsql-general(at)postgresql(dot)org>
Subject: Re: How to create unique constraint on NULL columns
Date: 2005-07-16 21:58:29
Message-ID: BAY101-DAV12809A20C96F25A74A08D1A3D30@phx.gbl
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

I was faced with a similar issue. One suggestion I got from the Internet was to create a shadow column that contains the values used in the Index, with a dummy entry (in my case, the string <NULL>) for those records in which the primary column is NULL. It works well for my app.

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Ron Mayer 2005-07-16 22:18:24 Re: Converting MySQL tinyint to PostgreSQL
Previous Message Garrett Kalleberg 2005-07-16 21:39:59 foreign key constraints and inheritence