Search Postgresql Archives

PL/pgGRESQL, SHA, BYTEA - Creating SHA1 hash for Bytea Value in stored procedure

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



Hi!

I have the following scenario:
	Table:
		Fil_no	BigSerial
		Fil_Name	varchar
		Fil_Data	Bytea
		Fil_HASH	varchar

	Trigger:
		Before Insert  (in Pseudo Code)
			... 
			vchSHA = SHA(Fil_DATA)
			NEW.Fil_HASH = vchSHA
			...

I tried to find a function that calculates the SHA (preference is sha-256),
but could not find anything for PostGRE. However, I want to implement the
calculation within the DB, for several reasons.

Has anyone an idea on how or any pointer into the right direction to
accomplish the above task?

Thanks already in advance!

-Enrico




---------------------------(end of broadcast)---------------------------
TIP 5: don't forget to increase your free space map settings

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Index of Archives]     [Postgresql Jobs]     [Postgresql Admin]     [Postgresql Performance]     [Linux Clusters]     [PHP Home]     [PHP on Windows]     [Kernel Newbies]     [PHP Classes]     [PHP Books]     [PHP Databases]     [Postgresql & PHP]     [Yosemite]
  Powered by Linux