Unix Technical Forum

Porting from ORACLE to PostgSQL

This is a discussion on Porting from ORACLE to PostgSQL within the Pgsql General forums, part of the PostgreSQL category; --> Hello I need to porting many old ORACLE-oriented-SQL files and I have many problem with this code. Sometimes the ...


Go Back   Unix Technical Forum > Database Server Software > PostgreSQL > Pgsql General

Register FAQ Members List Calendar Search Today's Posts Mark Forums Read
  #1 (permalink)  
Old 04-09-2008, 11:17 AM
gustavo halperin
 
Posts: n/a
Default Porting from ORACLE to PostgSQL

Hello

I need to porting many old ORACLE-oriented-SQL files and I have many
problem with this code. Sometimes the code use some types not supported
in PosgSQL like "number" or "varchar2", there fore, can I write some
type of declaration (like in c : #define alias_name name) in order to
make PosgSQL recognize these types? Or there are other solution that you
recommend to use ?

Thank you, Gustavo

--
||\ // \
| \\ // |
I'm thinking. \ \\ l\\l_ // |
_ _ | \\/ `/ `.| |
/~\\ \ //~\ | Y | | || Y |
| \\ \ // | | \| | |\ / |
[ || || ] \ | o|o | > /
] Y || || Y [ \___\_--_ /_/__/
| \_|l,------.l|_/ | /.-\(____) /--.\
| >' `< | `--(______)----'
\ (/~`--____--'~\) / U// U / \
`-_>-__________-<_-' / \ / /|
/(_#(__)#_)\ ( .) / / ]
\___/__\___/ `.`' / [
/__`--'__\ |`-' |
/\(__,>-~~ __) | |__
/\//\\( `--~~ ) _l |--:.
'\/ <^\ /^> | ` ( < \\
_\ >-__-< /_ ,-\ ,-~~->. \ `:.___,/
(___\ /___) (____/ (____) `---'


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #2 (permalink)  
Old 04-09-2008, 11:17 AM
Joshua D. Drake
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL

gustavo halperin wrote:
> Hello
>
> I need to porting many old ORACLE-oriented-SQL files and I have many
> problem with this code. Sometimes the code use some types not supported
> in PosgSQL like "number" or "varchar2", there fore, can I write some
> type of declaration (like in c : #define alias_name name) in order to
> make PosgSQL recognize these types? Or there are other solution that you
> recommend to use ?
>


Look at the orafce project on www.pgfoundry.org. They have ALOT of
Oracle types (over 100).

Sincerely,

Joshua D. Drake


> Thank you, Gustavo
>



--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/



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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #3 (permalink)  
Old 04-09-2008, 11:17 AM
Chris Mair
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL


> I need to porting many old ORACLE-oriented-SQL files and I have many
> problem with this code. Sometimes the code use some types not supported
> in PosgSQL like "number" or "varchar2", there fore, can I write some
> type of declaration (like in c : #define alias_name name) in order to
> make PosgSQL recognize these types? Or there are other solution that you
> recommend to use ?


You might look into the contrib package "ora2pg".

There's also a more ambitious project called "protopg".
That's in pre-alpha state, though. A development snapshots
for the *very* *adventurous* can be obtained here:
http://protopg.projects.postgresql.org/nightlies/

Bye, Chris.


--

Chris Mair
http://www.1006.org


---------------------------(end of broadcast)---------------------------
TIP 4: Have you searched our list archives?

http://archives.postgresql.org

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #4 (permalink)  
Old 04-09-2008, 11:17 AM
gustavo halperin
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL

Chris Mair wrote:
>> I need to porting many old ORACLE-oriented-SQL files and I have many
>> problem with this code. Sometimes the code use some types not supported
>> in PosgSQL like "number" or "varchar2", there fore, can I write some
>> type of declaration (like in c : #define alias_name name) in order to
>> make PosgSQL recognize these types? Or there are other solution that you
>> recommend to use ?
>>

>
> You might look into the contrib package "ora2pg".
>
> There's also a more ambitious project called "protopg".
> That's in pre-alpha state, though. A development snapshots
> for the *very* *adventurous* can be obtained here:
> http://protopg.projects.postgresql.org/nightlies/
>
> Bye, Chris.
>

Thank you, but nothing work.
1. The orafce from www.pgfoundry.org doesn't pass the make step, is
looking for some files that doesn't exist, see below:
orafce : make
Makefile:16: ../../src/Makefile.global: No such file or directory
Makefile:17: /contrib/contrib-global.mk: No such file or directory
make: *** No rule to make target `/contrib/contrib-global.mk'. Stop.

2. ora2pg, looks like something that extract DB schemes from a running
oracle DB, but I have not ORACLE running. I just have old ORACLE/SQL
sources that I need parser to SQL or PostgSQL.

3. About the ambitious project "protopg", I success to compile this
projects but the parser fall. The parse have a problem with a word
"CONSTRAINT", see below:
protopg-20060905 : ./ora_parser < tes.sql
-- syntax error, unexpected "CONSTRAINT", expecting ORA_ID on line 6 --

-- BEGIN OF UNRECOGNIZED STATEMENT
CREATE TABLE v5templates . cmt_items ( item_id NUMBER ( 7 ) ,
template_id NUMBER ( 7 ) , page_title VARCHAR2 ( 100 ) , CONSTRAINT
pk_cmt PRIMARY KEY ( item_id ) ) ;
-- END OF UNRECOGNIZED STATEMENT

I will try debug it, or maybe send a mail to the developer/contacts.

Any way, thank very much, Gustavo

--
||\ // \
| \\ // |
I'm thinking. \ \\ l\\l_ // |
_ _ | \\/ `/ `.| |
/~\\ \ //~\ | Y | | || Y |
| \\ \ // | | \| | |\ / |
[ || || ] \ | o|o | > /
] Y || || Y [ \___\_--_ /_/__/
| \_|l,------.l|_/ | /.-\(____) /--.\
| >' `< | `--(______)----'
\ (/~`--____--'~\) / U// U / \
`-_>-__________-<_-' / \ / /|
/(_#(__)#_)\ ( .) / / ]
\___/__\___/ `.`' / [
/__`--'__\ |`-' |
/\(__,>-~~ __) | |__
/\//\\( `--~~ ) _l |--:.
'\/ <^\ /^> | ` ( < \\
_\ >-__-< /_ ,-\ ,-~~->. \ `:.___,/
(___\ /___) (____/ (____) `---'


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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #5 (permalink)  
Old 04-09-2008, 11:17 AM
Merlin Moncure
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL

On 9/5/06, gustavo halperin <ggh.develop@gmail.com> wrote:
> Chris Mair wrote:
> >> I need to porting many old ORACLE-oriented-SQL files and I have many
> >> problem with this code. Sometimes the code use some types not supported
> >> in PosgSQL like "number" or "varchar2", there fore, can I write some
> >> type of declaration (like in c : #define alias_name name) in order to
> >> make PosgSQL recognize these types? Or there are other solution that you
> >> recommend to use ?


don't the enterprisedb people specialize in oracle porting?

merlin

---------------------------(end of broadcast)---------------------------
TIP 2: Don't 'kill -9' the postmaster

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #6 (permalink)  
Old 04-09-2008, 11:17 AM
Joshua D. Drake
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL


>> Bye, Chris.

> Thank you, but nothing work.
> 1. The orafce from www.pgfoundry.org doesn't pass the make step, is
> looking for some files that doesn't exist, see below:
> orafce : make
> Makefile:16: ../../src/Makefile.global: No such file or directory
> Makefile:17: /contrib/contrib-global.mk: No such file or directory
> make: *** No rule to make target `/contrib/contrib-global.mk'. Stop.



It is designed to be built from the postgresql source tree. If you have
a postgresql source tree put the orafce directory in contrib and try again.

Sincerely,

Joshua D. Drake

>
> 2. ora2pg, looks like something that extract DB schemes from a running
> oracle DB, but I have not ORACLE running. I just have old ORACLE/SQL
> sources that I need parser to SQL or PostgSQL.
>
> 3. About the ambitious project "protopg", I success to compile this
> projects but the parser fall. The parse have a problem with a word
> "CONSTRAINT", see below:
> protopg-20060905 : ./ora_parser < tes.sql
> -- syntax error, unexpected "CONSTRAINT", expecting ORA_ID on line 6 --
>
> -- BEGIN OF UNRECOGNIZED STATEMENT
> CREATE TABLE v5templates . cmt_items ( item_id NUMBER ( 7 ) ,
> template_id NUMBER ( 7 ) , page_title VARCHAR2 ( 100 ) , CONSTRAINT
> pk_cmt PRIMARY KEY ( item_id ) ) ;
> -- END OF UNRECOGNIZED STATEMENT
>
> I will try debug it, or maybe send a mail to the developer/contacts.
>
> Any way, thank very much, Gustavo
>



--

=== The PostgreSQL Company: Command Prompt, Inc. ===
Sales/Support: +1.503.667.4564 || 24x7/Emergency: +1.800.492.2240
Providing the most comprehensive PostgreSQL solutions since 1997
http://www.commandprompt.com/



---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #7 (permalink)  
Old 04-09-2008, 11:17 AM
Tom Lane
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL

gustavo halperin <ggh.develop@gmail.com> writes:
> 1. The orafce from www.pgfoundry.org doesn't pass the make step, is
> looking for some files that doesn't exist, see below:
> orafce : make
> Makefile:16: ../../src/Makefile.global: No such file or directory
> Makefile:17: /contrib/contrib-global.mk: No such file or directory
> make: *** No rule to make target `/contrib/contrib-global.mk'. Stop.


It looks like it's expecting to be built inside the contrib directory of
a configured Postgres source tree. If you have a version that knows
about pgxs you can build it outside the source tree with

make USE_PGXS=1

regards, tom lane

---------------------------(end of broadcast)---------------------------
TIP 9: In versions below 8.0, the planner will ignore your desire to
choose an index scan if your joining column's datatypes do not
match

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #8 (permalink)  
Old 04-09-2008, 11:17 AM
chrisnospam@1006.org
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL

> 3. About the ambitious project "protopg", I success to compile this
> projects but the parser fall. The parse have a problem with a word
> "CONSTRAINT", see below:
> protopg-20060905 : ./ora_parser < tes.sql
> -- syntax error, unexpected "CONSTRAINT", expecting ORA_ID on line 6
> --
>
> -- BEGIN OF UNRECOGNIZED STATEMENT
> CREATE TABLE v5templates . cmt_items ( item_id NUMBER ( 7 ) ,
> template_id NUMBER ( 7 ) , page_title VARCHAR2 ( 100 ) , CONSTRAINT
> pk_cmt PRIMARY KEY ( item_id ) ) ;
> -- END OF UNRECOGNIZED STATEMENT
>
> I will try debug it, or maybe send a mail to the developer/contacts.


That would be me

Protopg knows only a small part of Oracle Syntax. It's origins are
a academic background were we had one sample DB and were looking
how far we got in translating that one. If you throw random Oracle
DBs at it, it will likely stumble over some pieces. Nonetheless it
might be partially helpful.

If you like it, subscribe to
http://pgfoundry.org/mailman/listinf...opg-developers

If nothing else, when we put out some prerelease, it would be
cool if you could help us testing it with your test case


Bye, Chris.


--

Chris Mair
http://www.1006.org






---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #9 (permalink)  
Old 04-09-2008, 11:17 AM
codeWarrior
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL

Perhaps you should look at EnterpriseDB -- It's an Oracle-compliant wrapper
for postgreSQL....




"gustavo halperin" <ggh.develop@gmail.com> wrote in message
news:44FCA0A7.5080100@gmail.com...
> Hello
>
> I need to porting many old ORACLE-oriented-SQL files and I have many
> problem with this code. Sometimes the code use some types not supported in
> PosgSQL like "number" or "varchar2", there fore, can I write some type of
> declaration (like in c : #define alias_name name) in order to make PosgSQL
> recognize these types? Or there are other solution that you recommend to
> use ?
>
> Thank you, Gustavo
>
> --
> ||\ // \
> | \\ // | I'm thinking.
> \ \\ l\\l_ // |
> _ _ | \\/ `/ `.| |
> /~\\ \ //~\ | Y | | || Y |
> | \\ \ // | | \| | |\ / |
> [ || || ] \ | o|o | > /
> ] Y || || Y [ \___\_--_ /_/__/
> | \_|l,------.l|_/ | /.-\(____) /--.\
> | >' `< | `--(______)----'
> \ (/~`--____--'~\) / U// U / \
> `-_>-__________-<_-' / \ / /|
> /(_#(__)#_)\ ( .) / / ]
> \___/__\___/ `.`' / [
> /__`--'__\ |`-' |
> /\(__,>-~~ __) | |__
> /\//\\( `--~~ ) _l |--:.
> '\/ <^\ /^> | ` ( < \\
> _\ >-__-< /_ ,-\ ,-~~->. \ `:.___,/
> (___\ /___) (____/ (____) `---'
>
>
> ---------------------------(end of broadcast)---------------------------
> TIP 4: Have you searched our list archives?
>
> http://archives.postgresql.org
>



Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
Reply With Quote
  #10 (permalink)  
Old 04-09-2008, 11:17 AM
Ron Johnson
 
Posts: n/a
Default Re: Porting from ORACLE to PostgSQL

-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

Eliminating 21 line .signatures would be nice, too.

codeWarrior wrote:
> Perhaps you should look at EnterpriseDB -- It's an Oracle-compliant wrapper
> for postgreSQL....
>
>
>
>
> "gustavo halperin" <ggh.develop@gmail.com> wrote in message
> news:44FCA0A7.5080100@gmail.com...
>> Hello
>>
>> I need to porting many old ORACLE-oriented-SQL files and I have many
>> problem with this code. Sometimes the code use some types not supported in
>> PosgSQL like "number" or "varchar2", there fore, can I write some type of
>> declaration (like in c : #define alias_name name) in order to make PosgSQL
>> recognize these types? Or there are other solution that you recommend to
>> use ?
>>
>> Thank you, Gustavo


- --
Ron Johnson, Jr.
Jefferson LA USA

Is "common sense" really valid?
For example, it is "common sense" to white-power racists that
whites are superior to blacks, and that those with brown skins
are mud people.
However, that "common sense" is obviously wrong.
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.5 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFE/aQWS9HxQb37XmcRArJVAKCNjKPIGC0dZKCZNgZBTz9wdYl7nQC fYZFU
etqDdW8rRm+gXShS1iF3Nq8=
=g+pL
-----END PGP SIGNATURE-----

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

Digg this Post!Add Post to del.icio.usBookmark Post in TechnoratiFurl this Post!
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
Trackbacks are On
Pingbacks are On
Refbacks are On
Forum Jump


All times are GMT. The time now is 12:42 AM.


Powered by vBulletin® Version 3.6.5
Copyright ©2000 - 2008, Jelsoft Enterprises Ltd.
SEO by vBSEO 3.2.0
www.UnixAdminTalk.com