BUG #16395: error when selecting generated column in a foreign table - Mailing list pgsql-bugs

From PG Bug reporting form
Subject BUG #16395: error when selecting generated column in a foreign table
Date
Msg-id 16395-2f2e9f72bd22a6d1@postgresql.org
Whole thread Raw
Responses Re: BUG #16395: error when selecting generated column in a foreigntable
List pgsql-bugs
The following bug has been logged on the website:

Bug reference:      16395
Logged by:          Mario Leonel
Email address:      mario.ab.leonel@gmail.com
PostgreSQL version: 12.2
Operating system:   Ubuntu 18.04
Description:

-- bd: postgres
CREATE TABLE public.test
(
    id integer NOT NULL,
    field1 integer NOT NULL,
    field2 character varying COLLATE pg_catalog."default",
    CONSTRAINT test_pkey PRIMARY KEY (id)
);

-- bd: test
CREATE FOREIGN TABLE public.test(
    id integer NULL,
    field1 integer NULL,
    field2 character varying NULL COLLATE pg_catalog."default",
    field_calc integer generated always as (field1 * 2) stored
)
    SERVER fs_postgres;

test=# SELECT id, field1, field2, field_calc FROM public.test;
ERROR:  column "field_calc" does not exist
CONTEXT:  remote SQL command: SELECT id, field1, field2, field_calc FROM
public.test

test=# SELECT id, field1, field2 FROM public.test;
 id | field1 | field2 
----+--------+--------
  1 |      2 | one
  2 |      4 | two
  3 |      6 | three
  4 |      8 | four
(4 rows)


pgsql-bugs by date:

Previous
From: Tom Lane
Date:
Subject: Re: BUG #16393: PANIC: cannot abort transaction, it was already committed
Next
From: PG Bug reporting form
Date:
Subject: BUG #16396: Parallel Union queries seem to treat NULL values differently