TYPE TABLE OF NUMBER

Started by utsavalmost 14 years ago6 messagesgeneral
Jump to latest
#1utsav
utsav.pshah@tcs.com

we are doing mgration activity form oracle to postgresql 9.1

How to convert this type :

ORACLE :

CREATE OR REPLACE TYPE "NUMBER_ARRAY" IS TABLE OF NUMBER

please let me know how we can achive this in postgresql

My understanding

POSTGRESQL :

CREATE TYPE "NUMBER_ARRAY" AS (arr int);

Appreciate any help !

--
View this message in context: http://postgresql.1045698.n5.nabble.com/TYPE-TABLE-OF-NUMBER-tp5710983.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#2Raghavendra
raghavendra.rao@enterprisedb.com
In reply to: utsav (#1)
Re: TYPE TABLE OF NUMBER

On Fri, Jun 1, 2012 at 9:18 PM, utsav <utsav.pshah@tcs.com> wrote:

we are doing mgration activity form oracle to postgresql 9.1

How to convert this type :

ORACLE :

CREATE OR REPLACE TYPE "NUMBER_ARRAY" IS TABLE OF NUMBER

please let me know how we can achive this in postgresql

My understanding

POSTGRESQL :

CREATE TYPE "NUMBER_ARRAY" AS (arr int);

Appreciate any help !

Does this helps ?
http://www.postgresql.org/docs/9.1/static/sql-createdomain.html

---
Regards,
Raghavendra
EnterpriseDB Corporation
Blog: http://raghavt.blogspot.com/

#3utsav
utsav.pshah@tcs.com
In reply to: Raghavendra (#2)
Re: TYPE TABLE OF NUMBER

No.. in this we have to define domain and than used it . Our requirenment is
like application pass the array of integer and that we have to use in
PostgreSQL functions.

--
View this message in context: http://postgresql.1045698.n5.nabble.com/TYPE-TABLE-OF-NUMBER-tp5710983p5711116.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#4Thomas Kellerer
spam_eater@gmx.net
In reply to: utsav (#3)
Re: TYPE TABLE OF NUMBER

utsav, 04.06.2012 07:00:

No.. in this we have to define domain and than used it . Our requirenment is
like application pass the array of integer and that we have to use in
PostgreSQL functions.

You can pass an array directly. There is no need to define an "array type" in PostgreSQL

#5utsav
utsav.pshah@tcs.com
In reply to: Thomas Kellerer (#4)
Re: TYPE TABLE OF NUMBER

Hi thomas .. Thanks for your help . I have done that thing . ]

It is working fine

--
View this message in context: http://postgresql.1045698.n5.nabble.com/TYPE-TABLE-OF-NUMBER-tp5710983p5711247.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

#6Igor Neyman
ineyman@perceptron.com
In reply to: utsav (#3)
Re: TYPE TABLE OF NUMBER

-----Original Message-----
From: utsav [mailto:utsav.pshah@tcs.com]
Sent: Monday, June 04, 2012 1:00 AM
To: pgsql-general@postgresql.org
Subject: Re: TYPE TABLE OF NUMBER

No.. in this we have to define domain and than used it . Our
requirenment is like application pass the array of integer and that we
have to use in PostgreSQL functions.

--
View this message in context:
http://postgresql.1045698.n5.nabble.com/TYPE-TABLE-OF-NUMBER-
tp5710983p5711116.html
Sent from the PostgreSQL - general mailing list archive at Nabble.com.

PostgreSQL has already "integer array" type: _int4 or _int2 (or whatever integer length you need).
No need to create new type.

Regards,
Igor Neyman