Results 1 to 4 of 4
  1. #1
    Join Date
    Jan 2006

    Unanswered: Configuration on Windows XP

    I am trying to install the MSI version of Psql v8.2 on my XP. The installation goes smoothly but I don't see any 'data' folders in the installation directoy. Apparently I am supposed to manually modify some files in that folder (e.g. pg_hba.conf)... Here's what I'm trying to achieve: connecting to an outside Postgres db from Python (or even C++). Apparently to do so I need to do some configurations first. And according to everything on the web, these config files are supposed to be in a folder called 'data' under C:\Program Files\PostgreSQL\8.2 (the installation dir). But there is no such thing! I only have a 'share' folder which includes the config files (altho even those are postfixed with .sample -e.g. pg_hba.conf.sample)... Also how do I set this $PGDATA environment variable?...

    I HAVE NO IDEA what I am supposed to do actually! There is barely anything helpful on the 'net (and yes, I am very Google friendly); every article is on Linux...

    Just please, help! I really appreciate a word of wisdom.

  2. #2
    Join Date
    Nov 2003
    Provided Answers: 23
    Did you select the "Data directory" option during installation? That should take care of creating the data dir. You also specify the actual directory there. If you didn't change it, this should be c:\Program Files\Postgres\8.2\data. You should also have seen a screen in the install wizard labelled "Initialize database cluster". You can specify the character set for the database and the superuser account as well.

    To set the PGDATA variable, simply define an environment variable in Windows (Control Panel -> System -> Advanced).

    If you don't want to re-install PG, you can create the data directory yourself using initdb

    You should also verify to which data directory your service is pointing. You can verify this by right-clicking on the service and then choosing "Properties". It shows the full commandline how the pg_ctl is started. The -D parameter tells PG where to find its data directory (if this is specified, you do not need to define the environment variable PGDATA)

  3. #3
    Join Date
    Jan 2006
    EDIT: Okey, finally after consulting with my db admin I understood the story behind all these config files etc. Thanks Shammat for your answer. Much more helpful than what is on the 'net.
    Last edited by opelcorsa; 01-05-07 at 22:41.

  4. #4
    Join Date
    Jun 2004
    Arizona, USA
    also note that if you wish to be able to connect to the database from a remote PC, you'll need to edit pg_hba.conf to specify which addresses will be able to connect.
    "Lisa, in this house, we obey the laws of thermodynamics!" - Homer Simpson
    "I have my standards. They may be low, but I have them!" - Bette Middler
    "It's a book about a Spanish guy named Manual. You should read it." - Dilbert

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts