3 ms·
I was recently reading the documentation for pgcrypto to implement user authentication in SQLPage: https://www.postgresql.org/docs/current/pgcrypto.html https:
by lovasoa 3y ago
I was recently reading the documentation for pgcrypto to implement user authentication in SQLPage:
https://www.postgresql.org/docs/current/pgcrypto.html https://www.postgresql.org/docs/current/pgcrypto.html
The page contains the documentation of many functions, all of which raise the following error by default when you run them: No function matches the given name and argument types.
It turns out you first have to "install" them by running "create extension pgcrypto", which is obvious to someone who already knows postgres modules well, but not to anyone else, and isn't mentioned anywhere on the page!
- timacles 3y agoYou just click `Up` to go a level higher in the documentation and it explains everything. This is just intellectual laziness. Its like complaining your car manual doesn't say you have to open the hood of the car on the same page it explains how to change the wiper fluid.
- lovasoa 3y agoI am not complaining. What I am saying is that the current experience for most users is the following: I want to compute a sha1 hash in postgres. I make a google search, I click the first link. It says I should run `digest('mystring', 'sha1')`. It doesn't work. Whereas it could be the following just by adding one line to the documentation: I click the first link. It says I should run `CREATE EXTENSION pgcrypto` first. Then `digest('mystring', 'sha1')`. It works.