Failing SQL Feature
Row expansion from a composite value using (expression).*.
In PostgreSQL, functions like json_populate_record return a composite record, and (record_expression).* expands it into individual columns. This syntax is commonly used when inserting JSON data into typed tables.
Docs here
SQL Example
CREATE TABLE users (
id int,
name text,
age int
);
CREATE TABLE staging_users (
data json
);
INSERT INTO staging_users VALUES
('{"id":1,"name":"Alice","age":30}'),
('{"id":2,"name":"Bob","age":25}');
INSERT INTO users
SELECT (json_populate_record(NULL::users, data)).*
FROM staging_users;
Parsing Error
ParseException: Encountered: "." / ".", at line 2, column 49, in lexical state DEFAULT. Was expecting one of these terminals within expansion starting at 1347:23: