|
1 |
| -#!/usr/bin/perl -w |
| 1 | +#!/usr/bin/perl |
2 | 2 | #----------------------------------------------------------------------
|
3 | 3 | #
|
4 | 4 | # reformat_dat_file.pl
|
5 |
| -# Perl script that reads in a catalog data file and writes out |
6 |
| -# a functionally equivalent file in a standard format. |
| 5 | +# Perl script that reads in catalog data file(s) and writes out |
| 6 | +# functionally equivalent file(s) in a standard format. |
7 | 7 | #
|
8 |
| -# Metadata entries (if any) come first, with normal attributes |
9 |
| -# starting on the following line, in the same order they would be in |
10 |
| -# the corresponding table. Comments and blank lines are preserved. |
| 8 | +# In each entry of a reformatted file, metadata fields (if any) come |
| 9 | +# first, with normal attributes starting on the following line, in |
| 10 | +# the same order as the columns of the corresponding catalog. |
| 11 | +# Comments and blank lines are preserved. |
11 | 12 | #
|
12 | 13 | # Portions Copyright (c) 1996-2018, PostgreSQL Global Development Group
|
13 | 14 | # Portions Copyright (c) 1994, Regents of the University of California
|
|
16 | 17 | #
|
17 | 18 | #----------------------------------------------------------------------
|
18 | 19 |
|
19 |
| -use Catalog; |
20 |
| - |
21 | 20 | use strict;
|
22 | 21 | use warnings;
|
23 | 22 |
|
| 23 | +# If you copy this script to somewhere other than src/include/catalog, |
| 24 | +# you'll need to modify this "use lib" or provide a suitable -I switch. |
| 25 | +use FindBin; |
| 26 | +use lib "$FindBin::RealBin/../../backend/catalog/"; |
| 27 | +use Catalog; |
| 28 | + |
24 | 29 | my @input_files;
|
25 | 30 | my $output_path = '';
|
26 | 31 | my $full_tuples = 0;
|
@@ -293,13 +298,10 @@ sub usage
|
293 | 298 | Usage: reformat_dat_file.pl [options] datafile...
|
294 | 299 |
|
295 | 300 | Options:
|
296 |
| - -o output path |
| 301 | + -o PATH write output files to PATH instead of current directory |
297 | 302 | --full-tuples write out full tuples, including default values
|
298 | 303 |
|
299 | 304 | Expects a list of .dat files as arguments.
|
300 | 305 |
|
301 |
| -Make sure location of Catalog.pm is passed to the perl interpreter: |
302 |
| -perl -I /path/to/Catalog.pm/ ... |
303 |
| -
|
304 | 306 | EOM
|
305 | 307 | }
|
0 commit comments