Thank you, Bill, Yes, deadlock occurs when there are multiple processes insert concurrently into file table with the same volume id field. I used "sometimes" as opposed to "all the time". I think you advise to retry transaction or add select for update prior to insert. I will pursue this (together with upgrade to 9.3.6 suggested by Alvaro). Thanks, Dmitry -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general