Search Postgresql Archives

Re: newbie - postgresql or mysql

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



>>mysqldump --extended-insert=FALSE<<

Thanks for the help, this is allowing me to import the data now.

Regards,

Frank

At 09:37 AM 9/1/2005, Michael Fuhr wrote:
[Please copy the mailing list on replies so others can contribute
to and learn from the discussion.  Also, please don't top-post, as
it destroys the flow of the discussion; I've moved your questions
to a more logical place.]

On Wed, Aug 31, 2005 at 03:49:57PM -0600, aly.dharshi@xxxxxxxxx wrote:
> On Wed, 31 Aug 2005, Michael Fuhr wrote:
> >On Wed, Aug 31, 2005 at 03:17:29PM -0400, Frank wrote:
> >>>>insert  into category values
> >>>>(4, 'Hardware - Monitor', 2, '2004-10-12 10:50:01'),
> >>>>(5, 'Hardware - Printer', 2, '2004-10-12 10:50:02'),
> >>>>(6, 'Hardware - Terminal', 2, '2004-10-12 10:50:02'),
> >
> >PostgreSQL doesn't support this form of INSERT; you'll have to use
> >a separate INSERT per record or use COPY.  Another method, although
> >probably not useful in this case, is to insert records from a subquery;
> >see the INSERT documentation for more information.
>
> Wouldn't it be simpler to do a dblink, and just get the data from MySQL
> and drop it into PostgreSQL ? Or is this too complicated ?

dblink (at least the one distributed as contrib/dblink) is for
making connections to other PostgreSQL databases.  You could,
however, use DBI-Link or something similar to make connections to
MySQL or another data source; in that case you could use the subquery
form of INSERT:

INSERT INTO tablename (columnlist) SELECT columnlist FROM ... ;

However, if you're just doing a one-time import of data from MySQL,
then it might be simplest to dump the data with separate INSERT
statements (mysqldump --extended-insert=FALSE).

--
Michael Fuhr

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster



---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
      choose an index scan if your joining column's datatypes do not
      match

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux