How to migrate Posgresql Script to Mysql Script?

Asked

Viewed 45 times

1

I have this database in Postgresql Script, how to convert to Msyql in order to create this database in this database ?

--
-- PostgreSQL database dump
--

-- Started on 2010-07-03 09:40:14

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;

--
-- TOC entry 1850 (class 1262 OID 26051)
-- Name: especializa; Type: DATABASE; Schema: -; Owner: postgres
--

CREATE DATABASE especializa WITH TEMPLATE = template0 ENCODING = 'UTF8' LC_COLLATE = 'Portuguese, Brazil' LC_CTYPE = 'Portuguese, Brazil';


ALTER DATABASE especializa OWNER TO postgres;

\connect especializa

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;

--
-- TOC entry 6 (class 2615 OID 26052)
-- Name: phpdeveloper; Type: SCHEMA; Schema: -; Owner: postgres
--

CREATE SCHEMA phpdeveloper;


ALTER SCHEMA phpdeveloper OWNER TO postgres;

--
-- TOC entry 327 (class 2612 OID 16386)
-- Name: plpgsql; Type: PROCEDURAL LANGUAGE; Schema: -; Owner: postgres
--

CREATE PROCEDURAL LANGUAGE plpgsql;


ALTER PROCEDURAL LANGUAGE plpgsql OWNER TO postgres;

SET search_path = phpdeveloper, pg_catalog;

SET default_tablespace = '';

SET default_with_oids = false;

--
-- TOC entry 1519 (class 1259 OID 26324)
-- Dependencies: 1809 6
-- Name: agente; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE agente (
    idagente integer NOT NULL,
    idpessoa integer NOT NULL,
    datacadastro timestamp without time zone DEFAULT now() NOT NULL,
    tipo integer
);


ALTER TABLE phpdeveloper.agente OWNER TO postgres;

--
-- TOC entry 1518 (class 1259 OID 26322)
-- Dependencies: 6 1519
-- Name: agente_idagente_seq; Type: SEQUENCE; Schema: phpdeveloper; Owner: postgres
--

CREATE SEQUENCE agente_idagente_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE phpdeveloper.agente_idagente_seq OWNER TO postgres;

--
-- TOC entry 1853 (class 0 OID 0)
-- Dependencies: 1518
-- Name: agente_idagente_seq; Type: SEQUENCE OWNED BY; Schema: phpdeveloper; Owner: postgres
--

ALTER SEQUENCE agente_idagente_seq OWNED BY agente.idagente;


--
-- TOC entry 1854 (class 0 OID 0)
-- Dependencies: 1518
-- Name: agente_idagente_seq; Type: SEQUENCE SET; Schema: phpdeveloper; Owner: postgres
--

SELECT pg_catalog.setval('agente_idagente_seq', 1, false);


--
-- TOC entry 1523 (class 1259 OID 26342)
-- Dependencies: 6
-- Name: carrinho; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE carrinho (
    idcarrinho integer NOT NULL,
    identificador character(32)
);


ALTER TABLE phpdeveloper.carrinho OWNER TO postgres;

--
-- TOC entry 1522 (class 1259 OID 26340)
-- Dependencies: 1523 6
-- Name: carrinho_idcarrinho_seq; Type: SEQUENCE; Schema: phpdeveloper; Owner: postgres
--

CREATE SEQUENCE carrinho_idcarrinho_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE phpdeveloper.carrinho_idcarrinho_seq OWNER TO postgres;

--
-- TOC entry 1855 (class 0 OID 0)
-- Dependencies: 1522
-- Name: carrinho_idcarrinho_seq; Type: SEQUENCE OWNED BY; Schema: phpdeveloper; Owner: postgres
--

ALTER SEQUENCE carrinho_idcarrinho_seq OWNED BY carrinho.idcarrinho;


--
-- TOC entry 1856 (class 0 OID 0)
-- Dependencies: 1522
-- Name: carrinho_idcarrinho_seq; Type: SEQUENCE SET; Schema: phpdeveloper; Owner: postgres
--

SELECT pg_catalog.setval('carrinho_idcarrinho_seq', 1, false);


--
-- TOC entry 1526 (class 1259 OID 26355)
-- Dependencies: 6
-- Name: categoria; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE categoria (
    idcategoria integer NOT NULL,
    nome character varying(40),
    idmae integer
);


ALTER TABLE phpdeveloper.categoria OWNER TO postgres;

