dbTalk Databases Forums  

Re: [BUGS] Two small patches to improve dbf2pg - attachments

mailing.database.pgsql-bugs mailing.database.pgsql-bugs


Discuss Re: [BUGS] Two small patches to improve dbf2pg - attachments in the mailing.database.pgsql-bugs forum.



Reply
 
Thread Tools Display Modes
  #1  
Old   
Martin Pitt
 
Posts: n/a

Default Re: [BUGS] Two small patches to improve dbf2pg - attachments - 10-06-2005 , 01:43 PM







--ABTtc+pdwF7KHXCz
Content-Type: multipart/mixed; boundary="IiVenqGWf+H9Y6IX"
Content-Disposition: inline


--IiVenqGWf+H9Y6IX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: inline
Content-Transfer-Encoding: quoted-printable

Hi again,

Martin Pitt [2005-10-06 20:34 +0200]:
Quote:
A long time ago some Debian user sent me two patches to improve the
dbf2pg conversion tool (in contrib). These are applied in the Debian
packages for quite a while now without any problems. I forwarded them
here some time ago already, but just let's try again. :-)
*cough* I forgot the attachments, as usual. Sorry.

Martin


--=20
Martin Pitt http://www.piware.de
Ubuntu Developer http://www.ubuntu.com
Debian Developer http://www.debian.org

In a world without walls and fences, who needs Windows and Gates?

--IiVenqGWf+H9Y6IX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="52-contrib-dbf2pg-errorcheck.patch"
Content-Transfer-Encoding: quoted-printable

diff -ruN postgresql-8.1.1-old/contrib/dbase/dbf2pg.c postgresql-8.1.1/cont=
rib/dbase/dbf2pg.c
--- postgresql-8.1.1-old/contrib/dbase/dbf2pg.c 2004-09-14 05:28:28.1000000=
00 +0200
+++ postgresql-8.1.1/contrib/dbase/dbf2pg.c 2005-02-11 17:06:24.193256800 +=
0100
@@ -335,7 +335,10 @@
printf("%s\n", query);
}
=20
- if ((res =3D PQexec(conn, query)) =3D=3D NULL)
+ if ((res =3D PQexec(conn, query)) =3D=3D NULL ||
+ PQresultStatus(res) =3D=3D PGRES_BAD_RESPONSE ||
+ PQresultStatus(res) =3D=3D PGRES_NONFATAL_ERROR ||
+ PQresultStatus(res) =3D=3D PGRES_FATAL_ERROR)
{
fprintf(stderr, "Error creating table!\n");
fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));
@@ -429,7 +432,10 @@
}
sprintf(query, "COPY %s FROM stdin", table);
res =3D PQexec(conn, query);
- if (res =3D=3D NULL)
+ if (res =3D=3D NULL ||
+ PQresultStatus(res)=3D=3DPGRES_BAD_RESPONSE ||
+ PQresultStatus(res)=3D=3DPGRES_NONFATAL_ERROR ||
+ PQresultStatus(res)=3D=3DPGRES_FATAL_ERROR)
{
fprintf(stderr, "Error starting COPY!\n");
fprintf(stderr, "Detailed report: %s\n", PQerrorMessage(conn));

--IiVenqGWf+H9Y6IX
Content-Type: text/plain; charset=us-ascii
Content-Disposition: attachment; filename="53-contrib-dbf2pg-textfield.patch"
Content-Transfer-Encoding: quoted-printable

diff -ruN postgresql-8.1.1-old/contrib/dbase/dbf2pg.c postgresql-8.1.1/cont=
rib/dbase/dbf2pg.c
--- postgresql-8.1.1-old/contrib/dbase/dbf2pg.c 2005-02-11 17:07:17.9280870=
00 +0100
+++ postgresql-8.1.1/contrib/dbase/dbf2pg.c 2005-02-11 17:07:35.127473160 +=
0100
@@ -324,6 +324,10 @@
case 'L':
strcat(query, " char");
break;
+
+ case 'M':
+ strcat(query, " text");
+ break;
}
}
=20

--IiVenqGWf+H9Y6IX--

--ABTtc+pdwF7KHXCz
Content-Type: application/pgp-signature; name="signature.asc"
Content-Description: Digital signature
Content-Disposition: inline

-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.1 (GNU/Linux)

iD8DBQFDRW8tDecnbV4Fd/IRApGUAKDIOszRFU8X+7kKL0wlFMspklptnQCgh905
ODB/Orumjy1+WpwFWnbE0AA=
=TTE8
-----END PGP SIGNATURE-----

--ABTtc+pdwF7KHXCz--


Reply With Quote
Reply




Thread Tools
Display Modes

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off



Powered by vBulletin Version 3.5.3
Copyright ©2000 - 2012, Jelsoft Enterprises Ltd.