Re: postgres cust types

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ramesh T <rameshparnanditech(at)gmail(dot)com>, "pgsql-general(at)postgresql(dot)org" <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres cust types
Date: 2015-02-03 14:57:06
Message-ID: 54D0E1C2.1000003@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/03/2015 04:49 AM, Ramesh T wrote:
> Hi ,
> i created type on postgres
> CREATE TYPE order_list AS (order_id bigint);
> it works fine.
>
> then, i try to create a other table type using above created type.
> like,
> --create or replace type suborder_list_table as table of suborder_list;
> this on *oracle *formate

The above makes no sense, you are using a different type.

>
> i need to convert *postgres *and how to create a table type in postgres
> is it possible

In Postgres tables already have a type, hence:

http://www.postgresql.org/docs/9.3/interactive/sql-createtype.html

"If a schema name is given then the type is created in the specified
schema. Otherwise it is created in the current schema. The type name
must be distinct from the name of any existing type or domain in the
same schema. (Because tables have associated data types, the type name
must also be distinct from the name of any existing table in the same
schema.)"

> or
> else any other method.
>
> FYI,i am using these types in a function.

Some explanation of exactly what you are trying to do, in other words
code, would be helpful.

>
> thanks in advance,
>
>
>

--
Adrian Klaver
adrian(dot)klaver(at)aklaver(dot)com

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message José Luis Tallón 2015-02-03 15:01:05 Re: Fwd: [GENERAL] 4B row limit for CLOB tables
Previous Message Adrian Klaver 2015-02-03 14:53:33 Re: dbmsscheduler