Re: Insert works but fails for merge - Mailing list pgsql-general

From David G. Johnston
Subject Re: Insert works but fails for merge
Date
Msg-id CAKFQuwY3itH6rZ8xxjyZOgm6wbNCB2Rt+z24vpb4dZYD_9YypQ@mail.gmail.com
Whole thread Raw
In response to Insert works but fails for merge  (yudhi s <learnerdatabase99@gmail.com>)
List pgsql-general
On Fri, Aug 9, 2024 at 2:14 PM yudhi s <learnerdatabase99@gmail.com> wrote:

Why so?

Because you stuck a CTE in between the column list of the insert - where types are known - and the values command - where types are unknown since you didn't specify them.  As the row comes out of the CTE every column must have a known type, and so in the absence of context they get typed as text.

David J.

pgsql-general by date:

Previous
From: yudhi s
Date:
Subject: Insert works but fails for merge
Next
From: Adrian Klaver
Date:
Subject: Re: Insert works but fails for merge