Skip site navigation (1) Skip section navigation (2)

Re: pgsql: If an index depends on no columns of its table, give it a

From: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
To: Simon Riggs <simon(at)2ndquadrant(dot)com>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: If an index depends on no columns of its table, give it a
Date: 2007-11-09 16:28:08
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> On Fri, 2007-11-09 at 04:05 -0500, Tom Lane wrote:
>> That was my first reaction too, but the point about unique-index behavior
>> refutes it.  Constraining a table to have at most one row is useful.

> Sure is, and I've done it just a few days ago.

> This SQL does it using standard syntax:

>   create table foo (handle integer primary key check (handle = 1));

That does not constrain the table to have only one row.  It constrains
it to have only one value of the handle field (thereby making the field
useless).  The fact that there are workarounds isn't a reason to not
support the index option.

			regards, tom lane

In response to


pgsql-committers by date

Next:From: Bruce MomjianDate: 2007-11-09 16:36:04
Subject: pgsql: Move pl/proxy into Multi-server parallel query execution
Previous:From: Peter EisentrautDate: 2007-11-09 15:52:52
Subject: pgsql: Allow XML processing instructions starting with "xml" while

Privacy Policy | About PostgreSQL
Copyright © 1996-2017 The PostgreSQL Global Development Group