migrating from mysql

Ask a Question related to PostgreSQL / PGSQL, Design and Development.

  1. #1

    Default migrating from mysql

    Hi everyone,
    I am new to postgresql.
    I am planning to migrate our current database (mysql) to posgresql. I
    am currently having difficulties dealing with the order of the tables
    that is created.
    Here is what I do:
    1. I use myqsldump to get the schema and data.
    2. I use my2pg and a java utility I created to convert mysqldump to
    sql statement that is understood by postgresql.
    3. When populating the data to postgresql, it complained relation
    "xxx" doesn't exist. This is the case because the table that is
    refrenced has not been created.
    The quick fix to this will be to change the sequence of the tables
    that are created in such a way that tables that are being referenced
    are first created before referencing table.
    However, this is not practical if we have many tables.
    My questions is: is there a way to get around this? is it possible to
    disable checking for relation when creating a table that is
    referencing to other tables?
    I've searched around the internet and found somebody mentioning about
    disable-fk-verifications, but I got an error (something like invalid
    configuration parameters).
    I am currently using postgresql 7.4.6.

    Any ideas/suggestions is greatly appreciated.

    J

    ---------------------------(end of broadcast)---------------------------
    TIP 6: Have you searched our list archives?

    [url]http://archives.postgresql.org[/url]

    Junaili Lie Guest

  2. Similar Questions and Discussions

    1. Migrating MySQL Windows to Mac
      Using the MySQL Migration Tool, I converted my MS SQL data to MySQL on Windows. Now I need to move the data to MySQL on my Mac (10.3.9). Any idea...
    2. migrating from php/mysql/amfphp to microsoft sql 2003
      Hi There Have running (internally) flash app with php/amfphp and mySQL Customer wants to migrate to SQL2003. I assume that this is possible, but...
    3. Parsing XML : Migrating 1.5 -> 2.0
      Given the following XML file: <SomeData> <User> <Name> <FName>John</FName> <LName>Smith</LName> </Name> <Company>GM</Company>...
    4. Migrating from CF5 to CF7
      I tried to migrate a site which was working on a server with CF5 to a server with CF7. Everything worked fine - but all the text which comes from...
    5. Migrating to PHP 5
      Hi. I have my CSM (EzPublish) in PHP. Yersteday I have installed PHP 5 and my CSM stops work. It give me error in my pages and stops working. I...
  3. #2

    Default Re: migrating from mysql

    1. Create a script that creates the tables without RI stuff like
    foreign keys and triggers.
    2. Import the data into the tables using COPY
    3. Create the RI stuff with 'alter table' and 'create trigger'
    statements
    [url]http://www.postgresql.org/docs/current/static/sql-copy.html[/url]
    [url]http://www.postgresql.org/docs/current/static/sql-createtrigger.html[/url]
    [url]http://www.postgresql.org/docs/current/static/sql-altertable.html[/url]

    As long as the original tables have no RI problems, and you load a
    snapshot of the existing MySQL data, you should not have any problems.

    -----Original Message-----
    From: [email]pgsql-general-owner@postgresql.org[/email]
    [mailto:pgsql-general-owner@postgresql.org] On Behalf Of Junaili Lie
    Sent: Wednesday, December 22, 2004 5:04 PM
    To: [email]pgsql-general@postgresql.org[/email]
    Subject: [GENERAL] migrating from mysql

    Hi everyone,
    I am new to postgresql.
    I am planning to migrate our current database (mysql) to posgresql. I
    am currently having difficulties dealing with the order of the tables
    that is created.
    Here is what I do:
    1. I use myqsldump to get the schema and data.
    2. I use my2pg and a java utility I created to convert mysqldump to
    sql statement that is understood by postgresql.
    3. When populating the data to postgresql, it complained relation
    "xxx" doesn't exist. This is the case because the table that is
    refrenced has not been created.
    The quick fix to this will be to change the sequence of the tables
    that are created in such a way that tables that are being referenced
    are first created before referencing table.
    However, this is not practical if we have many tables.
    My questions is: is there a way to get around this? is it possible to
    disable checking for relation when creating a table that is
    referencing to other tables?
    I've searched around the internet and found somebody mentioning about
    disable-fk-verifications, but I got an error (something like invalid
    configuration parameters).
    I am currently using postgresql 7.4.6.

    Any ideas/suggestions is greatly appreciated.

    J

    ---------------------------(end of broadcast)---------------------------
    TIP 6: Have you searched our list archives?

    [url]http://archives.postgresql.org[/url]

    ---------------------------(end of broadcast)---------------------------
    TIP 6: Have you searched our list archives?

    [url]http://archives.postgresql.org[/url]

    Dann Corbit Guest

Posting Permissions

  • You may not post new threads
  • You may post replies
  • You may not post attachments
  • You may not edit your posts

1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139