dbTalk Databases Forums  

[BUGS] jdbc driver return wrong medata values

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss [BUGS] jdbc driver return wrong medata values in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Xavier Maysonnave
 
Posts: n/a

Default [BUGS] jdbc driver return wrong medata values - 04-15-2005 , 09:31 AM






Hi,

Environment :

Windows XP SP2
Postgres 8.0
JDK 1.5.0_02
postgresql-8.0-311.jdbc3.jar

While analysing the index structures of a metadata table with the
following statement :

ResultSet parts = dbMeta.getIndexInfo("aCatalog", "aMetaSchema",
"aTable", false, false);
....
if (parts != null) {
try {
while (parts.next()) {
String indexName = parts.getString(6);
String columnName = parts.getString(9);
short position= parts.getShort(8);
String direction = parts.getString(10);
boolean unique = parts.getBoolean(4);
}
} finally {
parts.close();
}
}

While controling the result with pgadmin III it appears that :

- Unique Index have a returned boolean unique set to false :
- this value should apply to Non Unique Index
- Non Unique Index have a returned boolean unique set to true :
- this value should apply to Unique Index

Regards.

---------------------------(end of broadcast)---------------------------
TIP 5: Have you checked our extensive FAQ?

http://www.postgresql.org/docs/faq

Reply With Quote
  #2  
Old   
Kris Jurka
 
Posts: n/a

Default Re: [BUGS] jdbc driver return wrong medata values - 04-15-2005 , 02:18 PM








On Thu, 14 Apr 2005, Xavier Maysonnave wrote:

Quote:
postgresql-8.0-311.jdbc3.jar

While analysing the index structures of a metadata table with the
following statement :

ResultSet parts = dbMeta.getIndexInfo("aCatalog", "aMetaSchema",
"aTable", false, false);
...
if (parts != null) {
try {
while (parts.next()) {
String indexName = parts.getString(6);
String columnName = parts.getString(9);
short position= parts.getShort(8);
String direction = parts.getString(10);
boolean unique = parts.getBoolean(4);
}
} finally {
parts.close();
}
}

While controling the result with pgadmin III it appears that :

- Unique Index have a returned boolean unique set to false :
- this value should apply to Non Unique Index
- Non Unique Index have a returned boolean unique set to true :
- this value should apply to Unique Index

If you check the javadoc for getIndexInfo you will see column four is
actually "NON_UNIQUE" not unique.

Kris Jurka

---------------------------(end of broadcast)---------------------------
TIP 1: subscribe and unsubscribe commands go to majordomo (AT) postgresql (DOT) org


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.