BUG #16395: error when selecting generated column in a foreign table

From: PG Bug reporting form <noreply(at)postgresql(dot)org>
To: pgsql-bugs(at)lists(dot)postgresql(dot)org
Cc: mario(dot)ab(dot)leonel(at)gmail(dot)com
Subject: BUG #16395: error when selecting generated column in a foreign table
Date: 2020-04-27 14:24:02
Message-ID: 16395-2f2e9f72bd22a6d1@postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-bugs

The following bug has been logged on the website:

Bug reference: 16395
Logged by: Mario Leonel
Email address: mario(dot)ab(dot)leonel(at)gmail(dot)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)

Responses

Browse pgsql-bugs by date

  From Date Subject
Next Message PG Bug reporting form 2020-04-27 15:26:59 BUG #16396: Parallel Union queries seem to treat NULL values differently
Previous Message Tom Lane 2020-04-27 12:37:22 Re: BUG #16393: PANIC: cannot abort transaction, it was already committed