contrib dbf2sql.pl

Lists: pgsql-patches
From: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
To: pgsql-patches(at)postgresql(dot)org
Subject: contrib dbf2sql.pl
Date: 2005-03-03 01:15:44
Message-ID: 1109812544.19684.4.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Hello,

Here is a contrib to translate xBase-style .dbf-files to SQL.

Manuel.

Attachment Content-Type Size
dbf2sql.pl application/x-perl 1.8 KB
README.dbf2sql.pl.7 text/x-readme 589 bytes

From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-23 05:53:56
Message-ID: 200503230553.j2N5ruO06950@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches


How is this better than /contrib/dbase tools?

---------------------------------------------------------------------------

Manuel Baena Garca wrote:
> Hello,
>
> Here is a contrib to translate xBase-style .dbf-files to SQL.
>
> Manuel.

[ Attachment, skipping... ]

[ Attachment, skipping... ]

>
> ---------------------------(end of broadcast)---------------------------
> TIP 8: explain analyze is your friend

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-23 11:15:16
Message-ID: 1111576517.8750.17.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

- It solve problems with numeric columns.
http://archives.postgresql.org/pgsql-novice/2005-01/msg00246.php
http://archives.postgresql.org/pgsql-general/2005-01/msg01382.php
- The output is in SQL.

El mié, 23-03-2005 a las 00:53 -0500, Bruce Momjian escribió:
> How is this better than /contrib/dbase tools?
>
> ---------------------------------------------------------------------------
>
> Manuel Baena Garca wrote:
> > Hello,
> >
> > Here is a contrib to translate xBase-style .dbf-files to SQL.
> >
> > Manuel.
>
> [ Attachment, skipping... ]
>
> [ Attachment, skipping... ]
>
> >
> > ---------------------------(end of broadcast)---------------------------
> > TIP 8: explain analyze is your friend
>
--
Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-23 15:40:53
Message-ID: 200503231540.j2NFer028085@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Manuel Baena Garca wrote:
> - It solve problems with numeric columns.
> http://archives.postgresql.org/pgsql-novice/2005-01/msg00246.php
> http://archives.postgresql.org/pgsql-general/2005-01/msg01382.php
> - The output is in SQL.

Uh, can't you just fix the existing version rather than make a new
program?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-23 21:23:30
Message-ID: 1111613010.8763.19.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

ok, It's more difficult to fix the existing version. I don't want to do
a new library. I just use the perl module DBD-XBase rather than rewrite
a library (contrib/dbase/dbf.c). Also, dbf2sql is a perl program... you
can to adapt it to your needs easily.

El mié, 23-03-2005 a las 10:40 -0500, Bruce Momjian escribió:
> Uh, can't you just fix the existing version rather than make a new
> program?
>
--
Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-23 22:07:21
Message-ID: 200503232207.j2NM7LG19488@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Manuel Baena Garca wrote:
> ok, It's more difficult to fix the existing version. I don't want to do
> a new library. I just use the perl module DBD-XBase rather than rewrite
> a library (contrib/dbase/dbf.c). Also, dbf2sql is a perl program... you
> can to adapt it to your needs easily.

Are you saying your script has all the functionality of dbf2pg.c? It
doesn't seem possible.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-24 13:00:33
Message-ID: 1111669233.8778.10.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

El mié, 23-03-2005 a las 17:07 -0500, Bruce Momjian escribió:
> Are you saying your script has all the functionality of dbf2pg.c? It
> doesn't seem possible.

No, I'm not saying it. By example, my script doesn't connect to a pg db,
I prefer to use a pipe. My script has the same objective by a different
way: "do it as simple as you can".
--
Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-24 18:32:49
Message-ID: 200503241832.j2OIWnR25473@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Manuel Baena Garca wrote:
> El mi?, 23-03-2005 a las 17:07 -0500, Bruce Momjian escribi?:
> > Are you saying your script has all the functionality of dbf2pg.c? It
> > doesn't seem possible.
>
> No, I'm not saying it. By example, my script doesn't connect to a pg db,
> I prefer to use a pipe. My script has the same objective by a different
> way: "do it as simple as you can".

It just seems confusing to give to other users. I would prefer to have
all the needed functionality in our existing C program.

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
To: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-28 05:06:37
Message-ID: 200503280506.j2S56bk13346@candle.pha.pa.us
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Manuel Baena Garca wrote:
> El mi?, 23-03-2005 a las 17:07 -0500, Bruce Momjian escribi?:
> > Are you saying your script has all the functionality of dbf2pg.c? It
> > doesn't seem possible.
>
> No, I'm not saying it. By example, my script doesn't connect to a pg db,
> I prefer to use a pipe. My script has the same objective by a different
> way: "do it as simple as you can".

It might be simple to code, but having a second program is not simpler
for end-users. We have had no one else complain about xbase conversion
so I am not inclined to add a second program, especially since you did
not say what your program fixes that the current one does not.

Can you show us exactly what input causes our current code to fail, and
explain why someone with C knowledge can't fix it?

--
Bruce Momjian | http://candle.pha.pa.us
pgman(at)candle(dot)pha(dot)pa(dot)us | (610) 359-1001
+ If your life is a hard drive, | 13 Roberts Road
+ Christ can be your backup. | Newtown Square, Pennsylvania 19073


From: Manuel Baena García <mbaena(at)lcc(dot)uma(dot)es>
To: Bruce Momjian <pgman(at)candle(dot)pha(dot)pa(dot)us>
Cc: pgsql-patches(at)postgresql(dot)org
Subject: Re: contrib dbf2sql.pl
Date: 2005-03-31 02:20:50
Message-ID: 1112235651.31089.21.camel@localhost.localdomain
Views: Raw Message | Whole Thread | Download mbox | Resend email
Lists: pgsql-patches

Your current code is caused to fail by the next inputs:
- when the data has null number values.

You can probe it with the examples in:
http://www.clicketyclick.dk/databases/xbase/index.shtml.en

Now I have a new version of dbf2sql with some bug fixed:
- Support MEMO fields.
- Support Float Point fields.
- Exclude deleted records.
- Replace ' with \' in strings.
- do all inserts in one transaction.

And my script support all examples of above url.

My program fixes that the current one does not.

El lun, 28-03-2005 a las 00:06 -0500, Bruce Momjian escribió:
> Manuel Baena Garca wrote:
> > El mi?, 23-03-2005 a las 17:07 -0500, Bruce Momjian escribi?:
> > > Are you saying your script has all the functionality of dbf2pg.c? It
> > > doesn't seem possible.
> >
> > No, I'm not saying it. By example, my script doesn't connect to a pg db,
> > I prefer to use a pipe. My script has the same objective by a different
> > way: "do it as simple as you can".
>
> It might be simple to code, but having a second program is not simpler
> for end-users. We have had no one else complain about xbase conversion
> so I am not inclined to add a second program, especially since you did
> not say what your program fixes that the current one does not.
>
> Can you show us exactly what input causes our current code to fail, and
> explain why someone with C knowledge can't fix it?
>

Attachment Content-Type Size
dbf2sql.pl application/x-perl 2.2 KB
dbf2sql.pl.7 text/plain 589 bytes