Re: Porting from ORACLE to PostgSQL - Mailing list pgsql-general

From Scott Marlowe
Subject Re: Porting from ORACLE to PostgSQL
Date
Msg-id 1157477372.25225.5.camel@state.g2switchworks.com
Whole thread Raw
In response to Porting from ORACLE to PostgSQL  (gustavo halperin <ggh.develop@gmail.com>)
List pgsql-general
On Mon, 2006-09-04 at 16:54, 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 ?

If you just need a simple solution, look up domains:

http://www.postgresql.org/docs/8.1/static/sql-createdomain.html

specifically:

create domain varchar2 as varchar;

Note that you won't have a precision argument on the varchar2, but you
can put one on the varchar you use during domain creation:

This works:

create domain varchar2 as varchar(200);
create table test (info varchar);

This doesn't:
create domain varchar2 as varchar;
create table test (info varchar(200));

But once the tables are created, insert statements and such should work
normally.

pgsql-general by date:

Previous
From: Zlatko Matić
Date:
Subject: Re: Upgrade Postgres 8.1.2 to 8.1.4
Next
From: Scott Marlowe
Date:
Subject: Re: Upgrade Postgres 8.1.2 to 8.1.4