Re: PublicationActions - use bit flags.

Поиск
Список
Период
Сортировка
Искать
От
Tom Lane
Тема
Re: PublicationActions - use bit flags.
Дата
Msg-id
2683410.1640048186@sss.pgh.pa.us
Список
Дерево обсуждения
PublicationActions - use bit flags. Peter Smith <smithpb2250@gmail.com>
Re: PublicationActions - use bit flags. Justin Pryzby <pryzby@telsasoft.com>
Re: PublicationActions - use bit flags. Peter Smith <smithpb2250@gmail.com>
Re: PublicationActions - use bit flags. Tom Lane <tgl@sss.pgh.pa.us>
Re: PublicationActions - use bit flags. Peter Eisentraut <peter.eisentraut@enterprisedb.com>
Re: PublicationActions - use bit flags. Alvaro Herrera <alvherre@alvh.no-ip.org>
Re: PublicationActions - use bit flags. Tom Lane <tgl@sss.pgh.pa.us>
Re: PublicationActions - use bit flags. Greg Nancarrow <gregn4422@gmail.com>
Greg Nancarrow  writes:
> I've attached a patch which addresses that and replaces a couple of
> memcpy()s with struct assignment, as suggested.

Removing this is not good:

 	if (relation->rd_pubactions)
-	{
 		pfree(relation->rd_pubactions);
-		relation->rd_pubactions = NULL;
-	}
 
If the subsequent palloc fails, you've created a problem where
there was none before.

I do wonder why we have to palloc a constant-size substructure in
the first place, especially one that is likely smaller than the
pointer that points to it.  Maybe the struct definition should be
moved so that we can just declare it in-line in the relcache entry?

			regards, tom lane


В списке pgsql-hackers по дате отправления
От: Ajin Cherian
Дата:
От: Tom Lane
Дата:
FAQ