conn->errormsg="The buffer was too small for the result.";
conn->errormsg="The buffer was too small for tthe InfoValue.";
}
}
}
...
...
@@ -2441,6 +2441,7 @@ SQLPrimaryKeys(
{
staticchar*func="SQLPrimaryKeys";
StatementClass*stmt=(StatementClass*)hstmt;
ConnectionClass*conn;
TupleNode*row;
RETCODEresult;
intseq=0;
...
...
@@ -2451,6 +2452,7 @@ SQLPrimaryKeys(
SDWORDattname_len;
charpktab[MAX_TABLE_LEN+1];
Int2result_cols;
intqno,qstart,qend;
mylog("%s: entering...stmt=%u\n",func,stmt);
...
...
@@ -2511,25 +2513,56 @@ SQLPrimaryKeys(
returnSQL_ERROR;
}
#if 0
sprintf(tables_query, "select distinct on (attnum) a2.attname, a2.attnum from pg_attribute a1, pg_attribute a2, pg_class c, pg_index i where c.relname = '%s_pkey' AND c.oid = i.indexrelid AND a1.attrelid = c.oid AND a2.attrelid = c.oid AND (i.indkey[0] = a1.attnum OR i.indkey[1] = a1.attnum OR i.indkey[2] = a1.attnum OR i.indkey[3] = a1.attnum OR i.indkey[4] = a1.attnum OR i.indkey[5] = a1.attnum OR i.indkey[6] = a1.attnum OR i.indkey[7] = a1.attnum) order by a2.attnum", pktab);