Re: Schema version management

From: Joel Jacobson <joel(at)trustly(dot)com>
To: Daniel Farina <daniel(at)heroku(dot)com>
Cc: pgsql-hackers(at)postgresql(dot)org
Subject: Re: Schema version management
Date: 2012-05-22 00:25:53
Message-ID: CAASwCXcO7qnyAS0FPiww0xsWDizaiY5XexRVNtS41TOVouePHA@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-hackers

On Tue, May 22, 2012 at 3:30 AM, Daniel Farina <daniel(at)heroku(dot)com> wrote:
> Thank you, that's very informative.  I'd like to reiterate one
> question, though, which is something like:
>
> "How do you feel that the since-committed directory-output/input
> support in pg_dump/pg_restore could or should influence your patch, if
> at all?"

The directory format fulfills a different purpose. The tables are
split into files, where each file name gets a number. Functions are
not split into files, they are defined in the table of content file,
toc.dat.

Example:

joel(at)Joel-Jacobsons-MacBook-Pro ~ $ pg_dump -F d -f /Users/joel/test
joel(at)Joel-Jacobsons-MacBook-Pro ~ $ ls -la test
total 24
drwx------ 5 joel staff 170 May 22 07:16 .
drwx------+ 130 joel staff 4488 May 22 07:16 ..
-rw-r--r-- 1 joel staff 38 May 22 07:16 2116.dat.gz
-rw-r--r-- 1 joel staff 39 May 22 07:16 2117.dat.gz
-rw-r--r-- 1 joel staff 2265 May 22 07:16 toc.dat

This is a good feature for its purpose, but doesn't provide a solution
for the schema version management problem.

> It seems like now that there is support for spitting out a bunch of
> files in a directory for pg_dump that is now going to be supported for
> a long time that a new feature like yours might be more cohesive if it
> somehow played with that.  I must confess I haven't read the patch in
> detail, especially if it has been updated, but back then there was no
> multi-file output mode from pg_dump, and now there is one.  My naive
> understanding is this would be adding a second one as-is, but I wonder
> if that is strictly necessary to fulfill the use case.

If one want to reuse the splitting to files-code of the directory
format, maybe the existing option -F d could be tweaked to output in
both a a machine-readable format (current way), and also a
human-friendly tree of files and content (like suggested by my patch).

I wonder what the option would be called then, having two chars
options is not an option I guess, maybe -F t for "tree" instead of
"directory", as the -F d option only dumps to a single directory and
not a tree-structure?

In response to

Responses

Browse pgsql-hackers by date

  From Date Subject
Next Message Andrew Dunstan 2012-05-22 00:41:59 Re: Schema version management
Previous Message Ants Aasma 2012-05-22 00:13:18 Re: Why is indexonlyscan so darned slow?