Re: Index metadata not sorted by ORDINAL_POSITION

From: Barry Lind <blind(at)xythos(dot)com>
To: Kris Jurka <books(at)ejurka(dot)com>
Cc: Peter Royal <proyal(at)pace2020(dot)com>, pgsql-jdbc(at)postgresql(dot)org
Subject: Re: Index metadata not sorted by ORDINAL_POSITION
Date: 2003-04-17 04:38:25
Message-ID: 3E9E2FC1.6060405@xythos.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-jdbc

Patch applied to both head and 7.3 branch.

thanks,
--Barry

Kris Jurka wrote:
> On Mon, 14 Apr 2003, Peter Royal wrote:
>
>>>In AbstractJdbc1DatabaseMetaData.getIndexInfo(), the query needs to
>>>also be sorted by ORDINAL_POSITION as the final field in the ORDER BY
>>>clause.
>
>
> Attached is a patch to fix this problem.
>
> Kris Jurka
>
>
>
> ------------------------------------------------------------------------
>
> ? src/interfaces/jdbc/org/postgresql/jdbc1/t.java
> Index: src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java
> ===================================================================
> RCS file: /projects/cvsroot/pgsql-server/src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java,v
> retrieving revision 1.20
> diff -c -r1.20 AbstractJdbc1DatabaseMetaData.java
> *** src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java 2003/03/25 02:28:45 1.20
> --- src/interfaces/jdbc/org/postgresql/jdbc1/AbstractJdbc1DatabaseMetaData.java 2003/04/16 07:15:31
> ***************
> *** 3568,3574 ****
> if (unique) {
> sql += " AND i.indisunique ";
> }
> ! sql += " ORDER BY NON_UNIQUE, TYPE, INDEX_NAME ";
> return connection.createStatement().executeQuery(sql);
> }
>
> --- 3568,3574 ----
> if (unique) {
> sql += " AND i.indisunique ";
> }
> ! sql += " ORDER BY NON_UNIQUE, TYPE, INDEX_NAME, ORDINAL_POSITION ";
> return connection.createStatement().executeQuery(sql);
> }
>
>
>
> ------------------------------------------------------------------------
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 5: Have you checked our extensive FAQ?
>
> http://www.postgresql.org/docs/faqs/FAQ.html

In response to

Browse pgsql-jdbc by date

  From Date Subject
Next Message Nic Ferrier 2003-04-17 09:21:48 Re: [PATCHES] the build
Previous Message Barry Lind 2003-04-17 04:38:00 Re: Bug in getImportedExportedKeys(), DatabaseMetaData class