Jump to: navigation, search

PostgreSQL MD5

From w3cyberlearnings

Contents

Postgresql md5

Returns as a hexadecimal of the MD5 hash of a string.

Syntax md5

md5(string)

Example 1

test2=# SELECT md5('apple');
               md5                
----------------------------------
 1f3870be274f6c49b3e31a0c6728957f
(1 row)

test2=# SELECT md5('a4');
               md5                
----------------------------------
 894f782a148b33af1e39a0efed952d69
(1 row)


Example 2

test2=# INSERT INTO ourtime values(2,md5('apple'),00);
INSERT 0 1
test2=# SELECT * FROM ourtime WHERE id=2;
 id |               name               | time 
----+----------------------------------+------
  2 | 1f3870be274f6c49b3e31a0c6728957f |    0
(1 row)

Related Links


Navigation
Web
SQL
MISC
References