Re: GENERATED ALWAYS AS - Not Consistent with MD5

From: "Euler Taveira" <euler(at)eulerto(dot)com>
To: ranasalal(at)gmail(dot)com, pgsql-docs(at)lists(dot)postgresql(dot)org
Subject: Re: GENERATED ALWAYS AS - Not Consistent with MD5
Date: 2022-03-25 01:48:31
Message-ID: 81d77fc9-c28c-4bd6-8efc-656622811dbb@www.fastmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-docs

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/

In response to

Browse pgsql-docs by date

  From Date Subject
Next Message Nathan Bossart 2022-03-30 22:19:29 Re: pg_dump shared locks documentation
Previous Message Peter Eisentraut 2022-03-23 13:04:47 Re: maximum number of backtrace frames logged by backtrace_functions