Convert SQLITE SQL dump file to POSTGRESQL
Posted
by
DevX
on Stack Overflow
See other posts from Stack Overflow
or by DevX
Published on 2011-01-03T02:33:26Z
Indexed on
2011/01/03
3:53 UTC
Read the original article
Hit count: 644
I've been doing development using SQLITE database with production in POSTGRESQL. I just updated my local database with a huge amount of data and need to transfer a specific table to the production database.
SQLITE outputs a table dump in the following format:
BEGIN TRANSACTION;
CREATE TABLE "courses_school" ("id" integer PRIMARY KEY, "department_count" integer NOT NULL DEFAULT 0, "the_id" integer UNIQUE, "school_name" varchar(150), "slug" varchar(50));
INSERT INTO "courses_school" VALUES(1,168,213,'TEST Name A',NULL);
INSERT INTO "courses_school" VALUES(2,0,656,'TEST Name B',NULL);
....
COMMIT;
How do I convert the above into a POSTGRESQL compatible dump file that I can import into my production server?
© Stack Overflow or respective owner