Re: newbie - postgresql or mysql

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: Frank <farocco(at)verizon(dot)net>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: newbie - postgresql or mysql
Date: 2005-08-31 19:49:39
Message-ID: 1125517779.28179.149.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On Wed, 2005-08-31 at 14:17, Frank wrote:
> Thanks for clearing up some confusion.
>
> >>Look in the contrib/mysql directory in the source file (or install the
> contrib packages for your system, assuming they come with that contrib
> package<<

It comes with the postgresql tar ball. just download it from the
www.postgresql.org site and untar it somewhere. then cd into the
postgresql-x.y.z/contrib/mysql directory, where x.y.z is the version of
postgresql you downloaded.

>
> I do not have that, where can I download it?
>
> This fails to insert records
>
> > > 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'),
> > > (7, 'Hardware - PC Laptop', 2, '2004-10-12 10:50:02'),
> > > (9, 'Hardware - Misc.', 1, '2004-10-12 10:51:00'),
> > > (10, 'Hardware - PC Desktop', 2, '2004-10-12 10:50:03'),
> > > (11, 'Software - PC', 2, '2004-10-12 10:50:03'),
> > > (13, 'Software - Network', 2, '2004-10-12 10:50:04'),
> > > (14, 'Software - Midrange, AS/400', 2, '2004-10-12 10:50:04'),
> > > (15, 'Software - Server', 2, '2004-10-12 10:50:04'),
> > > (16, 'Hardware - Wyse Terminal', 2, '2004-10-12 10:50:05');

Yeah, you'll have to do it like:

insert into table values (....
insert into table values (....
insert into table values (....
insert into table values (....
insert into table values (....

If you've got a lot to do (more than a few dozen) wrap them in one big
transaction with begin end:

begin;
insert into table values (....
insert into table values (....
insert into table values (....
insert into table values (....
insert into table values (....
commit;

Note that any errors in the import with begin/end wrapped around it
means the whole import fails. which is a good thing (tm) since you
don't have to figuring out which rows made it in and which didn't. Fix
the error and try the whole being;insertX1000;commit again.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Brian Wong 2005-08-31 19:54:13 Re: newbie - postgresql or mysql
Previous Message Jim C. Nasby 2005-08-31 19:44:54 Re: newbie - postgresql or mysql