Re: Porting from ORACLE to PostgSQL

From: Scott Marlowe <smarlowe(at)g2switchworks(dot)com>
To: gustavo halperin <ggh(dot)develop(at)gmail(dot)com>
Cc: pgsql general <pgsql-general(at)postgresql(dot)org>
Subject: Re: Porting from ORACLE to PostgSQL
Date: 2006-09-05 17:29:32
Message-ID: 1157477372.25225.5.camel@state.g2switchworks.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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.

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Scott Marlowe 2006-09-05 17:33:12 Re: Upgrade Postgres 8.1.2 to 8.1.4
Previous Message Zlatko Matić 2006-09-05 17:20:53 Re: Upgrade Postgres 8.1.2 to 8.1.4