pg.ddx.io  pgsql-admin@postgresql.org mailing list archive  
help / color / mirror / Atom feed
Automatic Backups
6+ messages / 3 participants
[nested] [flat]

* Automatic Backups
@ 2005-04-08 18:14  David A. Leedom <daleedom@hightowergroup.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David A. Leedom @ 2005-04-08 18:14 UTC (permalink / raw)
  To: pgsql-admin

I am writing a program to backup Postgres 8.0 installed on windows via 
Visual Basic.

Is there an easy way to find out where a the PostgreSQL bin files are 
located so I can get the pg_dump and pg_restore utilities?

Enthusiastically,

Dave Leedom



The Hightower Group, Inc.
Custom Software Solutions Designed To Fit Your Business Like A Glove.
165 West Airport Road, Suite B/Lititz, PA 17543
V:717-560-4002, 877-560-4002 x: 114
F:717-560-2825
www.hightowergroup.com  




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Automatic Backups
@ 2005-04-08 19:13  John DeSoi <desoi@pgedit.com>
  parent: David A. Leedom <daleedom@hightowergroup.com>
  0 siblings, 1 reply; 6+ messages in thread

From: John DeSoi @ 2005-04-08 19:13 UTC (permalink / raw)
  To: David A. Leedom <daleedom@hightowergroup.com>; +Cc: pgsql-admin


On Apr 8, 2005, at 2:14 PM, David A. Leedom wrote:

> Is there an easy way to find out where a the PostgreSQL bin files are 
> located so I can get the pg_dump and pg_restore utilities?

I think the installer puts this information in the registry. If you 
don't get a more authoritative response, you might want to take a look 
at the installer source file (a Wix xml document) for the exact 
registry setup.

http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Automatic Backups
@ 2005-04-08 20:00  David A. Leedom <daleedom@hightowergroup.com>
  parent: John DeSoi <desoi@pgedit.com>
  0 siblings, 1 reply; 6+ messages in thread

From: David A. Leedom @ 2005-04-08 20:00 UTC (permalink / raw)
  To: pgsql-admin

John,

Thanks for getting back to me.

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?

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?)

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.

Anyone have any further thoughts.

Dave Leedom

At 03:13 PM 4/8/2005, John DeSoi wrote:

>On Apr 8, 2005, at 2:14 PM, David A. Leedom wrote:
>
>>Is there an easy way to find out where a the PostgreSQL bin files are 
>>located so I can get the pg_dump and pg_restore utilities?
>
>I think the installer puts this information in the registry. If you don't 
>get a more authoritative response, you might want to take a look at the 
>installer source file (a Wix xml document) for the exact registry setup.
>
>http://cvs.pgfoundry.org/cgi-bin/cvsweb.cgi/pginstaller/
>
>
>John DeSoi, Ph.D.
>http://pgedit.com/
>Power Tools for PostgreSQL
>



The Hightower Group, Inc.
Custom Software Solutions Designed To Fit Your Business Like A Glove.
165 West Airport Road, Suite B/Lititz, PA 17543
V:717-560-4002, 877-560-4002 x: 114
F:717-560-2825
www.hightowergroup.com  




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Automatic Backups
@ 2005-04-09 13:43  Magnus Hagander <mha@sollentuna.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Magnus Hagander @ 2005-04-09 13:43 UTC (permalink / raw)
  To: David A. Leedom <daleedom@hightowergroup.com>; pgsql-admin

>I am writing a program to backup Postgres 8.0 installed on windows via 
>Visual Basic.
>
>Is there an easy way to find out where a the PostgreSQL bin files are 
>located so I can get the pg_dump and pg_restore utilities?

It's stored in the registry under
HKLM\Software\PostgreSQL\Installations\<version id>\Bin Directory

For 8.0.x, version id is {5AA3FA26-72A2-4D06-9BFE-98E650A37B6D}.

//Magnus



^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Automatic Backups
@ 2005-04-10 14:46  John DeSoi <desoi@pgedit.com>
  parent: David A. Leedom <daleedom@hightowergroup.com>
  0 siblings, 0 replies; 6+ messages in thread

From: John DeSoi @ 2005-04-10 14:46 UTC (permalink / raw)
  To: David A. Leedom <daleedom@hightowergroup.com>; +Cc: pgsql-admin


On Apr 8, 2005, at 4:00 PM, David A. Leedom wrote:

> 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?
>
> 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?)
>
> 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.


John DeSoi, Ph.D.
http://pgedit.com/
Power Tools for PostgreSQL




^ permalink  raw  reply  [nested|flat] 6+ messages in thread

* Re: Automatic Backups
@ 2005-04-10 19:51  Magnus Hagander <mha@sollentuna.net>
  0 siblings, 0 replies; 6+ messages in thread

From: Magnus Hagander @ 2005-04-10 19:51 UTC (permalink / raw)
  To: John DeSoi <desoi@pgedit.com>; David A. Leedom <daleedom@hightowergroup.com>; +Cc: pgsql-admin

>> 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



^ permalink  raw  reply  [nested|flat] 6+ messages in thread


end of thread, other threads:[~2005-04-10 19:51 UTC | newest]

Thread overview: 6+ messages (download: mbox mbox.gz follow: Atom feed)
-- links below jump to the message on this page --
2005-04-08 18:14 Automatic Backups David A. Leedom <daleedom@hightowergroup.com>
2005-04-08 19:13 ` John DeSoi <desoi@pgedit.com>
2005-04-08 20:00   ` David A. Leedom <daleedom@hightowergroup.com>
2005-04-10 14:46     ` John DeSoi <desoi@pgedit.com>
2005-04-09 13:43 Re: Automatic Backups Magnus Hagander <mha@sollentuna.net>
2005-04-10 19:51 Re: Automatic Backups Magnus Hagander <mha@sollentuna.net>

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox