>> I found that the registry entries use a GUID product code on
>the final
>> node of the registry. Is there any way to link this back to the
>> running database?
You mean from the GUID to the database? From the GUID you can get the
data directory, port number, service id etc - it should be everything
you need to find the db.
>> I could hard code the product codes into my backup app. If for some
>> reason there are more than one Postgres installs on one system would
>> there be a way to determine the product code of the database I am
>> backing up via the connect string? (System tables/variables?)
Examine the hostname / port number combination. That uniquely identifies
it. Unless the user has set them both up on the same port and just
doesn't run them both at the same time. In that case, I don't think
there is a way.
There should be no need to hardcode the GUIDs unless you need to find a
specific version. You can just enumerate whatever GUIDs exist in the
subkey and then look inside each of those for a match on the others.
>> Another possibility is that I could include the pg_dump/restore
>> utilities with the backup app and set it up to only backup databases
>> of the correct version.
>>
>
>One idea is to use "pg_ctl.exe status" to determine if the server
>associated with the registry entry is running. I think you'll
>also need
>to specify the data directory with this command, so hopefully that is
>in the registry also.
Yup, it's there.
//Magnus