Re: proposal: plpgsql, solution for derivated types of parameters

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: proposal: plpgsql, solution for derivated types of parameters
Date: 2010-10-08 07:26:45
Message-ID: AANLkTikZWwhS=dpTmSE9DbAOL-C2mmGxqyDJeVKFJkt+@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

2010/10/8 Itagaki Takahiro <itagaki(dot)takahiro(at)gmail(dot)com>:
> On Fri, Oct 8, 2010 at 3:08 PM, Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com> wrote:
>> I propose a following syntax:
>>
>> -- variable as element of some array
>> DECLARE elementvar IS ELEMENT OF arrayvar;
>> DECLARE elementvar IS ELEMENT OF arrayvar%type
>>
>> -- variable as array of some variable
>> DECLARE arrayvar IS ARRAY OF varname;
>> DECLARE arrayvar IS ARRAY OF varname%type
>>
>> This proposal doesn't introduce any new reserved keywords.
>
> FYI, Oracle PL/SQL supports type declaration and array
> variables are declare as the type.
>
>  DECLARE
>    TYPE array_type_name IS {VARRAY | VARYING ARRAY} (size_limit)
>      OF element_type [NOT NULL];
>    a1 array_type_name;
>
> "IS ARRAY OF" syntax is similar enough to PL/SQL, but is not compatible.

it is compatible, but used in different place (clause).

>
> I'm not sure whether PL/SQL has "IS ELEMENT OF" variants.
>

yes, it is inspiration. I think so we can use this pattern because
plpgsql cannot to declare a local type. IS ELEMENT OF isn't supported
by Oracle. But Oracle must not solve this problem, because it doesn't
support a polymorphic types.

Pavel

> --
> Itagaki Takahiro
>

In response to

Browse pgsql-hackers by date

  From Date Subject
Next Message Markus Wanner 2010-10-08 07:46:46 Re: Issues with Quorum Commit
Previous Message Dimitri Fontaine 2010-10-08 07:19:02 Re: leaky views, yet again