> I'll use gawk to extract the relevant fields from the text file in which > they reside (in the correct order), then use emacs keyboard macros to add > the appropriate update text to each line. Must more efficient (and less > tedious) than manually writing each line.
Actually a one-liner gawk script does the job.
I'm not sure what format your text file is in, but you could probably use \copy to bring it into a (temporary) table in Postgres. As long as it had your four new columns and the site_nbr, you could then update from that table in one swoop: