11
I want to convert some tables from a Postgres database to MySQL. Ideally I would like to create an script that would convert the tables for PG to MySQL, but I am glad if we are able to figure out how to make it possible in a not-scriptable way.
First of all, I have read a similar post here: Migrate database from Postgres to MySQL
I have tried both solutions proposed there, but they did't make the trick.
It's important to say that I want to migrate the structure and the data.
But first things first, here is the SQL dump of the postgres-database:
--
-- PostgreSQL database dump
--
SET statement_timeout = 0; SET client_encoding = 'UTF8'; SET standard_conforming_strings = off; SET check_function_bodies = false; SET client_min_messages = warning; SET escape_string_warning = off;
SET search_path = public, pg_catalog;
SET default_tablespace = '';
SET default_with_oids = false;
--
-- Name: grupos; Type: TABLE; Schema: public; Owner: postgres; Tablespace:
--
CREATE TABLE grupos (
"dirGrupo" text,
valor real,
"flagIntelli" boolean DEFAULT false,
"flagQDS" boolean DEFAULT false,
finalidad text,
"idGrupo" integer DEFAULT nextval('"idGrupo"'::regclass) NOT NULL,
"claseDomo" text,
instalado boolean DEFAULT true NOT NULL,
"codCasa" "char",
"codUnidad" integer,
protocolo text NOT NULL,
escritura boolean,
dispositivo text,
"tipoDatos" oid,
"coordX" integer DEFAULT (-1),
"coordY" integer DEFAULT (-1),
mapa text,
"reglasAsociadas" text );
ALTER TABLE public.grupos OWNER TO postgres;
--
-- Data for Name: grupos; Type: TABLE DATA; Schema: public; Owner: postgres
--
INSERT INTO grupos VALUES (NULL, 0, false, false, 'sensor', 10, 'LightSensor', true, 'E', 1, 'x10', false, 'SensorLum1', 7, -1, -1, NULL, NULL); INSERT INTO grupos VALUES (NULL, 0,