My favorite little-known feature of PostgreSQL is the "RETURNING UID". When doing an INSERT add at the end "RETURNING" and the primary column name. It will both insert a row and return the auto-incremented primary key value. #PostgreSQL
Right-click 'Download' and select 'Save Link As' if the file opens in a new tab.