Re: [pgAdmin4][Patch]: Functions/Procedures Module

Поиск
Список
Период
Сортировка
От Khushboo Vashi
Тема Re: [pgAdmin4][Patch]: Functions/Procedures Module
Дата
Msg-id CAFOhELeZJvNT0VXmq-CQFSruH8fOK9tt45AGSKMzJcQ6HX53eg@mail.gmail.com
обсуждение исходный текст
Ответ на Re: [pgAdmin4][Patch]: Functions/Procedures Module  (Dave Page <dpage@pgadmin.org>)
Ответы Re: [pgAdmin4][Patch]: Functions/Procedures Module  (Dave Page <dpage@pgadmin.org>)
Список pgadmin-hackers
Hi,

Please find updated Patch for the Functions/Procedures Module.

On Fri, Mar 11, 2016 at 10:17 PM, Dave Page <dpage@pgadmin.org> wrote:
Hi

On Fri, Mar 11, 2016 at 9:34 AM, Khushboo Vashi
<khushboo.vashi@enterprisedb.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

Вложения

В списке pgadmin-hackers по дате отправления:

Предыдущее
От: Harshal Dhumal
Дата:
Сообщение: Switch control options issue [pgadmin4]
Следующее
От: Khushboo Vashi
Дата:
Сообщение: [pgAdmin4][Patch]: Update the Browser Tree Node Icon after editing