Re: pg_dump of only the structure from a client such as ruby

From: Michael Glaesemann <grzm(at)seespotcode(dot)net>
To: Perry Smith <pedz(at)easesoftware(dot)com>
Cc: pgsql-general(at)postgresql(dot)org
Subject: Re: pg_dump of only the structure from a client such as ruby
Date: 2007-08-05 23:07:43
Message-ID: 25F7595B-3773-4200-8E53-46EE971933F7@seespotcode.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: 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

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Paul Lambert 2007-08-05 23:54:46 Re: Changing column types
Previous Message Paul Lambert 2007-08-05 23:06:11 Changing column types