How to install pgcrypto module for postgresql?

I've been having a look at postgresql for OS X Lion Server and was planning to use it for setting up virtual mailboxes, rather than adding a real new user to the machine every time I need a new mail user. However, it appears that the pgcrypto module is not installed my default, so hashing passwords appropriately within postgresql is not possible.
Does anyone know if it's possible to install the pgcrypto module without starting from source code and completely reinstalling postgresql?
Or alternatively, I'd be happy if anyone could recommend a best-practice for virtual mail users without creating local user accounts on the server.
Cheers,
Andrew.

Despite not finding much in Google or elsewhere, I managed to find the solution to this problem. Seems logical in hindsight, but it took me a lot of running around before I got there.
Download the source code for postgresql from Apple: PostgreSQL-23
Open Terminal
cd ~/Downloads
tar xvf PostgreSQL-23.tar
Edit the Makefile and add pgcrypto to the ContribTools parameter. It should then read "ContribTools    = hstore intarray pg_upgrade pg_upgrade_support pgcrypto"
make
sudo make install-contrib
sudo cp /tmp/PostgreSQL/Release/usr/lib/postgresql/pgcrypto.so /usr/lib/postgresql/
sudo cp /tmp/PostgreSQL/Release/usr/share/postgresql/contrib/pgcrypto.sql /usr/share/postgresql/contrib/
sudp cp /tmp/PostgreSQL/Release/usr/share/postgresql/contrib/uninstall_pgcrypto.sql /usr/share/postgresql/contrib/
Don't know whether it was necessary, but I stopped and started postgres with serveradmin at this point. sudo serveradmin stop postgres; sudo serveradmin start postgres
Then just update the databases where you need the crypt functionality. e.g. sudo -u _postgres psql -d template1 -f /usr/share/postgresql/contrib/pgcrypto.sql
That's it. Now when I go into the appropriate database I get the expected return on:
select crypt('thisisyourpassword', gen_salt('bf'));
                            crypt                            
$2a$06$5gTpj2O6qyCvLs4iCcnBxuB/uxEdTMBI96fbHyyGOiP.A6t7nfKzC
(1 row)
Hope that helps anyone who is looking to store passwords in their postgresql database that is installed by default with Lion Server. I just didn't want to install postgresql from source (or any other precompiled package) and end up with two independent instances of postgresql running on the same server. Seems a bit messy (and unnecessary) to me.
Cheers,
Andrew.

