Re: "reverse" (?) UPSERT -- how to ? - Mailing list pgsql-general

From Karsten Hilbert
Subject Re: "reverse" (?) UPSERT -- how to ?
Date
Msg-id ZdD6B1DphHk9TIps@hermes.hilbert.loc
Whole thread Raw
In response to Re: "reverse" (?) UPSERT -- how to ?  (Greg Sabino Mullane <htamfids@gmail.com>)
Responses Re: "reverse" (?) UPSERT -- how to ?
List pgsql-general
Am Sat, Feb 17, 2024 at 11:54:05AM -0500 schrieb Greg Sabino Mullane:

> > There will be a view giving rows for
> >         each detail row enriched with master table data
> >                 UNION ALL
> >         rows for each master row that does not have any detail row with
> > detail table columns NULLed
> >
>
> A better way to do that is to just use a LEFT JOIN.

+1  except that I've got use for both parts of the UNION on
their own (they are both views themselves involving a bunch
of joins with yet other tables, 4 or 5 each or so ;-)

Thanks,
Karsten
--
GPG  40BE 5B0E C98E 1713 AFA6  5BC0 3BEA AC80 7D4F C89B



pgsql-general by date:

Previous
From: Tom Lane
Date:
Subject: Re: Version 6 binaries for RHEL 7
Next
From: Karsten Hilbert
Date:
Subject: Re: "reverse" (?) UPSERT -- how to ?