--
-- TOC entry 1525 (class 1259 OID 26353)
-- Dependencies: 6 1526
-- Name: categoria_idcategoria_seq; Type: SEQUENCE; Schema: phpdeveloper; Owner: postgres
--

CREATE SEQUENCE categoria_idcategoria_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE phpdeveloper.categoria_idcategoria_seq OWNER TO postgres;

--
-- TOC entry 1857 (class 0 OID 0)
-- Dependencies: 1525
-- Name: categoria_idcategoria_seq; Type: SEQUENCE OWNED BY; Schema: phpdeveloper; Owner: postgres
--

ALTER SEQUENCE categoria_idcategoria_seq OWNED BY categoria.idcategoria;


--
-- TOC entry 1858 (class 0 OID 0)
-- Dependencies: 1525
-- Name: categoria_idcategoria_seq; Type: SEQUENCE SET; Schema: phpdeveloper; Owner: postgres
--

SELECT pg_catalog.setval('categoria_idcategoria_seq', 14, true);


--
-- TOC entry 1521 (class 1259 OID 26333)
-- Dependencies: 1811 6
-- Name: compra; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE compra (
    idcompra integer NOT NULL,
    idcarrinho integer NOT NULL,
    idagente integer NOT NULL,
    idendereco integer NOT NULL,
    data timestamp without time zone DEFAULT now()
);


ALTER TABLE phpdeveloper.compra OWNER TO postgres;

--
-- TOC entry 1520 (class 1259 OID 26331)
-- Dependencies: 6 1521
-- Name: compra_idcompra_seq; Type: SEQUENCE; Schema: phpdeveloper; Owner: postgres
--

CREATE SEQUENCE compra_idcompra_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE phpdeveloper.compra_idcompra_seq OWNER TO postgres;

--
-- TOC entry 1859 (class 0 OID 0)
-- Dependencies: 1520
-- Name: compra_idcompra_seq; Type: SEQUENCE OWNED BY; Schema: phpdeveloper; Owner: postgres
--

ALTER SEQUENCE compra_idcompra_seq OWNED BY compra.idcompra;


--
-- TOC entry 1860 (class 0 OID 0)
-- Dependencies: 1520
-- Name: compra_idcompra_seq; Type: SEQUENCE SET; Schema: phpdeveloper; Owner: postgres
--

SELECT pg_catalog.setval('compra_idcompra_seq', 1, false);


--
-- TOC entry 1517 (class 1259 OID 26316)
-- Dependencies: 6
-- Name: endereco; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE endereco (
    idendereco integer NOT NULL,
    idpessoa integer NOT NULL,
    logradouro character varying(80),
    bairro character varying(60),
    cidade character varying(60),
    uf character(2)
);


ALTER TABLE phpdeveloper.endereco OWNER TO postgres;

--
-- TOC entry 1516 (class 1259 OID 26314)
-- Dependencies: 1517 6
-- Name: endereco_idendereco_seq; Type: SEQUENCE; Schema: phpdeveloper; Owner: postgres
--

CREATE SEQUENCE endereco_idendereco_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE phpdeveloper.endereco_idendereco_seq OWNER TO postgres;

--
-- TOC entry 1861 (class 0 OID 0)
-- Dependencies: 1516
-- Name: endereco_idendereco_seq; Type: SEQUENCE OWNED BY; Schema: phpdeveloper; Owner: postgres
--

ALTER SEQUENCE endereco_idendereco_seq OWNED BY endereco.idendereco;


--
-- TOC entry 1862 (class 0 OID 0)
-- Dependencies: 1516
-- Name: endereco_idendereco_seq; Type: SEQUENCE SET; Schema: phpdeveloper; Owner: postgres
--

SELECT pg_catalog.setval('endereco_idendereco_seq', 1, false);


--
-- TOC entry 1524 (class 1259 OID 26348)
-- Dependencies: 6
-- Name: item; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE item (
    idcarrinho integer NOT NULL,
    idproduto integer NOT NULL,
    precounitario numeric(10,2),
    quantidade integer
);


ALTER TABLE phpdeveloper.item OWNER TO postgres;

--
-- TOC entry 1515 (class 1259 OID 26308)
-- Dependencies: 6
-- Name: pessoa; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE pessoa (
    idpessoa integer NOT NULL,
    nome character varying(60),
    email character varying(60),
    telefone character varying(40),
    login character varying(20),
    senha character varying(20),
    tipo integer,
    cpf character(11),
    rg character varying(20),
    datanascimento date,
    cnpj character(14),
    inscestadual character varying(20),
    inscmunicipal character(20),
    contato integer
);


