From: | Michael Fuhr <mike(at)fuhr(dot)org> |
---|---|
To: | aly(dot)dharshi(at)telus(dot)net |
Cc: | pgsql-general(at)postgresql(dot)org |
Subject: | Re: newbie - postgresql or mysql |
Date: | 2005-09-01 13:37:39 |
Message-ID: | 20050901133739.GA27467@winnie.fuhr.org |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgsql-general |
[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(dot)dharshi(at)telus(dot)net 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
From | Date | Subject | |
---|---|---|---|
Next Message | Sebastian Hennebrueder | 2005-09-01 14:00:33 | Exception in Query when mixing explicit join and implicit join |
Previous Message | Kelly Burkhart | 2005-09-01 13:03:34 | Re: optimum settings for dedicated box |