From: | Khushboo Vashi <khushboo(dot)vashi(at)enterprisedb(dot)com> |
---|---|
To: | Dave Page <dpage(at)pgadmin(dot)org> |
Cc: | pgadmin-hackers <pgadmin-hackers(at)postgresql(dot)org> |
Subject: | Re: [pgAdmin4][Patch]: Functions/Procedures Module |
Date: | 2016-03-22 10:51:01 |
Message-ID: | CAFOhELeZJvNT0VXmq-CQFSruH8fOK9tt45AGSKMzJcQ6HX53eg@mail.gmail.com |
Views: | Raw Message | Whole Thread | Download mbox | Resend email |
Thread: | |
Lists: | pgadmin-hackers |
Hi,
Please find updated Patch for the Functions/Procedures Module.
On Fri, Mar 11, 2016 at 10:17 PM, Dave Page <dpage(at)pgadmin(dot)org> wrote:
> Hi
>
> On Fri, Mar 11, 2016 at 9:34 AM, Khushboo Vashi
> <khushboo(dot)vashi(at)enterprisedb(dot)com> wrote:
> > Hi,
> >
> > Please find attached patch for the Functions/Procedures Module.
> >
> > To test this patch, "Unique collection Control and Variable Control
> Fixes"
> > Patch submitted by me needs to be applied first.
>
> Hi,
>
> This is looking pretty good. I did a little bit of cleanup of the SQL
> formatting, however I think a little more is needed;
>
> - When creating a function, we might get the following:
>
> =====
> CREATE FUNCTION pem.whee(INOUT foo bigint DEFAULT 123) RETURNS bigint AS
> $BODY$SELECT $1;$BODY$
> LANGUAGE 'sql' NOT LEAKPROOF
>
> SET backslash_quote='on';
>
>
> ALTER FUNCTION pem.whee(INOUT foo bigint )
> OWNER TO postgres;
>
> GRANT ALL ON FUNCTION pem.whee(INOUT foo bigint ) TO pem_user;
>
>
> COMMENT ON FUNCTION pem.whee(INOUT foo bigint )
> IS 'whee func';
> =====
>
> - Remove the spaces after the argument lists, before the )
>
Done
> - Remove the double blank lines
>
Done
> - The opening $BODY$ should be indented
>
Done and also replaced it with $function
> - LANGUAGE should be indented
>
Done
> - The are two spaces between 'sql' and NOT.
>
I have put function options into the next line as Reverse engineered SQL
>
> - Reverse engineered SQL may look like:
>
> =====
> -- FUNCTION: pem.whee(INOUT foo bigint)
>
> -- DROP FUNCTION pem.whee(INOUT foo bigint);
>
> CREATE OR REPLACE FUNCTION pem.whee(INOUT foo bigint DEFAULT 123)
> RETURNS bigint
> LANGUAGE sql
> SET backslash_quote TO 'on'
> AS $function$SELECT $1;$function$
> =====
>
> - We should be consistent with our heredoc markers ($BODY$ vs.
> $function$)
>
Replaced $BODY with $function
> - There's a 1 space indent
>
As per our discussion, will not fix this 1 space indent because the
Function definition SQL is coming from pg_def_functiondef function
> - This formatting (bar the issues above) is much nicer that the
> CREATE formatting.
>
> I haven't found anything else of note yet, that I haven't fixed in
> passing (though I have yet to test with PPAS). Updated patch attached.
>
> Thanks.
>
> --
> Dave Page
> Blog: http://pgsnake.blogspot.com
> Twitter: @pgsnake
>
> EnterpriseDB UK: http://www.enterprisedb.com
> The Enterprise PostgreSQL Company
>
Attachment | Content-Type | Size |
---|---|---|
pgAdmin4_function_ver1.patch | text/x-patch | 229.7 KB |
From | Date | Subject | |
---|---|---|---|
Next Message | Khushboo Vashi | 2016-03-22 10:58:33 | [pgAdmin4][Patch]: Update the Browser Tree Node Icon after editing |
Previous Message | Harshal Dhumal | 2016-03-22 10:28:17 | Switch control options issue [pgadmin4] |