ALTER TABLE phpdeveloper.pessoa OWNER TO postgres;

--
-- TOC entry 1514 (class 1259 OID 26306)
-- Dependencies: 6 1515
-- Name: pessoa_idpessoa_seq; Type: SEQUENCE; Schema: phpdeveloper; Owner: postgres
--

CREATE SEQUENCE pessoa_idpessoa_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE phpdeveloper.pessoa_idpessoa_seq OWNER TO postgres;

--
-- TOC entry 1863 (class 0 OID 0)
-- Dependencies: 1514
-- Name: pessoa_idpessoa_seq; Type: SEQUENCE OWNED BY; Schema: phpdeveloper; Owner: postgres
--

ALTER SEQUENCE pessoa_idpessoa_seq OWNED BY pessoa.idpessoa;


--
-- TOC entry 1864 (class 0 OID 0)
-- Dependencies: 1514
-- Name: pessoa_idpessoa_seq; Type: SEQUENCE SET; Schema: phpdeveloper; Owner: postgres
--

SELECT pg_catalog.setval('pessoa_idpessoa_seq', 1, true);


--
-- TOC entry 1528 (class 1259 OID 26363)
-- Dependencies: 6
-- Name: produto; Type: TABLE; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

CREATE TABLE produto (
    idproduto integer NOT NULL,
    idcategoria integer NOT NULL,
    nome character varying(40),
    descricao text,
    preco numeric(10,2)
);


ALTER TABLE phpdeveloper.produto OWNER TO postgres;

--
-- TOC entry 1527 (class 1259 OID 26361)
-- Dependencies: 1528 6
-- Name: produto_idproduto_seq; Type: SEQUENCE; Schema: phpdeveloper; Owner: postgres
--

CREATE SEQUENCE produto_idproduto_seq
    START WITH 1
    INCREMENT BY 1
    NO MAXVALUE
    NO MINVALUE
    CACHE 1;


ALTER TABLE phpdeveloper.produto_idproduto_seq OWNER TO postgres;

--
-- TOC entry 1865 (class 0 OID 0)
-- Dependencies: 1527
-- Name: produto_idproduto_seq; Type: SEQUENCE OWNED BY; Schema: phpdeveloper; Owner: postgres
--

ALTER SEQUENCE produto_idproduto_seq OWNED BY produto.idproduto;


--
-- TOC entry 1866 (class 0 OID 0)
-- Dependencies: 1527
-- Name: produto_idproduto_seq; Type: SEQUENCE SET; Schema: phpdeveloper; Owner: postgres
--

SELECT pg_catalog.setval('produto_idproduto_seq', 1, true);


--
-- TOC entry 1808 (class 2604 OID 26327)
-- Dependencies: 1518 1519 1519
-- Name: idagente; Type: DEFAULT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE agente ALTER COLUMN idagente SET DEFAULT nextval('agente_idagente_seq'::regclass);


--
-- TOC entry 1812 (class 2604 OID 26345)
-- Dependencies: 1523 1522 1523
-- Name: idcarrinho; Type: DEFAULT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE carrinho ALTER COLUMN idcarrinho SET DEFAULT nextval('carrinho_idcarrinho_seq'::regclass);


--
-- TOC entry 1813 (class 2604 OID 26358)
-- Dependencies: 1525 1526 1526
-- Name: idcategoria; Type: DEFAULT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE categoria ALTER COLUMN idcategoria SET DEFAULT nextval('categoria_idcategoria_seq'::regclass);


--
-- TOC entry 1810 (class 2604 OID 26336)
-- Dependencies: 1520 1521 1521
-- Name: idcompra; Type: DEFAULT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE compra ALTER COLUMN idcompra SET DEFAULT nextval('compra_idcompra_seq'::regclass);


--
-- TOC entry 1807 (class 2604 OID 26319)
-- Dependencies: 1516 1517 1517
-- Name: idendereco; Type: DEFAULT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE endereco ALTER COLUMN idendereco SET DEFAULT nextval('endereco_idendereco_seq'::regclass);


--
-- TOC entry 1806 (class 2604 OID 26311)
-- Dependencies: 1515 1514 1515
-- Name: idpessoa; Type: DEFAULT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE pessoa ALTER COLUMN idpessoa SET DEFAULT nextval('pessoa_idpessoa_seq'::regclass);


