In our application we have a about 20 tables that contain lookup information (read only data that the application doesn't modify).

Nightly we'd like to update this information by deleting all the content and running a script that run a series of inserts and updates. This script could be a couple of million lines long.

I was thinking to run this within a transaction. 

What behaviour should I expect from the database? Will the tables be updated at the end of the transaction without downtime?

Is there something I should be aware of when running large transactions?

The database I'm using is Postgres 9.3

Thanks.