pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
CREATE TYPE VARCHAR2
2+ messages / 2 participants
[nested] [flat]

* CREATE TYPE VARCHAR2
@ 2004-08-23 17:08  Sascha Ziemann <ziemann@secunet.de>
  0 siblings, 1 reply; 2+ messages in thread

From: Sascha Ziemann @ 2004-08-23 17:08 UTC (permalink / raw)
  To: pgsql-sql

Hi,

I try to emulate with PostgreSQL an Oracle database.  My problem is
that PostgreSQL does not support any Oracle specific types.
PostgreSQL provides the TEXT and Oracle uses the CLOB or VARCHAR2
type.  I would like to use the CREATE TYPE statement to tell
PostgreSQL about the Oracle types, but the documentation does not
describe how to define a simple alias type.  I would like to define a
new type VARCHAR2 which should behave exactly like VARCHAR.  Is this
possible with PostgreSQL?  By this it would be possible to run the
Oracle create table scripts without modification.

cu Sascha

-- 
secunet Security Networks AG, Im Teelbruch 116, 45219 Essen
Tel: +49-2054-123-408   Fax: +49-2054-123-123
PGP: FBE2 A49B 6526 C1B4 7F10  24E4 5004 7C27 6E9A 9698

Besuchen Sie uns auf der DMS-Expo vom 07. - 09. September 2004 in
Essen, Halle 2, Stand 2435 c/d (Consulting Corner).




^ permalink  raw  reply  [nested|flat] 2+ messages in thread

* Re: CREATE TYPE VARCHAR2
@ 2004-08-26 02:07  Tom Lane <tgl@sss.pgh.pa.us>
  parent: Sascha Ziemann <ziemann@secunet.de>
  0 siblings, 0 replies; 2+ messages in thread

From: Tom Lane @ 2004-08-26 02:07 UTC (permalink / raw)
  To: Sascha Ziemann <ziemann@secunet.de>; +Cc: pgsql-sql

Sascha Ziemann <ziemann@secunet.de> writes:
> I would like to define a
> new type VARCHAR2 which should behave exactly like VARCHAR.

You could get about halfway there with 
	CREATE DOMAIN varchar2 AS varchar;
But it's only halfway because the domain will not accept length
decorations; that is "varchar2(100)" will not work.

			regards, tom lane



^ permalink  raw  reply  [nested|flat] 2+ messages in thread


end of thread, other threads:[~2004-08-26 02:07 UTC | newest]

Thread overview: 2+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2004-08-23 17:08 CREATE TYPE VARCHAR2 Sascha Ziemann <ziemann@secunet.de>
2004-08-26 02:07 ` Tom Lane <tgl@sss.pgh.pa.us>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox