I'm trying to dump a .sql file into a PostgresSQL database and it's acting kinda funky. I've followed a lot of the advice here (Import SQL dump into PostgreSQL database) and thought I got close. Whenever I try something like:
psql -h localhost -d db_name -U postgres -f sql_file.sql
It starts to work, but then I start to get a bunch of errors in a row like
psql:sql_file.sql:42: error: invalid command \'s
psql:sql_file.sql:43: error: invalid command \'t
psql:sql_file.sql:44: error: invalid command \'s
With that final invalid command changing to different strings on the end there. Is it not understanding some escape characters and instead trying to use them as commands in psql? If so, how do I avoid this? Eventually the dump terminated with:
psql:sql_file.sql:2281: error: out of memory
It is a rather large sql file (about 150GB). Am I going about this the wrong way? Any advice?