Hello!
On postgres 12.3 the problem still exists (https://www.postgresql.org/message-id/16446-2011a4b103fc5fd1%40postgresql.org):
 
(Tested on PostgreSQL 12.3 (Debian 12.3-1.pgdg100+1) on x86_64-pc-linux-gnu, compiled by gcc (Debian 8.3.0-6) 8.3.0, 64-bit)
 
Bug reference:      16446
Logged by:          Георгий Драк
Email address:      sonicgd(at)gmail(dot)com
PostgreSQL version: 12.2
Operating system:   Debian 10.3
Description:        
 
 
Hello. I'm catch error "virtual tuple table slot does not have system
attributes" when inserting row into partitioned table with RETURNING xmin;
 
 
Reproduction.
 
 
1. Create schema
CREATE TABLE "tmp"
(
    id   bigint generated always as identity,
    date timestamptz not null,
    foo  int         not null,
    PRIMARY KEY ("id", "date")
)
    PARTITION BY RANGE ("date");
CREATE TABLE "tmp_2020" PARTITION OF "tmp" FOR VALUES FROM ('2020-01-01') TO
('2021-01-01');
 
 
2. Execute query
INSERT INTO "tmp" ("date", "foo")
VALUES (NOW(), 1)
RETURNING id, xmin;
 
 
3. Result - ERROR: virtual tuple table slot does not have system
attributes
 
 
4. Expected result - id and xmin of inserted row.