Re: automatically generating node support functions

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: automatically generating node support functions
Дата
Msg-id b9acf63c-6693-d87c-f010-ca8ad502a39f@enterprisedb.com
обсуждение исходный текст
Ответ на Re: automatically generating node support functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Ответы Re: automatically generating node support functions  (Tom Lane <tgl@sss.pgh.pa.us>)
Re: automatically generating node support functions  (Alvaro Herrera <alvherre@alvh.no-ip.org>)
Список pgsql-hackers
On 06.07.22 22:46, Tom Lane wrote:
> Peter Eisentraut <peter.eisentraut@enterprisedb.com> writes:
>> [ v7-0001-Automatically-generate-node-support-functions.patch ]
> 
> I have gone through this and made some proposed changes (attached),

I have included those.

> and I think it is almost committable.  There is one nasty problem
> we need a solution to, which is that pgindent is not at all on board
> with this idea of attaching node attrs to typedefs.  It pushes them
> to the next line, like this:
> 
> @@ -691,7 +709,8 @@
>        (rel)->reloptkind == RELOPT_OTHER_JOINREL || \
>        (rel)->reloptkind == RELOPT_OTHER_UPPER_REL)
>   
> -typedef struct RelOptInfo pg_node_attr(no_copy_equal, no_read)
> +typedef struct RelOptInfo
> +pg_node_attr(no_copy_equal, no_read)
>   {
>       NodeTag        type;

I have found that putting the attributes at the end of the struct 
definition, right before the semicolon, works, so I have changed it that 
way.  (This is also where a gcc __attribute__() would go, so it seems 
reasonable.)

The attached patch is stable under pgindent.

Finally, I have updated src/backend/nodes/README a bit.

I realize I've been confused various times about when a catversion 
change is required when changing nodes.  (I think the bump in 251154bebe 
was probably not needed.)  I have tried to put that in the README.  This 
could perhaps be expanded.

I think for this present patch, I would do a catversion bump, just to be 
sure, in case some of the printed node fields are different now.

It was also my plan to remove the #ifdef OBSOLETE sections in a separate 
commit right after, just to be clear.

Final thoughts?
Вложения

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

Предыдущее
От: Bharath Rupireddy
Дата:
Сообщение: Re: Patch proposal: New hooks in the connection path
Следующее
От: Robert Haas
Дата:
Сообщение: Re: Backup command and functions can cause assertion failure and segmentation fault