Re: from PG_DUMP to CVS

From: Josh Berkus <josh(at)agliodbs(dot)com>
To: Philip Warner <pjw(at)rhyme(dot)com(dot)au>, abief_ag_-postgresql(at)yahoo(dot)com, Kenneth Gonsalves <lawgon(at)thenilgiris(dot)com>, pgsql-sql(at)postgresql(dot)org
Subject: Re: from PG_DUMP to CVS
Date: 2004-08-27 16:02:20
Message-ID: 200408270902.20350.josh@agliodbs.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-sql

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

In response to

Responses

Browse pgsql-sql by date

  From Date Subject
Next Message Josh Berkus 2004-08-27 18:59:26 Re: Aggregate query for multiple records
Previous Message Josh Berkus 2004-08-27 15:43:32 Re: Aggregate query for multiple records