Re: postgres cust types

From: Adrian Klaver <adrian(dot)klaver(at)aklaver(dot)com>
To: Ramesh T <rameshparnanditech(at)gmail(dot)com>
Cc: pgsql-general <pgsql-general(at)postgresql(dot)org>
Subject: Re: postgres cust types
Date: 2015-02-03 18:19:07
Message-ID: 54D1111B.8030309@aklaver.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 02/03/2015 07:50 AM, Ramesh T wrote:

Am CCing the list.

> CREATE TYPE order_list AS (order_id bigint);
> i created above type

Not sure that the above does anything.

>
> and i am using order_list, trying creating table type (datatype)
>
> *create or replace type order_list_table as table of order_list;*
>
> it is in oracle formate i need to convert this into postgres type.
>
>
> why because i am using order_list_table in function to gather setof
> values return by function.

Except in the below you are using another type?

>
> sample program ,
> create or replace FUNCTION choose(
> id1 IN bigint,
> id2 IN bigint,
> id3 IN character(2))
> RETURNS suborder_list_table
> IS
> v_ret suborder_list_table;
>
>
> here i'm using v_ret for return set of values to return..

Not sure what you are trying to do. Might want to take a look at:

http://www.postgresql.org/docs/9.3/interactive/plpgsql-declarations.html#PLPGSQL-DECLARATION-PARAMETERS

In particular the RETURNS TABLE example.

>
>

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

In response to

Browse pgsql-general by date

  From Date Subject
Next Message Adam Hooper 2015-02-03 19:17:03 Re: VACUUM FULL pg_largeobject without (much) downtime?
Previous Message Bill Moran 2015-02-03 17:58:11 Re: VACUUM FULL pg_largeobject without (much) downtime?