+ " END AS TYPE, " + " a.attnum AS ORDINAL_POSITION, "
+ " END::int2 AS TYPE, " + " a.attnum::int2 AS ORDINAL_POSITION, "
	public java.sql.ResultSet getIndexInfo(String catalog, String schema,		String tableName, boolean unique, boolean approximate)	throws SQLException	{		String select = "SELECT NULL AS TABLE_CAT, n.nspname AS TABLE_SCHEM, ";		String from = " FROM pg_catalog.pg_namespace n, pg_catalog.pg_class ct, pg_catalog.pg_class ci, pg_catalog.pg_index i, pg_catalog.pg_attribute a, pg_catalog.pg_am am ";		String where = " AND n.oid = ct.relnamespace ";		if(schema != null && !"".equals(schema))		{			where += " AND n.nspname = '" + escapeQuotes(schema) + "' ";		}		String sql = select			+ " ct.relname AS TABLE_NAME, NOT i.indisunique AS NON_UNIQUE, NULL AS INDEX_QUALIFIER, ci.relname AS INDEX_NAME, "			+ " CASE i.indisclustered "			+ " WHEN true THEN "			+ java.sql.DatabaseMetaData.tableIndexClustered			+ " ELSE CASE am.amname "			+ " WHEN 'hash' THEN "			+ java.sql.DatabaseMetaData.tableIndexHashed			+ " ELSE "			+ java.sql.DatabaseMetaData.tableIndexOther			+ " END "			+ " END AS TYPE, "			+ " a.attnum AS ORDINAL_POSITION, "			+ " a.attname AS COLUMN_NAME, "			+ " NULL AS ASC_OR_DESC, "			+ " ci.reltuples AS CARDINALITY, "			+ " ci.relpages AS PAGES, "			+ " NULL AS FILTER_CONDITION "			+ from			+ " WHERE ct.oid=i.indrelid AND ci.oid=i.indexrelid AND a.attrelid=ci.oid AND ci.relam=am.oid "			+ where + " AND ct.relname = '" + escapeQuotes(tableName) + "' ";		if(unique)		{			sql += " AND i.indisunique ";		}		sql += " ORDER BY NON_UNIQUE, TYPE, INDEX_NAME, ORDINAL_POSITION ";		return createMetaDataStatement().executeQuery(sql);	}