pgsql: Refactor SQL functions of SHA-2 in cryptohashfuncs.c

From: Michael Paquier <michael(at)paquier(dot)xyz>
To: pgsql-committers(at)lists(dot)postgresql(dot)org
Subject: pgsql: Refactor SQL functions of SHA-2 in cryptohashfuncs.c
Date: 2021-01-28 07:14:09
Message-ID: E1l51VJ-0002ek-JY@gemulon.postgresql.org
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-committers

Refactor SQL functions of SHA-2 in cryptohashfuncs.c

The same code pattern was repeated four times when compiling a SHA-2
hash. This refactoring has the advantage to issue a compilation warning
if a new value is added to pg_cryptohash_type, so as anybody doing an
addition in this area would need to consider if support for a new SQL
function is needed or not.

Author: Sehrope Sarkuni, Michael Paquier
Discussion: https://postgr.es/m/YA7DvLRn2xnTgsMc@paquier.xyz

Branch
------
master

Details
-------
https://git.postgresql.org/pg/commitdiff/f854c69a5b36ba7aa85bee9e9590c3e517970156

Modified Files
--------------
src/backend/utils/adt/cryptohashfuncs.c | 138 +++++++++++++-------------------
1 file changed, 54 insertions(+), 84 deletions(-)

Browse pgsql-committers by date

  From Date Subject
Next Message Michael Paquier 2021-01-28 07:25:25 pgsql: Fix crash of pg_stat_statements_info() without library loaded
Previous Message Michael Paquier 2021-01-28 06:29:40 Re: pgsql: Refactor code in tablecmds.c to check and process tablespace mov