CVS Commit by dpage: Prevent duplication of functional indexes

Поиск
Список
Период
Сортировка
Искать

CVS Commit by dpage: Prevent duplication of functional indexes

От:
cvs@cvs.pgadmin.org
Дата:
Вложения:
Log Message:
-----------
Prevent duplication of functional indexes

Modified Files:
--------------
    pgadmin3/src/schema:
        pgIndex.cpp (r1.29 -> r1.30)

Re: CVS Commit by dpage: Prevent duplication of

От:
Andreas Pflug <pgadmin@pse-consulting.de>
Дата:
cvs@cvs.pgadmin.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? 

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

Regards,
Andreas


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

От:
"Dave Page" <dpage@vale-housing.co.uk>
Дата:
 

> -----Original Message-----
> From: Andreas Pflug [mailto:pgadmin@pse-consulting.de] 
> Sent: 04 May 2004 13:43
> To: Dave Page
> Cc: pgadmin-hackers@postgresql.org
> Subject: Re: [pgadmin-hackers] CVS Commit by dpage: Prevent 
> duplication of functional indexes
> 
> cvs@cvs.pgadmin.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.
FAQ