Re: Postgres registry access using java - Mailing list pgsql-general

From John R Pierce
Subject Re: Postgres registry access using java
Date
Msg-id 4A1EBFB5.3070602@hogranch.com
Whole thread Raw
In response to Re: Postgres registry access using java  ("Anirban Pal" <anirban.pal@newgen.co.in>)
List pgsql-general
Anirban Pal wrote:
>
> Thanks Josh for your kind reply. In the pg_settings table all reference to the folder is with reference to data
directory.Like  
> "config_file"   "C:/Program Files/PostgreSQL/8.3/data/postgresql.conf"
> "data_directory"   "C:/Program Files/PostgreSQL/8.3/data"
> "hba_file"   "C:/Program Files/PostgreSQL/8.3/data/pg_hba.conf"
> "ident_file"   "C:/Program Files/PostgreSQL/8.3/data/pg_ident.conf"
> No reference to postgres instalation base directory, i mean where postgres have been installed. And it is possible to
installdata directory as users's convinient location, may be outside instalation directory. In that case how to fetch
postgresinstalation directory? I am looking for lib directory, which I can found out by traversing directory path once
Ifind what is base installed directory for postgresql. Whatever thanks again for your reply.  


in fact, the data directory can be somewhere quite different from where
the software is installed.  further, there can be several postgres
installs on a single system.

that said, in Windows registry key...

HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\Services, you'll
find a subkey for each install, such as...
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\pgsql-8.3

and in that subkey, you'll find value "Product Code"... append this
value to...
HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\  and you'll find
values like "Base Directory"


here's that whole section of my registry...


[HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Services\pgsql-8.3]
    "Display Name"="PostgreSQL Database Server 8.3"
    "Service Account"="MYCOMPUTER\\postgres"
    "Data Directory"="D:\\postgres\\8.3\\data\\"
    "Port"=dword:00001538
    "Database Superuser"="postgres"
    "Encoding"="UTF8"
    "Locale"="English_United States"
    "Product Code"="{B823632F-3B72-4514-8861-B961CE263224}"

[HKEY_LOCAL_MACHINE\SOFTWARE\PostgreSQL\Installations\{B823632F-3B72-4514-8861-B961CE263224}]
    "Base Directory"="D:\\postgres\\8.3\\"
    "Data Directory"="D:\\postgres\\8.3\\data\\"
    "Version"="8.3"
    "Service ID"="pgsql-8.3"



pgsql-general by date:

Previous
From: Alan McKay
Date:
Subject: Continuent (was: Postgres Clustering)
Next
From: "Tim Bruce - Postgres"
Date:
Subject: Re: How to speed up the first-time-searching in pgsql?