Re: Loss of some parts of the function definition

From: Pavel Stehule <pavel(dot)stehule(at)gmail(dot)com>
To: Sergey Grinko <sergey(dot)grinko(at)gmail(dot)com>
Cc: PostgreSQL Hackers <pgsql-hackers(at)postgresql(dot)org>
Subject: Re: Loss of some parts of the function definition
Date: 2015-04-30 12:46:13
Message-ID: CAFj8pRA9XrWhdbzO1v7TuXNgTH=Oh=OZvpfQUNegE1D26sG2sQ@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

Hi

2015-04-30 13:44 GMT+02:00 Sergey Grinko <sergey(dot)grinko(at)gmail(dot)com>:

> Hi,
>
> Dear developers, I have a request to you.
>
> Now create a script in the application of its function parameters and
> return values can be declared using %TYPE.
> However, when you save the script is stored inside the server only what is
> considered his body. Thus, we obtain:
> 1) loss of the custom formatting.
> 2) loss of communication parameters and return types with these types of
> fields to create the function.
> 3) multidimensional arrays are transformed into one-dimensional: [][] -> []
> 4) loss of data accuracy: numeric(n,m) -> numeric
>
> Please - how to save and restore the entire text of the definition to
> CREATE END; unchanged.
>

I am afraid, it is not possible

Postgres doesn't distinguish between multidimensional and one dimensional
arrays - multidimensional is just syntax suger, same is function arguments
- Postgres doesn't store precision for parameters. type%TYPE is translated
to target type outside plpgsql function. These informations are not saved,
so you cannot to take it from PostgreSQL

Regards

Pavel Stehule

>
>
> --
> Yours faithfully, Sergey Grinko
> Email: sergey(dot)grinko(at)gmail(dot)com
>

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Robert Haas 2015-04-30 12:46:55 Re: Use outerPlanState() consistently in executor code
Previous Message Robert Haas 2015-04-30 12:41:31 Re: BRIN range operator class