Changeset 254 for trunk

Show
Ignore:
Timestamp:
07/01/11 16:54:56 (3 years ago)
Author:
depesz
Message:

Forgot to commit.

Make fast.dump log also information about how big are the indexes on source system. This can be later used for fast.restore to order index creation properly.

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/tools/fast.dump.and.restore/fast.dump

    r253 r254  
    410410    my $self = shift; 
    411411    $self->run_command( $self->{ 'pg_dump' }, '-Fc', '-f', File::Spec->catfile( $self->{ 'output' }, 'schema.dump' ), '-s', '-v' ); 
     412 
     413    my ( $sql_fh, $sql_filename ) = tempfile( 'fast.dump.XXXXXXXX', 'TMPDIR' => 1, ); 
     414    print $sql_fh "\\o " . File::Spec->catfile( $self->{ 'output' }, 'index.sizes' ) . "\n"; 
     415    print $sql_fh 
     416        "select n.nspname, c.relname, pg_relation_size(c.oid) from pg_class c join pg_namespace n on c.relnamespace = n.oid where c.relkind = 'i' and n.nspname !~ '^pg_' order by 3 desc;\n"; 
     417    close $sql_fh; 
     418    $self->run_command( $self->{ 'psql' }, '-qAtX', '-F', "\t", '-f', $sql_filename ); 
     419 
    412420    return; 
    413421}