The issue is that the INSERT...SET grammar was incorrectly using set_clause_list which includes the UPDATE-style multi-column assignment syntax (col1, col2) = expr. This creates MultiAssignRef nodes that are only valid in UPDATE contexts, not INSERT. Fix this by changing the grammer rule.
Please find attached v2 patch with the above fix. I have also added support for different column sets in multi-row inserts.
Thanks, Andrew for the offline discussion and help on this.
I am reporting a server crash encountered while testing the patch provided by Suraj. The crash is consistently triggered by the query attached below.
postgres=# INSERT INTO emp_test SET (empno,ename)=(SELECT 1,'aa');
server closed the connection unexpectedly This probably means the server terminated abnormally before or while processing the request. The connection to the server was lost. Attempting reset: Failed.