--
-- TOC entry 1814 (class 2604 OID 26366)
-- Dependencies: 1528 1527 1528
-- Name: idproduto; Type: DEFAULT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE produto ALTER COLUMN idproduto SET DEFAULT nextval('produto_idproduto_seq'::regclass);


--
-- TOC entry 1842 (class 0 OID 26324)
-- Dependencies: 1519
-- Data for Name: agente; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--



--
-- TOC entry 1844 (class 0 OID 26342)
-- Dependencies: 1523
-- Data for Name: carrinho; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--



--
-- TOC entry 1846 (class 0 OID 26355)
-- Dependencies: 1526
-- Data for Name: categoria; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--

INSERT INTO categoria (idcategoria, nome, idmae) VALUES (1, 'Eletrodomésticos', NULL);
INSERT INTO categoria (idcategoria, nome, idmae) VALUES (2, 'Móveis', NULL);
INSERT INTO categoria (idcategoria, nome, idmae) VALUES (11, 'Telefonia', NULL);
INSERT INTO categoria (idcategoria, nome, idmae) VALUES (12, 'Comida', NULL);
INSERT INTO categoria (idcategoria, nome, idmae) VALUES (13, 'Vestuário', NULL);
INSERT INTO categoria (idcategoria, nome, idmae) VALUES (14, 'Teste', NULL);


--
-- TOC entry 1843 (class 0 OID 26333)
-- Dependencies: 1521
-- Data for Name: compra; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--



--
-- TOC entry 1841 (class 0 OID 26316)
-- Dependencies: 1517
-- Data for Name: endereco; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--



--
-- TOC entry 1845 (class 0 OID 26348)
-- Dependencies: 1524
-- Data for Name: item; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--



--
-- TOC entry 1840 (class 0 OID 26308)
-- Dependencies: 1515
-- Data for Name: pessoa; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--

INSERT INTO pessoa (idpessoa, nome, email, telefone, login, senha, tipo, cpf, rg, datanascimento, cnpj, inscestadual, inscmunicipal, contato) VALUES (1, 'Vagner', '[email protected]', '96181511', 'vagner', '123', 1, '04641463484', '5713165', '1982-02-13', NULL, NULL, NULL, NULL);


--
-- TOC entry 1847 (class 0 OID 26363)
-- Dependencies: 1528
-- Data for Name: produto; Type: TABLE DATA; Schema: phpdeveloper; Owner: postgres
--

INSERT INTO produto (idproduto, idcategoria, nome, descricao, preco) VALUES (1, 1, 'TV 29', 'TV de 29 polegadas, tela plana', 900.25);


--
-- TOC entry 1820 (class 2606 OID 26330)
-- Dependencies: 1519 1519
-- Name: agente_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY agente
    ADD CONSTRAINT agente_pkey PRIMARY KEY (idagente);


--
-- TOC entry 1824 (class 2606 OID 26347)
-- Dependencies: 1523 1523
-- Name: carrinho_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY carrinho
    ADD CONSTRAINT carrinho_pkey PRIMARY KEY (idcarrinho);


--
-- TOC entry 1828 (class 2606 OID 26360)
-- Dependencies: 1526 1526
-- Name: categoria_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY categoria
    ADD CONSTRAINT categoria_pkey PRIMARY KEY (idcategoria);


--
-- TOC entry 1822 (class 2606 OID 26339)
-- Dependencies: 1521 1521
-- Name: compra_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY compra
    ADD CONSTRAINT compra_pkey PRIMARY KEY (idcompra);


--
-- TOC entry 1818 (class 2606 OID 26321)
-- Dependencies: 1517 1517
-- Name: endereco_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY endereco
    ADD CONSTRAINT endereco_pkey PRIMARY KEY (idendereco);


--
-- TOC entry 1826 (class 2606 OID 26352)
-- Dependencies: 1524 1524 1524
-- Name: item_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_pkey PRIMARY KEY (idcarrinho, idproduto);


--
-- TOC entry 1816 (class 2606 OID 26313)
-- Dependencies: 1515 1515
-- Name: pessoa_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY pessoa
    ADD CONSTRAINT pessoa_pkey PRIMARY KEY (idpessoa);


--
-- TOC entry 1830 (class 2606 OID 26371)
-- Dependencies: 1528 1528
-- Name: produto_pkey; Type: CONSTRAINT; Schema: phpdeveloper; Owner: postgres; Tablespace: 
--

