Re: BUG #16342: CREATE TABLE LIKE INCLUDING GENERATED column orderissue - Mailing list pgsql-bugs

From Peter Eisentraut
Subject Re: BUG #16342: CREATE TABLE LIKE INCLUDING GENERATED column orderissue
Date
Msg-id db920c8a-063e-a320-c5e8-096f0eedc154@2ndquadrant.com
Whole thread Raw
In response to BUG #16342: CREATE TABLE LIKE INCLUDING GENERATED column order issue  (PG Bug reporting form <noreply@postgresql.org>)
Responses Re: BUG #16342: CREATE TABLE LIKE INCLUDING GENERATED column order issue
List pgsql-bugs
On 2020-04-04 01:50, PG Bug reporting form wrote:
> postgres=# CREATE TABLE test (
>    funds float GENERATED ALWAYS AS (cast(funds_t AS double precision))
> STORED,
>    funds_t text,
>    id bigserial not null
> );
> CREATE TABLE
> 
> postgres=# CREATE TABLE IF NOT EXISTS test_temp (LIKE test INCLUDING
> GENERATED);
> ERROR:  XX000: unexpected varattno 3 in expression to be mapped
> LOCATION:  map_variable_attnos_mutator, rewriteManip.c:1255

Confirmed.  Attached is a patch to fix it.  Thanks for the report!

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

Attachment

pgsql-bugs by date:

Previous
From: Peter Eisentraut
Date:
Subject: Re: BUG #16333: position() function not equivalent to strpos()function when comparing citext
Next
From: Tom Lane
Date:
Subject: Re: BUG #16342: CREATE TABLE LIKE INCLUDING GENERATED column order issue