# How do I install pgcrypto on Windows?

I would like to install pgcrypto in Windows. I have a file C:\Program\PostgreSQL\9.0\share\contrib\pgcrypto.sql but when I try to run it in psql I get an error:

C:: Permission denied


How do I solve this?

• Can you confirm that the file exists at C:\Program\PostgreSQL\9.0\share\pgcrypto.sql and not at C:\Program Files\PostgreSQL\9.0\share\pgcrypto.sql for example? – Jack Douglas Jun 13 '11 at 13:39
• @Jack: Yes, it's the 64-bit version. I have C:\Program\PostgreSQL\9.0\lib\pgcrypto.dll and C:\Program\PostgreSQL\9.0\share\contrib\pgcrypto.sql – Jonas Jun 13 '11 at 13:42
• I get the same error even if I start the psql command prompt as Administrator. – Jonas Jun 13 '11 at 13:43
• Can you copy and paste the script line by line into an interactive pg shell and see where you get the error? Or perhaps try it with pgAdmin? Also have you verified the ability to run psql in interactive mode? – Justin Dearing Jun 13 '11 at 16:05
• Have you set the whole postgres(not just /bin but everything) directory to be accessible by everyone (or the correct user)? I had the problem once that the access rules were wrong by default. – DrColossos Jun 13 '11 at 16:52

C:\Users\Administrator>c:\PostgreSQL\9.0\bin\psql.exe -U milen -f C:\PostgreSQL\9.0\share\contrib\pgcrypto.sql milen