pg.ddx.io  pgsql-sql@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Josh Berkus <josh@agliodbs.com>
To: Philip Warner <pjw@rhyme.com.au>
To: abief_ag_-postgresql@yahoo.com, Kenneth Gonsalves <lawgon@thenilgiris.com>
To: pgsql-sql@postgresql.org
Subject: Re: from PG_DUMP to CVS
Date: Fri, 27 Aug 2004 09:02:20 -0700
Message-ID: <200408270902.20350.josh@agliodbs.com> (raw)
In-Reply-To: <6.1.1.1.0.20040827210840.06bd3ad0@203.8.195.10>
References: <20040826120504.58934.qmail@web13925.mail.yahoo.com>
	<200408262138.30766.josh@agliodbs.com>
	<6.1.1.1.0.20040827210840.06bd3ad0@203.8.195.10>

Philip,

> My thinking at this stage is to try to get pg_dump/restore to produce the
> output directly. Something like:

Hey, you do what you want, of course.   However, it seems to me that hacking 
AutoDoc would be a *lot* less effort than hacking pg_dump.  

Interestingly, though, I was talking to someone on IRC (Neil?  Gavin?) some 6 
months ago or so about hacking a "PSQL-FS" that is, an interface to the 
*live* database which would look like a filesystem.    Were this done, it 
would be child's play to rsync it with an archive.  Whomever it was didn't 
seem to think it too challenging a task.

>      some-dbname/create.sql
>      some-dbname/drop.sql
>      some-dbname/econding.sql
>      ...
>      some-dbname/some-schema/TABLE/sometable/create.sql
>      some-dbname/some-schema/TABLE/sometable/drop.sql

Hmmm.   I see a slightly different structure below the schema level:

some-dbname/some-schema/TABLES/sometable/create.sql
some-dbname/some-schema/TABLES/sometable/indexes.sql
some-dbname/some-schema/TABLES/sometable/constraints.sql
some-dbname/some-schema/TABLES/sometable/triggers.sql
some-dbname/some-schema/TABLES/sometable/rules.sql
some-dbname/some-schema/VIEWS/someview/create.sql
some-dbname/some-schema/VIEWS/someview/rules.sql
some-dbname/some-schema/FUNCTIONS/somefunction/param{codes}.sql
some-dbname/some-schema/TYPES/sometype/create.sql
some-dbname/some-schema/OPERATORS/someoperator/create.sql

However, the above is somewhat unfriendly to CVS, as one can't drop 
directories in CVS and that would be entailed in the dropping of any objects.  
An alternative would be:

some-dbname/some-schema/TABLES/sometable-create.sql
some-dbname/some-schema/TABLES/sometable-indexes.sql
some-dbname/some-schema/TABLES/sometable-constraints.sql
some-dbname/some-schema/TABLES/sometable-triggers.sql
some-dbname/some-schema/TABLES/sometable-rules.sql
some-dbname/some-schema/VIEWS/someview-create.sql
some-dbname/some-schema/VIEWS/someview-rules.sql
some-dbname/some-schema/FUNCTIONS/somefunction-param{codes}.sql
some-dbname/some-schema/TYPES/sometype-create.sql
some-dbname/some-schema/OPERATORS/someoperator-create.sql

or even:

some-dbname/some-schema/TABLES/sometable.sql
some-dbname/some-schema/VIEWS/someview.sql
some-dbname/some-schema/FUNCTIONS/somefunction-param{codes}.sql
some-dbname/some-schema/TYPES/sometype.sql
some-dbname/some-schema/OPERATORS/OPsomeoperator.sql

In this last, all dependant objects of, for example, a table (rules, triggers, 
indexes, etc. ) would be rolled up into one file.  It's this last version 
that I personally favor.

-- 
Josh Berkus
Aglio Database Solutions
San Francisco



view thread (13+ messages)  latest in thread

Message-ID: <200408270902.20350.josh@agliodbs.com>
Permalink:  ../200408270902.20350.josh@agliodbs.com/
Also on:    postgresql.org/message-id/200408270902.20350.josh@agliodbs.com

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-sql@postgresql.org
  Cc: josh@agliodbs.com, pjw@rhyme.com.au, lawgon@thenilgiris.com
  Subject: Re: from PG_DUMP to CVS
  In-Reply-To: <200408270902.20350.josh@agliodbs.com>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

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