Re: Loss of some parts of the function definition - Mailing list pgsql-hackers

From Pavel Stehule
Subject Re: Loss of some parts of the function definition
Date
Msg-id CAFj8pRA9XrWhdbzO1v7TuXNgTH=Oh=OZvpfQUNegE1D26sG2sQ@mail.gmail.com
Whole thread Raw
In response to Loss of some parts of the function definition  (Sergey Grinko <sergey.grinko@gmail.com>)
List pgsql-hackers
Hi

2015-04-30 13:44 GMT+02:00 Sergey Grinko <sergey.grinko@gmail.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.grinko@gmail.com

pgsql-hackers by date:

Previous
From: Robert Haas
Date:
Subject: Re: BRIN range operator class
Next
From: Robert Haas
Date:
Subject: Re: Use outerPlanState() consistently in executor code