i mentionned my problem to a coworker and he gave me this SQL to get the primary key's name either a table or a view.<br><br>SELECT column_name FROM information_schema.view_table_usage vtu <br>JOIN information_schema.constraint_column_usage ccu ON vtu.table_name = ccu.table_name<br>
JOIN pg_constraint c ON c.conname=ccu.constraint_name<br>WHERE vtu.view_name = 'table_or_view_name'<br>AND c.contype='p'<br>UNION <br>SELECT column_name FROM information_schema.constraint_column_usage ccu <br>
JOIN pg_constraint c ON c.conname=ccu.constraint_name<br>WHERE ccu.table_name = 'table_or_view_name'<br>AND c.contype='p'<br><br><span id="result_box" class="short_text" lang="en"><span class="hps">I wondered if</span> <span class="hps">this could</span> <span class="hps">replace the current SQL to get the primary key's name or it will cause problems elsewhere ?<br>
<br><br>Marc-André Trottier<br></span></span>