Use RELATION_IS_OTHER_TEMP where possible
| От | Junwang Zhao |
|---|---|
| Тема | Use RELATION_IS_OTHER_TEMP where possible |
| Дата | |
| Msg-id | CAEG8a3LjTGJcOcxQx-SUOGoxstG4XuCWLH0ATJKKt_aBTE5K8w@mail.gmail.com обсуждение исходный текст |
| Ответы |
Re: Use RELATION_IS_OTHER_TEMP where possible
|
| Список | pgsql-hackers |
Hi hackers,
While reviewing the Merge/Split partitions patch[0], I found
some places in tablecmds.c where RELATION_IS_OTHER_TEMP
can be used but not, such as:
/* If the parent is temp, it must belong to this session */
if (rel->rd_rel->relpersistence == RELPERSISTENCE_TEMP &&
!rel->rd_islocaltemp)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot attach as partition of temporary relation of another session")));
/* Ditto for the partition */
if (attachrel->rd_rel->relpersistence == RELPERSISTENCE_TEMP &&
!attachrel->rd_islocaltemp)
ereport(ERROR,
(errcode(ERRCODE_WRONG_OBJECT_TYPE),
errmsg("cannot attach temporary relation of another session as partition")));
All other files perform this check using RELATION_IS_OTHER_TEMP.
Should we update tablecmds.c to do the same for consistency?
[0] https://www.postgresql.org/message-id/884bcf9e-d6e3-4b0c-8dcb-7f2110070ac9@postgrespro.ru
--
Regards
Junwang Zhao
В списке pgsql-hackers по дате отправления: