Re: Postgres registry access using java

From: John R Pierce <pierce(at)hogranch(dot)com>
To: pgsql-general(at)postgresql(dot)org
Subject: Re: Postgres registry access using java
Date: 2009-05-28 16:45:41
Message-ID: 4A1EBFB5.3070602@hogranch.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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 install data directory as users's convinient location, may be outside instalation directory. In that case how to fetch postgres instalation directory? I am looking for lib directory, which I can found out by traversing directory path once I find 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"

In response to

Browse pgsql-general by date

  From Date Subject
Next Message inf200468 2009-05-28 16:53:43 configurar el hba
Previous Message Tim Bruce - Postgres 2009-05-28 16:40:30 Re: How to speed up the first-time-searching in pgsql?