Similar Messages

  • How to install memory modules on a macbook pro 15"

    I run Windows 7 via parallels desktop on my macbook pro. How do I type special characters on a Word document using the mac keyboard?

    how to install memory modules on a macbook pro 15"
    Read the manual / user guide that came with your comptuer or download it from http://support.apple.com/manuals/
    I run Windows 7 via parallels desktop on my macbook pro. How do I type special characters on a Word document using the mac keyboard?
    Post your question on the Paralells forums:  http://forums.parallels.com

  • I've installed windows 7 with the help of bootcamp on my macbook pro 2011. Please help me how to install mac drivers for windows7 64 bit???

    I've installed windows 7 with the help of bootcamp on my macbook pro 2011.
    Please help me how to install mac drivers for windows7 64 bit???

    You either download drivers from within Boot Camp Assistant and save to USB FAT disk, or you insert and use 10.6.x OS X DVD when in Windows and install and run the SETUP from there.
    General Help:
    Boot Camp 4.0, OS X Lion: Frequently asked question
    http://support.apple.com/kb/HT4818
    http://manuals.info.apple.com/en_US/boot_camp_install-setup_10.7.pdf
    create a Windows support software (drivers) CD or USB storage media
    http://support.apple.com/kb/HT4407
    Installation Guide   Instructions for all features and settings.
    Boot Camp 4.0 FAQ   Get answers to commonly asked Boot Camp questions.
    Windows 7 FAQ   Answers to commonly asked Windows 7 questions.
    - support articles and tips, how to.
    http://www.apple.com/support/bootcamp/
    Macs that work with 64-bit editions of Microsoft Windows Vista and Windows 7
    http://support.apple.com/kb/HT1846
    Step 4: Install the Boot Camp Drivers for Windows
    After installing Windows, install Mac-specific drivers and other software for Windows using your Mac OS X installation disc.  The Mac OS X disc installs drivers to support Mac components, including AirPort,built-in iSight camera, the Apple Remote, the trackpad on a portable Mac, and thefunction keys on an Apple keyboard. 
    The Mac OS X disc also installs the Boot Camp control panel for Windows and theApple Boot Camp system tray item.
    To install the Boot Camp drivers:
    1 Eject the Windows installation disc.
    2 Insert the Mac OS X disc.  If the installer doesn’t start automatically, browse the disc using Windows Explorerand double-click the setup.exe file in the Boot Camp directory.
    3 Follow the onscreen instructions.
    If a message appears that says the software you’re installing has not passed Windows  Logo testing, click Continue Anyway.
    Windows that appear only briefly during the installation don’t require your input.
    If nothing appears to be happening, there may be a hidden window that you mustrespond to. Check the taskbar and look behind open windows.
    Important: Do not click the Cancel button in any of the installer dialogs.
    4 After your computer restarts, follow the instructions in the Found New Hardware  Wizard to update your software drivers (Windows XP only).
    5 Follow the instructions for any other wizards that appear.
    6 Check for updated Boot Camp drivers by using Apple Software Update or going to www.apple.com/support/bootcamp.
      If You Have Problems Installing the Device Drivers 
    If it appears that the Boot Camp drivers weren’t successfully installed, try repairing them.
    To repair Boot Camp drivers:
    1 Start up your computer in Windows.
    2 Insert your Mac OS X installation disc.
    3 If the installer doesn’t start automatically, browse the disc using Windows Explorerand double-click the setup.exe file in the Boot Camp directory.
    4 Click Repair and follow the onscreen instructions.
    If a message appears that says the software you’re installing has not passed Windows  Logo testing, click Continue Anyway. 
    If you need to reinstall specific drivers, you can install one driver at a time. For example,if your built-in iSight camera isn’t working, you can reinstall just the iSight driver.
    Individual drivers are in the Drivers folder on the Mac OS X installation disc.

  • How can install java sdk for mac os x 10.6.8

    How can install java sdk for mac os x 10.6.8?

    Deanwdd wrote:
    I mean to update Quicktime for Mac Os X 10.6.8...
    If you're running 10.6.8, Apple menu > Software Update. What version of QT do you have?

  • How to install Apache module mod_rewrite

    Kindly tell me, how to install Apache module mod_rewrite which is a standard module in the Oracle HTTP Server (OHS).. I have installed OAS(10.1.2) but mod_rewrite module is missing..
    Edited by: SrinivasanSeniorDBA on 26 Feb, 2010 2:42 PM

    Got it

  • Hi , how to install  "  xi content for mdm "  in XI

    hi
    how to install  "  xi content for mdm "  in XI .
    does any body know the procedure
    cheers
    akhil

    Hi Akhil,
    TPZ files you talking about are related to SAP Systems-MDM integration, i think. They need to deploy on integration engine of XI and require special permissions. Basis Admin of XI server can help you in this regard.
    Most of them contains IR(Design Part) objects and after deploying thenm you need to do configuration part.
    Ask your Basis Admin of XI to deploy them on XI server.
    BR,
    Alok

  • How to install the B1iP for 2007.

    Hi, all
    Does anyone know how to install the B1iP for 2007.
    I tried but this message was occured.
    "new:
    127.0.0.1"\SBO_SHR\B1is\apps\PaymentEngine Neither share folder "B1_SHR" nor "SBO_SHR" exist!"
    Acctualy there is no such folder.
    Should I create the folder by myself?

    Hello Erika and Moutain,
    Please kindly make sure B1iP is installed in the B1 Server machine. If it is B1 Server, suppose there should be a shared forlder created: B1_SHR or SBO_SHR after B1 Server Installation.  B1_SHR or SBO_SHR folder is used to store the client instllation, online help files and working folder for the PaymentEngine in B1 2007 A PL. The error message occurrs during the PaymentEngine B1iApplication instllation. But since B1 2007 A PL 38(including PL38), this error message should be not there anymore. So if you are working with the version earlier than 2007 A PL38, please upgrade the latest version PL39. By the way, of course you can create the shared folder (B1_SHR) and share it by mannual, but it should be created by B1 Server installation. Thanks.
    Kind Regards
    -Yatsea

  • How to install flash player for the gaming app "raptr"?

    how to install flash player for the gaming app "raptr"?

    Hi,
    If you wants to install flash for any browser just visit http://get.adobe.com/flashplayer/ from that browser and click on "Install Now" button to install flash player for that browser.
    But since i have found that raptr is a standalone game so raptr support team would be the right contact who can guide you well that which Flash player plugin they are using in their game. And this is what i have found on there support page Raptr wants me to download "Flash for Other Browsers". Where do I get that? : Raptr Support
    You can follow the steps on that link, I hope it will solve your problem.
    -Varun

  • How to install only OATS for Functional Testing ?

    How to install only OATS for Functional Testing for Oracle EBS?
    I tried micro installation, but installation tried to install whole test manager/oracle xe db/Weblogic etc..
    I want to evaluate how it works, can we leverage for Functional/regression tesitng...
    Please advise...
    Thanks
    Edited by: 956069 on Aug 30, 2012 6:19 AM

    Hello
    You should be able to install OpenScript only using the micro install distribution. You can just skip the steps concerning XE & WLS installation/connection.
    JB

  • How to install plugin globaly (for all users) in Firefox13?

    How to install plugin globaly (for all users) in Firefox13?

    See also:
    *https://developer.mozilla.org/en/Gecko_Plugin_API_Reference/Plug-in_Development_Overview#Installing_Plug-ins

  • HT1338 HOW TO INSTALL THE LION FOR THE FIRST TIME'

    how to install x lion for the first time

    Call Apple and order a download code. You need OS X 10.6 and the Mac App Store to use the code. Lion will be $20.

  • How to install Best Practise for HCM

    Hi all:
        Could you please tell me how to install best practise for HCM , as there is no autoran file.
        Thank you very much!!!
    Best regards
    Frank

    Hi,
    Did you chk this link;
    http://help.sap.com/content/bestpractices/overview/index.htm
    http://help.sap.com/bp_hcmv1600/HCM_US/HTML/index.htm
    Regards
    CSM Reddy

  • How to install flash player for kindle fire

    How to install flasher player for kindle fire

    Adobe stopped ALL development of Flash for Android last year.
    http://helpx.adobe.com/flash-player/kb/archived-flash-player-versions.html
    There are older versions of Flash Player (for Android) at that link, but there are no guarantees any of them will work.
    See also: http://forums.adobe.com/thread/1061194
    I've read a lot about "Dolphin" for Android https://play.google.com/store/apps/details?id=mobi.mgeek.TunnyBrowser
    I'm not an Android user (no tablet or phone) so I can't make any endorsements that would hold any credibility, but most of the Flash solutions I've read point to Dolphin as the best alternative.
    Check the Android forums: http://androidforums.com/ to see what their "gurus" recommend.

  • How to Install Plug-in for PS cs5 to open RAW (.NEF) file for Nikon D810 Camera

    I need someone to walk me through how to install a Plug-in for PS cs5 to open RAW (.NEF) file for Nikon D810 Camera.
    I haven't used photoshop in ages and I got a new camera. I have been on the phone with Adobe (no help) and spent a couple of hours online trying to figure this out. I'm confused, frustrated and about to throw my computer out the window.
    Also, I placed this in the "Photoshop for Beginners" since Photoshop CS5 doesn't appear anymore. I know CS5 is outdated but I spent hundreds of dollars on this program and you would think adobe would still honor its product.
    Any guidance is much appreciated.
    AJ

    Odds are cs5 is too old. If you do a search on my the main Adobe website there is a list of compatible cameras for the last known update to camera raw for cs5.
    Each version of Photoshop only gets so many updates for camera raw then it is necessary to upgrade Photoshop to get the next update for camera raw.
    So you currently have 4 choices.
    1 upgrade Photoshop
    2 get Lightroom - latest version
    3 get Photoshop elements -latest version
    4 get dng converter - this will download the latest version an is the only option that is free.
    The dng converter can be found by searching Adobe website.

  • How to create function module for getting customer name

    Hi Experts,
                   How to create function module?  when in import parameter kunnr values to be passed it must give name1 details according to the customer number...
    how to write the logic in source code....
    Regards,
    Thiru. R

    1. First of all create function group.
    2. Create function module using this function group.
    3. If only one kunnr is needed at a time, create import parameter for it. But if many kunnr to be entered at a time,use table.
    4. Fetch name1 for each kunnr from KNA1 table.
    "->> if many kunnr
    if not t_kunnr[] is initial.
    select kunnr as kunnr name1 as name1
    into table t_kunnr_name1
    from kna1
    for all entried in table t_kunnr
    where kunnr = t_kunnr-kunnr.
    endif.       
    sort t_kunnr_name1 by kunnr name1.
    delete adjacent duplicates from t_kunnr_name1 comparing kunnr name1.
    table t_kunnr_name1 will contain kunnr and its name1.
    I hope logic is clear for you now.
    Regards,
    Aparna

Maybe you are looking for