Re: DROP FUNCTION of multiple functions

Поиск
Список
Период
Сортировка
От Fabrízio de Royes Mello
Тема Re: DROP FUNCTION of multiple functions
Дата
Msg-id CAFcNs+qN9UoRT9TDnKYvjR+532DR1c1jxPNUwPsh3uCKRon+wA@mail.gmail.com
обсуждение исходный текст
Ответ на DROP FUNCTION of multiple functions  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Список pgsql-hackers

On Tue, Nov 1, 2016 at 2:55 AM, Peter Eisentraut <peter.eisentraut@2ndquadrant.com> wrote:
>
> Here is a patch series that implements several changes in the internal
> grammar and node representation of function signatures.  They are not
> necessarily meant to be applied separately, but they explain the
> progression of the changes nicely, so I left them like that for review.
>
> The end goal is to make some user-visible changes in DROP FUNCTION and
> possibly other commands that refer to functions.
>
> With these patches, it is now possible to use DROP FUNCTION to drop
> multiple functions at once: DROP FUNCTION func1(), func2(), func3().
> Other DROP commands already supported that, but DROP FUNCTION didn't
> because the internal representation was complicated and couldn't handle it.
>
> The next step after this would be to allow referring to functions
> without having to supply the arguments, if the name is unique.  This is
> an SQL-standard feature and would be very useful for dealing "business
> logic" functions with 10+ arguments.  The details of that are to be
> worked out, but with the help of the present changes, this would be a
> quite localized change, because the grammar representation is well
> encapsulated.
>

Really nice... just a little about 006, can't we reduce the code bellow?

@@ -823,8 +823,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
                 {
                     FuncWithArgs *fwa = (FuncWithArgs *) linitial(objname);
                     address.classId = ProcedureRelationId;
-                    address.objectId =
-                        LookupAggNameTypeNames(fwa->funcname, fwa->funcargs, missing_ok);
+                    address.objectId = LookupAggWithArgs(fwa, missing_ok);
                     address.objectSubId = 0;
                     break;
                 }
@@ -832,8 +831,7 @@ get_object_address(ObjectType objtype, List *objname, List *objargs,
                 {
                     FuncWithArgs *fwa = (FuncWithArgs *) linitial(objname);
                     address.classId = ProcedureRelationId;
-                    address.objectId =
-                        LookupFuncNameTypeNames(fwa->funcname, fwa->funcargs, missing_ok);
+                    address.objectId = LookupFuncWithArgs(fwa, missing_ok);
                     address.objectSubId = 0;
                     break;
                 }

Regards,


--
Fabrízio de Royes Mello
Consultoria/Coaching PostgreSQL
>> Timbira: http://www.timbira.com.br
>> Blog: http://fabriziomello.github.io
>> Linkedin: http://br.linkedin.com/in/fabriziomello
>> Twitter: http://twitter.com/fabriziomello
>> Github: http://github.com/fabriziomello

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

Предыдущее
От: Corey Huinker
Дата:
Сообщение: Re: Declarative partitioning - another take
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Speed up Clog Access by increasing CLOG buffers