Open Mistobaan opened 6 years ago
running psql -f <migration file>
runs without problems ...
There must be a leak somewhere. I'm guessing, the leak is that the rows are not getting closed when they're executed.
@magicalbanana seems to be correct. https://github.com/mattes/migrate/blob/master/database/postgres/postgres.go#L164
edit: nvm, Exec(..)
doesn't keep the stream open, I was confused with Query(..)
Could it maybe be that psql interprets the SQL and sends statements seperately, whereas migrate executes all the statements as a single statement?
I am using the postgres driver to insert 80k rows.
the system consistently fail with this error:
(details: pq: the database system is in recovery mode) and pq: the database system is in recovery mode in line 0: SELECT pg_advisory_unlock($1)
And the reason is that it exhausts the entire memory. The entire sql migration is 1.5Mb.
What is going on here?