Re: Ora2Pg (was PL/pgSQL: EXCEPTION NOSAVEPOINT)

From: Matt Miller <mattm(at)epx(dot)com>
To: josh(at)agliodbs(dot)com
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Ora2Pg (was PL/pgSQL: EXCEPTION NOSAVEPOINT)
Date: 2005-09-02 21:09:01
Message-ID: 1125695341.3076.56.camel@dbamm01-linux
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general pgsql-hackers pgsql-patches

On Fri, 2005-09-02 at 12:29 -0700, Josh Berkus wrote:
> > still trying to hold on to my fantasy that I can hack Postgres (and
> > contrib/ora2pg) into submission.
>
> I'm happy to work with you on ora2pg

Cool.

It looks like I should have referred to contrib/oracle, not
contrib/ora2pg, but you got my point.

The latest version I found of ora2pg is at
http://www.samse.fr/GPL/ora2pg/ora2pg-3.3.tar.gz This seems to be more
recent than the version at contrib/oracle. For example, this newer
version has tablespace support. Given this as a starting point, I've
made the attached changes. Mostly I've added a few new config options,
but I also made a correction to the existing EXCLUDE option, and I
corrected a couple spelling/English errors along the way.

A big thing that's lacking is conversion for stored procedures and
functions. My initial approach to this was to use Perl to post-process
the PL/SQL code dumped by the export, making it look more like proper
Pl/pgSQL (e.g. VARCHAR2->VARCHAR). I'm no Perl hacker, and when I came
across significant PL/SQL <--> PL/pgSQL differences (e.g. PL/pgSQL
exception == rollback), I added to my approach the idea of hacking
PL/pgSQL to make it look more like PL/SQL. Attacking the problem from
both ends like this, I imagined that Nirvana would be reached somewhere
in the middle.

The beginning of my Perl-based attempt to convert PL/SQL into PL/pgSQL
is a pretty simple stand-alone script. I can send it if you like, but
I'm a Perl newbie, so you can probably do much better. My attempts to
make PL/pgSQL look like PL/SQL have been posted to -hackers and -patches
over the last couple months.

Attachment Content-Type Size
ora2pg.patch text/x-patch 16.0 KB

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Michael Fuhr 2005-09-02 21:15:35 Re: Check if SELECT is granted
Previous Message Alvaro Herrera 2005-09-02 21:01:51 Re: Trouble with bytea in SPI...

Browse pgsql-hackers by date

  From Date Subject
Next Message Tom Lane 2005-09-02 21:16:09 Re: Remove xmin and cmin from frozen tuples
Previous Message Bruce Momjian 2005-09-02 21:08:54 Re: Remove xmin and cmin from frozen tuples

Browse pgsql-patches by date

  From Date Subject
Next Message Bruce Momjian 2005-09-02 21:55:42 Re: statement logging / extended query protocol issues
Previous Message Bruce Momjian 2005-09-02 21:01:01 Re: postgresql.conf listen_address comment clarification