Re: adddepend and partial indexes

From: Stephan Szabo <sszabo(at)megazone23(dot)bigpanda(dot)com>
To: SZŰCS Gábor <surrano(at)mailbox(dot)hu>
Cc: <pgsql-general(at)postgresql(dot)org>
Subject: Re: adddepend and partial indexes
Date: 2003-06-17 14:48:06
Message-ID: 20030617074151.J95725-100000@megazone23.bigpanda.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general


On Tue, 17 Jun 2003, [iso-8859-2] SZCS Gbor wrote:

> Dear Fellows,
>
> Couldn't find a list on adddepend, nor this problem via Google nor search at
> postgresql.org, so here it goes.
>
> Adddepend seems to have problem with partial indexes. Below is an example.
> I can see the bugous regular subst in the perl script and I'd probably be
> able to correct it, but I don't know how to use ALTER TABLE to add a partial
> UNIQUE constraint (or shouldn't I add it at all?)

AFAIK there's no such thing as a partial unique constraint so the index
should probably just be left alone.

> Also, I can't see the meaning of the second regular subst (as shown below).

Hmm, I'd have guessed it was to take off index opclass information, but it
doesn't seem to do that (and doing so seems incorrect if its an index
using a non-default opclass).

> ------------------------------- 7.3.2
> adddepend -------------------------------
> ------------------------------- Func:
> findUniqueConstraints -------------------
> # ...
> # Fetch vars
> my $constraint_name = $row->{'index_name'};
> my $table = $row->{'table_name'};
> my $columns = $row->{'constraint_definition'};
>
> # Extract the columns from the index definition
> $columns =~ s|.*\(([^\)]+)\).*|$1|g;
> $columns =~ s|([^\s]+)[^\s]+_ops|$1|g;

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Jonathan Bartlett 2003-06-17 14:52:06 Re: postgreSQL on NAS/SAN?
Previous Message Sven Köhler 2003-06-17 14:46:27 Re: full featured alter table?