0

I'm trying to load a dump from a big postgresql database (>1GB) with sqlite3. This is my code:

# import package
import sqlite3
# load data
importpath = 'C:\directory\dump.sql'
con = sqlite3.connect(importpath)
f = open(importpath,'r')
sql = f.read()
cur.executescript(sql)

I keep getting a very unspecific error. It just says "MemoryError:" with an arrow pointing on "sql = f.read()". I guess it is some sort of problem with insufficient memory for all the data but I really can't tell. Any advice to fix that? I just need to get the data into a local database where I can access it from Python. Unfortunately it's not an option to use a separate local database application since I'm stuck with what is already installed.

2

0

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.