Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- # grab record id's from staging table
- psql -d evergreen -A -t -c 'SELECT id FROM staging_records_import;' > recids.sql
- # convert the list of id's into SQL INSERTs
- sed -i 's/^\(.*\)$/INSERT INTO biblio.record_entry (marc) SELECT marc FROM staging_records_import WHERE id = $1;/' recids.sql
- # split record id's into 4 files (so you can parallelize the import)
- split -d -n l/4 recids.sql recids.sql.
- # now, use a separate psql process for each resulting file (recids.sql.00, recids.sql.01, etc)
- psql -d evergreen -f recids.sql.00
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement