pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Karsten Hilbert <Karsten.Hilbert@gmx.net>
To: Francisco Olarte <folarte@peoplecall.com>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres
Date: Mon, 10 Apr 2023 14:35:38 +0200
Message-ID: <ZDQCmrgilvcVsRoW@hermes.hilbert.loc> (raw)
In-Reply-To: <CA+bJJbxebcpxEA=Y2L90p5PvTU1j5sMi5J5eyEwe-T3Qr0ZThw@mail.gmail.com>
References: <SY4P282MB1052A434D91AC0656589B6AEA6919@SY4P282MB1052.AUSP282.PROD.OUTLOOK.COM>
	<CAH2-WzkSGmA-ZyMFu_EqQJ8tSgToj6h2=w8znTUa0Nw4oQvVHA@mail.gmail.com>
	<SY4P282MB10529BE09B553228FAA71163A6919@SY4P282MB1052.AUSP282.PROD.OUTLOOK.COM>
	<C1A7991E-251B-4422-AB4B-C1531D863036@gmail.com>
	<SY4P282MB1052FA4F93997B6AD37F5CF4A6959@SY4P282MB1052.AUSP282.PROD.OUTLOOK.COM>
	<bd8b994f-adcf-766d-7766-2d83f0ba4139@gmail.com>
	<CA+bJJbxS8RWt=5ru9ax779Hj3Or=vnmMHni89c+UH14tSp4XYA@mail.gmail.com>
	<ZDPZadH7FJDh1RcB@hermes.hilbert.loc>
	<CA+bJJbxebcpxEA=Y2L90p5PvTU1j5sMi5J5eyEwe-T3Qr0ZThw@mail.gmail.com>

Am Mon, Apr 10, 2023 at 01:33:41PM +0200 schrieb Francisco Olarte:

> > > > This the part that's always eluded me: How does the client, the
> > > > UPSERTer, come to hold an id and not know whether or not it's already in
> > > > the database.
> > >
> > > This is extremely easy to do if you have natural instead of surrogate keys.
> > >
> > > I work in telephony, upserting the last incoming call timestamp for a
> > > phone number will be exactly that.
> >
> > timezones ?
> > DST ?
>
> A timestamp is a point in the time line, this is what I insert, just a
> real number marking a line, timezones and dst are presentation stuff.

Indeed, as is the assumption which time line the numbers are
referring to. Hence the incoming call timestamp is usable as
a (natural) PK with respect to a given time line only, right?

> > spoofing ?
>
> ¿ Of what ?

The time stamp. But then I assume that is obtained on the
logging system.

All I really wanted to hint at is that "incoming call
timestamp" may work pretty well in given settings but does
not _always_ make for a "unique enough" key.

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





view thread (12+ messages)  latest in thread

Message-ID: <ZDQCmrgilvcVsRoW@hermes.hilbert.loc>
Permalink:  ../ZDQCmrgilvcVsRoW@hermes.hilbert.loc/
Also on:    postgresql.org/message-id/ZDQCmrgilvcVsRoW@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, folarte@peoplecall.com
  Subject: Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres
  In-Reply-To: <ZDQCmrgilvcVsRoW@hermes.hilbert.loc>
  References: <SY4P282MB1052A434D91AC0656589B6AEA6919@SY4P282MB1052.AUSP282.PROD.OUTLOOK.COM> <CAH2-WzkSGmA-ZyMFu_EqQJ8tSgToj6h2=w8znTUa0Nw4oQvVHA@mail.gmail.com> <SY4P282MB10529BE09B553228FAA71163A6919@SY4P282MB1052.AUSP282.PROD.OUTLOOK.COM> <C1A7991E-251B-4422-AB4B-C1531D863036@gmail.com> <SY4P282MB1052FA4F93997B6AD37F5CF4A6959@SY4P282MB1052.AUSP282.PROD.OUTLOOK.COM> <bd8b994f-adcf-766d-7766-2d83f0ba4139@gmail.com> <CA+bJJbxS8RWt=5ru9ax779Hj3Or=vnmMHni89c+UH14tSp4XYA@mail.gmail.com> <ZDPZadH7FJDh1RcB@hermes.hilbert.loc> <CA+bJJbxebcpxEA=Y2L90p5PvTU1j5sMi5J5eyEwe-T3Qr0ZThw@mail.gmail.com> <ZDQCmrgilvcVsRoW@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