On 2/19/18 21:07, Michael Paquier wrote: > + <entry><literal>sha224('abc')</literal></entry> > + > <entry><literal>\x23097d223405d8228642a477bda2​55b32aadbce4bda0b3f7e36c9da7</literal></entry> > Some bytea characters from the hash are not able to show up correctly? > This does not result in spaces.
U+200B is a zero-width space, used here to hint for possible line breaks. > + Note that for historic reasons, the function <function>md5</function> > + returns a hex-encoded value of type <type>text</type> whereas the SHA-2 > + functions return type <type>bytea</type>. Use the functions > + <function>encode</function> and <function>decode</function> to convert > + between the two. > Adding an example would be nice. OK > varlena.c is already large and messy. I would suggest to split into a > new file all the user-facing cryptographic functions, including md5 and > hex functions, say in src/backend/utils/adt/crypt.c. I had originally started a new file called hash.c, but I figured that would be quite confusing. I can use crypt.c or a similar name. Although crypt.c sounds a lot like crypt(). -- Peter Eisentraut http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services