pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: Adrian Klaver <adrian.klaver@aklaver.com>
To: Greg Sabino Mullane <htamfids@gmail.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: "reverse" (?) UPSERT -- how to ?
Date: Sat, 17 Feb 2024 19:20:56 +0100
Message-ID: <ZdD5CC-6ljcCPoGe@hermes.hilbert.loc> (raw)
In-Reply-To: <1afec5a0-6a5c-428e-b84f-96b0b8777a8d@aklaver.com>
References: <ZdDPpWxB6IH_Dx1b@hermes.hilbert.loc>
	<1afec5a0-6a5c-428e-b84f-96b0b8777a8d@aklaver.com>

Am Sat, Feb 17, 2024 at 08:55:57AM -0800 schrieb Adrian Klaver:

> >Dear list members,
> >
>
> >So, is this doable within one SQL statement (short of
> >creating and running the abovementioned function in
> >one go ;-) ?
>
> Don't know what version of Postgres you are on, assuming 15+ then maybe?:

Ah, sorry, I omitted that detail :(

Release target for new installs is current Debian Stable, IOW
Bookworm, which has PG 15.

	postgresql:
	  Installiert:           15+248
	  Installationskandidat: 15+248
	  Versionstabelle:
	     16+257 500
	        500 https://deb.debian.org/debian testing/main i386 Packages
	 *** 15+248 990
	        990 https://deb.debian.org/debian bookworm/main i386 Packages
	        100 /var/lib/dpkg/status


However, legacy deployments may run, say PG 13,

	root@hermes:~/bin# rmadison postgresql
	postgresql | 11+200+deb10u5 | oldoldstable | all
	postgresql | 13+225+deb11u1 | oldstable    | all
	postgresql | 15+248         | stable       | all
	postgresql | 16+257         | testing      | all
	postgresql | 16+257         | unstable     | all

so ideally it would work on that, too. However, it does not
seem too much to ask to *upgrade* GNUmed database servers to
Debian *Stable* if on plans on running the next,
as-yet-unreleased version ;-)

> MERGE
>
> https://www.postgresql.org/docs/current/sql-merge.html

:-)   I knew I missed something. As Greg also pointed out
that is what I need.

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





view thread (8+ messages)  latest in thread

Message-ID: <ZdD5CC-6ljcCPoGe@hermes.hilbert.loc>
Permalink:  ../ZdD5CC-6ljcCPoGe@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/ZdD5CC-6ljcCPoGe@hermes.hilbert.loc

 · 

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: Karsten.Hilbert@gmx.net, adrian.klaver@aklaver.com, htamfids@gmail.com
  Subject: Re: "reverse" (?) UPSERT -- how to ?
  In-Reply-To: <ZdD5CC-6ljcCPoGe@hermes.hilbert.loc>
  References: <ZdDPpWxB6IH_Dx1b@hermes.hilbert.loc> <1afec5a0-6a5c-428e-b84f-96b0b8777a8d@aklaver.com> <ZdD5CC-6ljcCPoGe@hermes.hilbert.loc>

* 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