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 1nXZ4h-0004St-GF for pgsql-docs@arkaria.postgresql.org; Fri, 25 Mar 2022 01:49:11 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1nXZ4g-0005y9-6g for pgsql-docs@arkaria.postgresql.org; Fri, 25 Mar 2022 01:49:10 +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 1nXZ4f-0005y0-BB for pgsql-docs@lists.postgresql.org; Fri, 25 Mar 2022 01:49:09 +0000 Received: from wout1-smtp.messagingengine.com ([64.147.123.24]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1nXZ4b-00055K-Gb for pgsql-docs@lists.postgresql.org; Fri, 25 Mar 2022 01:49:09 +0000 Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 8303E3201FCE; Thu, 24 Mar 2022 21:49:02 -0400 (EDT) Received: from imap49 ([10.202.2.99]) by compute1.internal (MEProxy); Thu, 24 Mar 2022 21:49:02 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=eulerto.com; h= cc:content-type:date:date:from:from:in-reply-to:in-reply-to :message-id:mime-version:references:reply-to:sender:subject :subject:to:to; s=fm1; bh=yqrMlpYjOEgoM36SR7mYP5+ybW02t73gvDfXrh oYtR4=; b=ZQQ6dCnwzRZFUOfUWCPCiM21/s208WO2qy3WGFPgrDWOan//Pk21gZ wNtPJnRAC76/V8HuKn61qW4nrtwvNw+o1BC16wt4GDipjzKYd0ZFh21dTfbBN/pX gCP0OTVTgMh1WtsQm2y4VD5TJf8WiQyN72CQeywRTRCeXo2Y+1QiGVpTwIukY2tb 8diGLqH2kSZdgDmphZlsGl4DHCm21CjFFntmlrtfzKfkevYRq9H/CpVBJrqx8GWd Thoj3uPrZ61XLloWndJXr/DZOdfNwjnLLM/lbOv03egI86uamuUJNvRetIqjYRHR FYCYs1mcvXvC7rPQVOzBs0+mwcY8NUhg== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-type:date:date:from:from :in-reply-to:in-reply-to:message-id:mime-version:references :reply-to:sender:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; bh=yqrMlpYjOEgoM36SR 7mYP5+ybW02t73gvDfXrhoYtR4=; b=ApemJLaQzEynJ29DbDDqku2GQMoaWZzp6 PzWGS4iWtxJwJgHL9mZ6VpCv4s80R6Xudpr/3Y4VhKcBD0juoaM4ml5QLOUCYCFN x8MI7SHBG94OGjuXEM9lZZ2Y1BrPOo3kRX13qvWe1hqNPo5Suv2QyI1H57z5c5A4 7Gv603p031QxG417SzCePai0E66EMlsXFCE/jGbj6BqESCzeE2E17AyiJgOFSwF7 ErqAJgAcXEAOG+yXMwyfUAS3OqOSuTQbZgTXGaD8udGFH/wQUNNkVD6h2akl6CGu of6eomQ1v/3BByjd4dQpR7Um9VEr5YAVVvV1RL6STvrQkQFdIN+mg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvvddrudehtddgfeegucetufdoteggodetrfdotf fvucfrrhhofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgen uceurghilhhouhhtmecufedttdenucenucfjughrpefofgggkfgjfhffhffvufgtsegrtd erreerredtnecuhfhrohhmpedfgfhulhgvrhcuvfgrvhgvihhrrgdfuceovghulhgvrhes vghulhgvrhhtohdrtghomheqnecuggftrfgrthhtvghrnhepjeethfeuvdfgffdtteevud eftdejueffkeelveekhfevkeegleefhfejhedtjeegnecuffhomhgrihhnpegvnhhtvghr phhrihhsvggusgdrtghomhenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmh grihhlfhhrohhmpegvuhhlvghrsegvuhhlvghrthhordgtohhm X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id BC98DF60083; Thu, 24 Mar 2022 21:49:01 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.5.0-alpha0-4911-g925b585eab-fm-20220323.003-g925b585e Mime-Version: 1.0 Message-Id: <81d77fc9-c28c-4bd6-8efc-656622811dbb@www.fastmail.com> In-Reply-To: <164790256029.701350.8616885741554177403@wrigleys.postgresql.org> References: <164790256029.701350.8616885741554177403@wrigleys.postgresql.org> Date: Thu, 24 Mar 2022 22:48:31 -0300 From: "Euler Taveira" To: ranasalal@gmail.com, pgsql-docs@lists.postgresql.org Subject: Re: GENERATED ALWAYS AS - Not Consistent with MD5 Content-Type: multipart/alternative; boundary=317504a529b5400789878c383dc505de List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk --317504a529b5400789878c383dc505de Content-Type: text/plain On Mon, Mar 21, 2022, at 7:42 PM, PG Doc comments form wrote: > In my table definition - my Id Column is defined as ```Id TEXT PRIMARY KEY > GENERATED ALWAYS AS (MD5(date_part('epoch', Inv_Date)::TEXT || TerminalId || > GradeId || Ownership_Code)) STORED,``` > > But the value generated is not consistent upon insertion. > To confirm we checked by generating MD5 on SELECT and comparing the Id, > they're two completely different values. > It works for me. Could you provide a self-contained test case? What's your current version? This list is for documentation discussion. For general questions, use pgsql-general. For bug reports, use pgsql-bugs. -- Euler Taveira EDB https://www.enterprisedb.com/ --317504a529b5400789878c383dc505de Content-Type: text/html Content-Transfer-Encoding: quoted-printable
On Mon, Mar 21,= 2022, at 7:42 PM, PG Doc comments form wrote:
In my table definition - my Id Colum= n is defined as ```Id TEXT PRIMARY KEY
GENERATED ALWAYS AS= (MD5(date_part('epoch', Inv_Date)::TEXT || TerminalId ||
= GradeId || Ownership_Code)) STORED,```

But = the value generated is not consistent upon insertion.
To c= onfirm we checked by generating MD5 on SELECT and comparing the Id,
<= /div>
they're two completely different values.

It works for me. Could you provide a self-contained= test case? What's your
current version?
This list is for documentation discussion. For general quest= ions, use
pgsql-general. For bug reports, use pgsql-bugs.<= br>


--
Euler Taveira
<= /div>
--317504a529b5400789878c383dc505de--