Ok I found the solution. I have to use the UPDATE command and not the INSERT: UPDATE c_transactions SET timestamp = entrytimestamp and than: UPDATE c_transactions SET timestamp = exittimestamp WHERE exittimestamp IS NOT NULL -- Sent via pgsql-general mailing list (pgsql-general@xxxxxxxxxxxxxx) To make changes to your subscription: http://www.postgresql.org/mailpref/pgsql-general