ALTER TABLE ONLY produto
    ADD CONSTRAINT produto_pkey PRIMARY KEY (idproduto);


--
-- TOC entry 1832 (class 2606 OID 26377)
-- Dependencies: 1515 1519 1815
-- Name: agente_idpessoa_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY agente
    ADD CONSTRAINT agente_idpessoa_fkey FOREIGN KEY (idpessoa) REFERENCES pessoa(idpessoa) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1838 (class 2606 OID 26402)
-- Dependencies: 1827 1526 1526
-- Name: categoria_idmae_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY categoria
    ADD CONSTRAINT categoria_idmae_fkey FOREIGN KEY (idmae) REFERENCES categoria(idcategoria) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1834 (class 2606 OID 26387)
-- Dependencies: 1519 1521 1819
-- Name: compra_idagente_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY compra
    ADD CONSTRAINT compra_idagente_fkey FOREIGN KEY (idagente) REFERENCES agente(idagente) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1835 (class 2606 OID 26392)
-- Dependencies: 1521 1523 1823
-- Name: compra_idcarrinho_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY compra
    ADD CONSTRAINT compra_idcarrinho_fkey FOREIGN KEY (idcarrinho) REFERENCES carrinho(idcarrinho) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1833 (class 2606 OID 26382)
-- Dependencies: 1517 1817 1521
-- Name: compra_idendereco_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY compra
    ADD CONSTRAINT compra_idendereco_fkey FOREIGN KEY (idendereco) REFERENCES endereco(idendereco) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1831 (class 2606 OID 26372)
-- Dependencies: 1517 1515 1815
-- Name: endereco_idpessoa_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY endereco
    ADD CONSTRAINT endereco_idpessoa_fkey FOREIGN KEY (idpessoa) REFERENCES pessoa(idpessoa) ON UPDATE CASCADE ON DELETE CASCADE;


--
-- TOC entry 1836 (class 2606 OID 26397)
-- Dependencies: 1823 1524 1523
-- Name: item_idcarrinho_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_idcarrinho_fkey FOREIGN KEY (idcarrinho) REFERENCES carrinho(idcarrinho) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1837 (class 2606 OID 26412)
-- Dependencies: 1829 1524 1528
-- Name: item_idproduto_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY item
    ADD CONSTRAINT item_idproduto_fkey FOREIGN KEY (idproduto) REFERENCES produto(idproduto) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1839 (class 2606 OID 26407)
-- Dependencies: 1827 1526 1528
-- Name: produto_idcategoria_fkey; Type: FK CONSTRAINT; Schema: phpdeveloper; Owner: postgres
--

ALTER TABLE ONLY produto
    ADD CONSTRAINT produto_idcategoria_fkey FOREIGN KEY (idcategoria) REFERENCES categoria(idcategoria) ON UPDATE RESTRICT ON DELETE RESTRICT;


--
-- TOC entry 1852 (class 0 OID 0)
-- Dependencies: 3
-- Name: public; Type: ACL; Schema: -; Owner: postgres
--

REVOKE ALL ON SCHEMA public FROM PUBLIC;
REVOKE ALL ON SCHEMA public FROM postgres;
GRANT ALL ON SCHEMA public TO postgres;
GRANT ALL ON SCHEMA public TO PUBLIC;


-- Completed on 2010-07-03 09:40:14

--
-- PostgreSQL database dump complete
--

1 answer

2


I advise you to use Mysql Workbench, because it has an excellent migration tool, as mentioned on the product site itself:

Mysql Workbench 5.2.41 introduced the new Migration Assistant module. This module allows you to quickly and easily migrate databases from various RDBMS products to Mysql. From Workbench 5.2.44 you can migrate databases from Microsoft SQL Server, Postgresql and Sybase Adaptive Server Enterprise. It also provides generic migrations, i.e., migrations from other Rdbmss that are not explicitly supported, as long as they have a well-behaved ODBC driver. More on this in a upcoming publication ...

In addition, you can use the Migration Wizard to run Mysql for Mysql database migrations, which can be used for tasks like copying a database on servers or migrating data in different versions of Mysql.

Source: http://mysqlworkbench.org/2012/11/how-to-migrate-postgresql-databases-to-mysql-using-the-mysql-workbench-migration-wizard/

  • I understand. But there is some tool to migrate the code from Postgresql to Mysql ??

  • This tool as said is able to migrate by downloading it and going on the migration part

Browser other questions tagged

You are not signed in. Login or sign up in order to post.