Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access

Поиск
Список
Период
Сортировка
От Tom Lane
Тема Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access
Дата
Msg-id 581090.1680290713@sss.pgh.pa.us
обсуждение исходный текст
Ответ на Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access  (Ranier Vilela <ranier.vf@gmail.com>)
Ответы Re: BUG #17877: Referencing a system column in a foreign key leads to incorrect memory access  (Ranier Vilela <ranier.vf@gmail.com>)
Список pgsql-hackers
Ranier Vilela <ranier.vf@gmail.com> writes:
> I think that commit f0d65c0
> <https://github.com/postgres/postgres/commit/f0d65c0eaf05d6acd3ae05cde4a31465eb3992b2>
> has an oversight.
> Attnum == 0, is system column too, right?

No, it's not valid in pg_attribute rows.

> All other places at tablecmds.c, has this test:
> if (attnum <= 0)
>     ereport(ERROR,

I was actually copying this code in indexcmds.c:

        if (attno < 0)
            ereport(ERROR,
                    (errcode(ERRCODE_FEATURE_NOT_SUPPORTED),
                     errmsg("index creation on system columns is not supported")));

There's really no reason to prefer one over the other in this context.

            regards, tom lane



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

Предыдущее
От: Robert Haas
Дата:
Сообщение: Re: running logical replication as the subscription owner
Следующее
От: Dmitry Dolgov
Дата:
Сообщение: Re: Schema variables - new implementation for Postgres 15