0

I want to convert my database in postgresql to sqlite3 during upgrading my software

1

2 Answers 2

0

Normally you do the oposite. If it is small, you take the metadata of each table, copy paste to the gui of sqlite and just change the differents datatype. Programmatically you prepare a list of "INSERT INTO bla bla" one for each row. If you use.net system use stringbuilder to compose the strings. The query must be sorted for the autoincrement value. Than run them. Small tip activate PRAGMA synchronous = OFF in sqlite if you have to insert a huge ammount of rows. Remember to format the data.

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

Comments

0

Another solution is prepare a sqlquery:

SELECT 'INSERT INTO tbl_name VALUES(' || v1 || ',' || v2 || ')' 
FROM tbl_name ORDER BY v1 --if is autoincrement

then copy-paste and enjoy

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.