Bug in adddepend (was: pg_constraint missing many entries?) - Mailing list pgsql-general

From Jeff Boes
Subject Bug in adddepend (was: pg_constraint missing many entries?)
Date
Msg-id 31e9e0ad0c3bfc4a6c85bb0e9af94070@news.teranews.com
Whole thread Raw
In response to Re: pg_constraint missing many entries?  (Martijn van Oosterhout <kleptog@svana.org>)
List pgsql-general
Martijn van Oosterhout wrote:
> That's right, pg_constraint didn't exist before 7.3. In the contrib
> directory there is a script called adddepend which attempts to create the
> missing records for you.
>

And much to my dismay, it has a bug (or a serious limitation).


Table (before):

...

Indexes:  ix_foo_1 unique(fn_myfunc(foo_column))


becomes


Table (after):

...

Indexes:  ix_foo_1 unique(foo_column))


That is, the script turned a functional index into an index on a column.
Bad, bad news. It's fortunate I did this on our test system; it's
unfortunate that I did it at the end of the day. Overnight, we ran a few
  HUNDRED THOUSAND queries against a large table using no index ...


--
Jeff Boes                                      vox 269.226.9550 ext 24
Database Engineer                                     fax 269.349.9076
Nexcerpt, Inc.                                 http://www.nexcerpt.com
            ...Nexcerpt... Extend your Expertise


pgsql-general by date:

Previous
From: Greg Stark
Date:
Subject: Re: Point-in-time data recovery - v.7.4
Next
From: Robert Treat
Date:
Subject: Re: [ADMIN] Point-in-time data recovery - v.7.4