I have an sql script that I am trying to execute in psql client on the
database itself. The script is just a bunch (hundreds of thousands) of
INSERT statements.
I don't know how, but I seem to have bad characters throughout my file
and when I run the script it will of course error out complaining about
the invalid character. I figure out how many insert statements were
successful and use sed to chop of those statements from the sql script
file. I then use VI and delete out the bad character and re-run the
script.
There's got to be a better way to do this. Is there a way in a psql
script to try to execute the INSERT statement and if theres a problem to
dump it to a log file and go on with the others?
Thanks in advance,
James