0

I am under strict corporate environment and don't have access to Postgres' psql. Therefore I can't do what's shown e.g. in the SO Convert SQLITE SQL dump file to POSTGRESQL. However, I can generate the sqlite dump file .sql. The resulting dump.sql file is 1.3gb big.

What would be the best way to import this data into Postgres? I also have DBeaver and can connect to both databases simultaneously but unfortunately can't do INSERT from SELECT.

3
  • 3
    You can use psql on a remote machine to connect. Commented Jul 9, 2021 at 15:05
  • What can you access other than a crippled DBeaver? Perl? Python? R? Commented Jul 9, 2021 at 16:13
  • @jjanes I have Python available Commented Jul 9, 2021 at 16:14

3 Answers 3

2

I think the term for that is 'absurd', not 'strict'.

DBeaver has an 'execute script' feature. But who knows, maybe it will be blocked.

Sign up to request clarification or add additional context in comments.

1 Comment

Thanks but DBeaver 'execute script' is based on psql :((( so it complains that psql isn't available.
1

EnterpriseDB offers binary downloads. If you unzip those to a local drive you might be able to execute psql from the bin subdirectory.

Comments

1

If you can install psycopg2 or pg8000 for python, you should be able to connect to the database and then loop over the dump file sending each line to the database with cur.execute(line) . It might take some fiddling if the dump file has any multi-line commands, but the example you linked to doesn't show any of those.

Comments

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.