Re: pg_dump of only the structure from a client such as ruby - Mailing list pgsql-general

From Michael Glaesemann
Subject Re: pg_dump of only the structure from a client such as ruby
Date
Msg-id 25F7595B-3773-4200-8E53-46EE971933F7@seespotcode.net
Whole thread Raw
In response to pg_dump of only the structure from a client such as ruby  (Perry Smith <pedz@easesoftware.com>)
Responses Re: pg_dump of only the structure from a client such as ruby  (Perry Smith <pedz@easesoftware.com>)
List pgsql-general
On Aug 5, 2007, at 16:31 , Perry Smith wrote:

> I'm trying to help out the rails people.  Currently they have
> "rake" scripts which call pg_dump, dropdb, createdb, and psql.  It
> would be nicer if this could be done via a database connection.

Why would this be nicer? What's the advantage? pg_dump in particular
*is* a client application. It isn't called from within another
connection. As loading a schema from a file via psql, that's also
fairly common practice. Alternatives to createdb or dropdb are just
as easily handled by passing a command to psql using its -c flag.
Another point to consider is that using CREATE/DROP DATABASE instead
of the createdb/dropdb client applications requires a database
connection: if you don't have a database to connect to, you can't use
them. Of course, you could initially connect to the postgres database
(or template1 in older version), but that could require configuring
parameters for another database in database.yml. What's the advantage?

Michael Glaesemann
grzm seespotcode net



pgsql-general by date:

Previous
From: Paul Lambert
Date:
Subject: Changing column types
Next
From: Paul Lambert
Date:
Subject: Re: Changing column types