Changeset 253

Show
Ignore:
Timestamp:
06/27/11 21:32:20 (3 years ago)
Author:
depesz
Message:

make the dumps self-contained sql scripts, not just dummy files

Files:

Legend:

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

    r252 r253  
    139139    if ( $blob->{ 'blob_type' } eq 'partial' ) { 
    140140        print $sql_fh "set enable_seqscan = false;\n"; 
     141        printf $sql_fh "SELECT 'COPY %s FROM STDIN;';\n", $blob->{ 'full_name' }; 
    141142        printf $sql_fh 'COPY (SELECT * FROM %s WHERE %s) TO stdout;%s', $blob->{ 'full_name' }, $blob->{ 'condition' }, "\n"; 
     143        printf $sql_fh "SELECT E'\\\\.'\n"; 
    142144        $PROGRAM_NAME = 'Partial dump of ' . $blob->{ 'full_name' }; 
    143145    } 
    144146    else { 
     147        printf $sql_fh "SELECT 'COPY %s FROM STDIN;';\n", $blob->{ 'full_name' }; 
    145148        printf $sql_fh 'COPY %s TO stdout;%s', $blob->{ 'full_name' }, "\n"; 
     149        printf $sql_fh "SELECT E'\\\\.'\n"; 
    146150        $PROGRAM_NAME = 'Full dump of ' . $blob->{ 'full_name' }; 
    147151    }