Re: CVS Commit by dpage: Prevent duplication of functional indexes

From: "Dave Page" <dpage(at)vale-housing(dot)co(dot)uk>
To: "Andreas Pflug" <pgadmin(at)pse-consulting(dot)de>
Cc: <pgadmin-hackers(at)postgresql(dot)org>
Subject: Re: CVS Commit by dpage: Prevent duplication of functional indexes
Date: 2004-05-04 13:41:05
Message-ID: 03AF4E498C591348A42FC93DEA9661B889FC29@mail.vale-housing.co.uk
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

> -----Original Message-----
> From: Andreas Pflug [mailto:pgadmin(at)pse-consulting(dot)de]
> Sent: 04 May 2004 13:43
> To: Dave Page
> Cc: pgadmin-hackers(at)postgresql(dot)org
> Subject: Re: [pgadmin-hackers] CVS Commit by dpage: Prevent
> duplication of functional indexes
>
> cvs(at)cvs(dot)pgadmin(dot)org wrote:
>
> >- wxT(" ORDER BY cls.relname"));
> >+ wxT(" ORDER BY cls.oid, cls.relname"));
> >
> >
>
> Hi Dave,
> did you find out what makes the result duplicate? Maybe the
> query is written in a somehow unfortunate way, and could be
> properly rewritten?

It's caused by the additional pg_depend entry for the function used by
the index. I could see no easy way to get rid of it and no obvious
reason why a DISTINCT might cause problems in this case.

> The ORDER BY should probably read ORDER BY cls.relname,
> cls.oid to remain alphabetical ordering.

Hmm, good point. DISTINCT ON(cls.relname) should be OK as well I guess
(there should only ever be one index with a given name)....

Regards, Dave.

Browse pgadmin-hackers by date

  From Date Subject
Next Message Hiroshi Saito 2004-05-04 13:56:02 Re: CVS Build on FreeBSD 4.9
Previous Message Andreas Pflug 2004-05-04 12:43:14 Re: CVS Commit by dpage: Prevent duplication of