Re: [HACKERS] cast result of copyObject()

Поиск
Список
Период
Сортировка
От Peter Eisentraut
Тема Re: [HACKERS] cast result of copyObject()
Дата
Msg-id c2e5f74f-5602-926a-6999-78857ffd8a03@2ndquadrant.com
обсуждение исходный текст
Ответ на Re: [HACKERS] cast result of copyNode()  (Peter Eisentraut <peter.eisentraut@2ndquadrant.com>)
Ответы Re: [HACKERS] cast result of copyNode()  (Mark Dilger <hornschnorter@gmail.com>)
Список pgsql-hackers
> The problem this patch would address is that currently you can write
> 
> SomeNode *x = ...;
> 
> ...
> 
> 
> OtherNode *y = copyObject(x);
> 
> and there is no notice about that potential mistake.
> 
> This patch makes that an error.
> 
> If you are sure about what you are doing, you can add a cast.  But
> casting the result of copyObject() should be limited to a few specific
> cases where the result is assigned to a generic Node * or something like
> that.

Updated patch, which I will register in the commit fest for some wider
portability testing (Windows!).

(changed subject copyNode -> copyObject (was excited about castNode at
the time))

-- 
Peter Eisentraut              http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services

-- 
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

Вложения

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

Предыдущее
От: Andres Freund
Дата:
Сообщение: Re: [HACKERS] Performance degradation in TPC-H Q18
Следующее
От: Robert Haas
Дата:
Сообщение: Re: [HACKERS] PATCH: Make pg_stop_backup() archive wait optional