| From: | "Jim Buttafuoco" <jim(at)spectrumtelecorp(dot)com> |
|---|---|
| To: | Tom Lane <tgl(at)sss(dot)pgh(dot)pa(dot)us>, jim(at)contactbda(dot)com, pgsql-general(at)postgresql(dot)org |
| Subject: | Re: CREATE TYPE example needed |
| Date: | 2003-01-15 22:38:54 |
| Message-ID: | 200301152238.h0FMcsZ05873@contactbda.com |
| Views: | Whole Thread | Raw Message | Download mbox | Resend email |
| Thread: | |
| Lists: | pgsql-general |
Thanks for the answer Tom, I did want to write varchar2(n). Is this something special in the code? Could I somehow
muck with the system catalogs and copy varchar. The object of the execise is to have one set of SQL statements for both
Oracle and Postgres. I think it would help other people converting if we had the ability to handle Oracle table create
statements.
Thanks
Jim
> "Jim Buttafuoco" <jim(at)spectrumtelecorp(dot)com> writes:
> > I am looking for a way to create a VARCHAR2 (oracle) type so I can use the same SQL to create my tables in either Oracle
> > or Postgresql. Does anyone have a working example?
>
> In 7.3, it's easy to use a "domain" as a type alias.
>
> CREATE DOMAIN varchar2 AS varchar;
>
> This has the advantage that all the operations on varchar will work for
> varchar2. If you make a real type, you need to provide all those
> operations.
>
> Note however that this doesn't give you any special syntax for varchar2.
> If you're expecting to be able to write "varchar2(N)" you're still out
> of luck...
>
> regards, tom lane
| From | Date | Subject | |
|---|---|---|---|
| Next Message | Tom Lane | 2003-01-15 22:50:33 | Re: CREATE TYPE example needed |
| Previous Message | Petre Scheie | 2003-01-15 22:17:40 | Re: [GENERAL] gmake check error on HPUX |