Stored columns: Unexpected varattno in expression to be mapped
От | Thiede, Christoph |
---|---|
Тема | Stored columns: Unexpected varattno in expression to be mapped |
Дата | |
Msg-id | 155b60197f7844539ae86781c15e5e52@student.hpi.uni-potsdam.de обсуждение исходный текст |
Ответы |
Re: Stored columns: Unexpected varattno in expression to be mapped
Re: Stored columns: Unexpected varattno in expression to be mapped |
Список | pgsql-bugs |
Hi all,
as a Postgres user for about half a year, I think I found a bug in psql (PostgreSQL) 12.2 (Debian 12.2-2.pgdg100+1).
Steps to reproduce:
Type the following commands into a PSQL shell:
postgres=# create table mytable (foo text generated always as (bar) stored, bar text);CREATE TABLEpostgres=# create temporary table mytemp1 (like mytable);CREATE TABLEpostgres=# create temporary table mytemp2 (like mytable including all);ERROR: unexpected varattno 2 in expression to be mapped
Considerations:
It looks as if the INCLUDING ALL logic, however it may work, assumes that stored columns can only refer to columns defined before. On the other hand, CREATE TABLE does not enforce this.
So from my naive perspective, either INCLUDING ALL should be fixed not to make this assumption, or CREATE TABLE & Co. should forbid the definition of such columns.
I would be happy if this bug could be fixed in a later release (provided that it has not already been).
Note: Please reply directly to my email address if you want to contact me, I did not subscribe to the bugs list.
Best regards,
Christoph
В списке pgsql-bugs по дате отправления: