Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1plqkN-00036W-CS for pgsql-general@arkaria.postgresql.org; Mon, 10 Apr 2023 12:35:47 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1plqkK-0000hf-Oz for pgsql-general@arkaria.postgresql.org; Mon, 10 Apr 2023 12:35:44 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1plqkK-0000hV-E7 for pgsql-general@lists.postgresql.org; Mon, 10 Apr 2023 12:35:44 +0000 Received: from mout.gmx.net ([212.227.17.22]) by magus.postgresql.org with esmtps (TLS1.3) tls TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384 (Exim 4.94.2) (envelope-from ) id 1plqkH-00225R-Qd for pgsql-general@lists.postgresql.org; Mon, 10 Apr 2023 12:35:43 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=gmx.net; s=s31663417; t=1681130140; i=karsten.hilbert@gmx.net; bh=3f+YXcxbei/S32omLrNe9A9znn4ks3GsWRamScRl3yk=; h=X-UI-Sender-Class:Date:From:To:Cc:Subject:References:In-Reply-To; b=LBA9EgDpFXZsQQLIHH5Whcmk8n0oHLEXO4hqH6cPVfjctAZkG80GMsTYTO5KH+KKw l2lmO/vt9PSifHG5tUg+1xnlEyClUB5ZriJO3TDtf0iT41i8LceZlZv9pIJKJjPaMe Ib8WFDrn4QBcd8PO1qeq56xWdd8p57iWV+OB+IFnRaBCh4jYuXccxGQty8+ShU+S/U /3BTFy+N9zPD2kJW9FaUT3s7UkVANlUa5E0GjZ6SqJxUIRQzf9+2IOpiFT6kp0WYxq IiE/gLl1AXjpOUvdx9ZE/N3qc9ezf0MfBoT2Aa4C62iQeYJ6Kee+YeS/Ws55oeT8S4 581jklYTZT2iw== X-UI-Sender-Class: 724b4f7f-cbec-4199-ad4e-598c01a50d3a Received: from hermes ([91.9.19.226]) by mail.gmx.net (mrgmx105 [212.227.17.168]) with ESMTPSA (Nemesis) id 1MJmGP-1q60Bu2eyn-00K9gm; Mon, 10 Apr 2023 14:35:39 +0200 Received: from ncq by hermes with local (Exim 4.94.2) (envelope-from ) id 1plqkE-0004Nb-Hc; Mon, 10 Apr 2023 14:35:38 +0200 Date: Mon, 10 Apr 2023 14:35:38 +0200 From: Karsten Hilbert To: Francisco Olarte Cc: pgsql-general@lists.postgresql.org Subject: Re: [EXTERNAL]: Re: [EXTERNAL]: Re: UPSERT in Postgres Message-ID: References: MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: quoted-printable In-Reply-To: Ma_X_il-Followup-to: d Re_X_turn-receipt-to: Karsten.Hilbert@gmx.net Di_X_sposition-Notification-To: Karsten.Hilbert@gmx.net X-Confi_X_rm-Reading-To: Karsten.Hilbert@gmx.net X-Pri_X_ority: 2 (High) Sender: X-Provags-ID: V03:K1:bLDOUKwvAHecykABXb0fj1KpMEpzIV+wYP4Gb+RLUtnC33mOeWe lCiXhUCWzP1NJdiDF5chW8fXgcjVgt8jDXZxNyD+zWMKfLYcng+5VjlCnUPjPyuy7IO+36p 3QvYPvYNH2IEpTIzhi6eLJucQe1HSVZaO09uNJJWGctWtq6U4yacdMimY6IzsbVvbWWk+LS FNQDp8rSjE65ufyhbjGtA== X-Spam-Flag: NO UI-OutboundReport: notjunk:1;M01:P0:sh8t+N1mDiQ=;Pgr8FGH4HOAGNGGidv6VHb1oKTx Frm6kzBZbVjk+b2O6qzCcBfsjzqtFlk8GYvjmVfd/RtsGpe60ibtY5FTa5Z7eTuvLJxzjEVQe WLMDHnnGoxAm4At8p1Xd/ZR7vKz9nIeNiQMDOFrW4R/4S5YfJROJ3QXUWqye3lOJ4uC0wxCdr NpeSToeRKyCDkHxptX0V6SOe7HSnYScpf9ImHnpYnd6AkcnavitqSlLvCbNhBj5+j0U9eW+xE 6JQcrZHqYM8TG+USzuOasasXixf4w9nACuSwMvIb3FQz/AgSzMq226+TXAfJRuvBcfmNK2baG dHZ4ZTiIWGuhBL6CSyquzUSc5r2hXQDyXWlbok3nBh2uZbZrOKlE0Gk5Gt3Je3CoOmsKTrh18 UYdxIGzAhyOSeYc5ZPy9B8JAyL9c7yivU4pmq71DndRe5B0QSdtxMwLLcPOp5px2r8QcV/Y5b LmMrIKEtBwjGAXapiy3aJ13pIHKTGt7h6+snykWptkm3iuy5ARjyk3EvFW8zosxBMR5yRFSv6 wG/MRR8OsSIzg0NOjLCJhb8ctxd37sTxw13tT9sKGhj2fu3jXQV9zzjhqw1xUSZ504utXTMbS 6rJi2HqGeX71IrfGJygCJWwmCFeIbYhucc3P1vtEe7UDuCs5AQgda4OcJNeHpvs3gRblizTvm JGWoPG7puPPkp/g0dtfbzFPPVgNL+xR0Tn2X80Plptzxy+8DV3KJZBz03RuDRvOXCnSJu8YK7 bENKYZpuOLZqAtMSaNFRLgqodrxW2P9hQzCYeZXo5pDID3W6nUPdCVvJdYq1bT/Cg/n7HUb0k sL8eOwvwlQzRYVgVC5QFlZX21FYeTfJ4LN62CNVwfzwxIp5xvWOf08raZFWHRj8W4aAEbRdSy EMy7D8Hhuz5YgAD1iTTMhpX7UPdT6HG7fa8nttCydxj2hwshlkdpCjsNee6JH0nWVKsycrb0w aQI8Ow== List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 alre= ady in > > > > the database. > > > > > > This is extremely easy to do if you have natural instead of surrogat= e 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 ? > > =BF 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 =2D- GPG 40BE 5B0E C98E 1713 AFA6 5BC0 3BEA AC80 7D4F C89B