Many thanks for the speedy reply. I don't know how your're going to do it, but in case it's any use here's the sql that I used with pyPgSQL:<br><br>&nbsp;&nbsp;&nbsp; s1 = 'SELECT b.attname FROM pg_constraint a, pg_attribute b '<br>&nbsp;&nbsp;&nbsp; s2 = 'WHERE 
a.conrelid = (\'%s\'::regclass) ' % tablename<br>&nbsp;&nbsp;&nbsp; s3 = 'AND a.conrelid = b.attrelid '<br>&nbsp;&nbsp;&nbsp; s4 = 'AND b.attnum = ANY(a.conkey) AND a.contype = \'p\''<br>&nbsp;&nbsp;&nbsp; return s1 + s2 + s3 + s4<br><br>I can't remember why I split it up like that.
<br><br>Paul Hide<br><div><span class="gmail_quote">On 24/05/06, <b class="gmail_sendername">Christoph Zwerschke</b> &lt;<a href="mailto:cito@online.de">cito@online.de</a>&gt; wrote:</span><blockquote class="gmail_quote" style="border-left: 1px solid rgb(204, 204, 204); margin: 0pt 0pt 0pt 0.8ex; padding-left: 1ex;">
Paul Hide wrote:<br>&gt; I am experimenting with pygresql as an alternative to pyPgSQL. So far,<br>&gt; it has been a good experience. However, I was surprised to see that<br>&gt; pg.pkey only returns one attribute/column name of a table that has a
<br>&gt; composite primary key.<br><br>I think PyGreSQL never supported composite primary keys in pkey() and<br>get(). A backward compatible fix would be to let pkey() return the name<br>of the primary key if it is a single column, or a tuple of column names
<br>if it is a composite key. get() should cope with composite keys as well,<br>and also allow tuples for the keyname attribute.<br><br>If nobody disagrees, I'll try to add this over the weekend. This could<br>then go into PyGreSQL 
3.9.<br><br>-- Christoph<br>_______________________________________________<br>PyGreSQL mailing list<br><a href="mailto:PyGreSQL@Vex.Net">PyGreSQL@Vex.Net</a><br><a href="http://mailman.vex.net/mailman/listinfo/pygresql">
http://mailman.vex.net/mailman/listinfo/pygresql</a><br></blockquote></div><br>