Hallo! I temporary solved the problem with the sequences by making a query: select id from ports order by id desc limit 1; But I am not convinced this is "the real way" to get the number of element the table ports has .... Saluti! Ludwig ---------------------------(end of broadcast)--------------------------- TIP 5: Have you checked our extensive FAQ? http://www.postgresql.org/users-lounge/docs/faq.html