pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Adrian Klaver <adrian.klaver@aklaver.com>
To: Lorusso Domenico <domenico.l76@gmail.com>
To: pgsql-general@lists.postgresql.org
Subject: Re: merge with view
Date: Mon, 11 Mar 2024 14:20:16 -0700
Message-ID: <18e5f2bb-ef4c-432b-9ad9-0514b7abb832@aklaver.com> (raw)
In-Reply-To: <CAJMpnG615RTin+dEmaiya4ieTw2BfgoDrqZMA-oRCY9FRfdnFg@mail.gmail.com>
References: <CAJMpnG615RTin+dEmaiya4ieTw2BfgoDrqZMA-oRCY9FRfdnFg@mail.gmail.com>

On 3/11/24 13:25, Lorusso Domenico wrote:
> Hello guys,
> Merge isn't work on view; anyone know why?
> I mean, merge could be performed in many way, but essentially is:
> 
>   * join sets
>   * if matched update or delete
>   * if not matched insert
> 
> it doesn't seem to be relevant if set is a table or a view.
> 
> Moreover also "insert + on conflict" doesn't work with view (in my case 
> is a view on a single table with an instead of trigger)

Reply with:

Postgres version

View definition

Example Merge query.

Definition of doesn't work, with actual complete error message.

> 
> There is a way to workaround to this issue?
> 
> -- 
> Domenico L.
> 
> per stupire mezz'ora basta un libro di storia,
> io cercai di imparare la Treccani a memoria... [F.d.A.]

-- 
Adrian Klaver
adrian.klaver@aklaver.com






view thread (2+ messages)

Message-ID: <18e5f2bb-ef4c-432b-9ad9-0514b7abb832@aklaver.com>
Permalink:  ../18e5f2bb-ef4c-432b-9ad9-0514b7abb832@aklaver.com/
Also on:    postgresql.org/message-id/18e5f2bb-ef4c-432b-9ad9-0514b7abb832@aklaver.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients from your mail client; the link fills in
  the headers below: reply via email
  Some clients, webmail especially, drop In-Reply-To and References from
  a link, and the reply then starts a new thread: use the mbox below.

  To: pgsql-general@postgresql.org
  Cc: adrian.klaver@aklaver.com, domenico.l76@gmail.com
  Subject: Re: merge with view
  In-Reply-To: <18e5f2bb-ef4c-432b-9ad9-0514b7abb832@aklaver.com>
  References: <CAJMpnG615RTin+dEmaiya4ieTw2BfgoDrqZMA-oRCY9FRfdnFg@mail.gmail.com> <18e5f2bb-ef4c-432b-9ad9-0514b7abb832@aklaver.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox