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

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

From: Simon Riggs <simon(at)2ndquadrant(dot)com>
To: Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>
Cc: pgsql-committers(at)postgresql(dot)org
Subject: Re: pgsql: If an index depends on no columns of itstable, give it a
Date: 2007-11-09 09:21:53
Message-ID: (view raw, whole thread or download thread mbox)
Lists: pgsql-committers
On Fri, 2007-11-09 at 04:05 -0500, Tom Lane wrote:
> Simon Riggs <simon(at)2ndquadrant(dot)com> writes:
> > I had understood the discussion to conclude that indexes that do not
> > depend on any column of the table to not be allowed at all.
> 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));

It's also a lot more obvious than creating an index on a constant, which
seems like a wrinkle that we should disallow. It just sounds to me like
something that will break again in the future, so I'd rather disallow it
now rather than here "but we need to support zero column indexes too".

  Simon Riggs

In response to


pgsql-committers by date

Next:From: Peter EisentrautDate: 2007-11-09 15:52:52
Subject: pgsql: Allow XML processing instructions starting with "xml" while
Previous:From: Simon RiggsDate: 2007-11-09 09:16:54
Subject: Re: Fix for stop words in thesaurus file

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