Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git] / contrib / seg / sort-segments.pl
blob1205d3b972275ee909808926267d0b5277fb2654
1 #!/usr/bin/perl
3 # this script will sort any table with the segment data type in its last column
5 while (<>) {
6 chomp;
7 push @rows, $_;
10 foreach ( sort {
11 @ar = split("\t", $a);
12 $valA = pop @ar;
13 $valA =~ s/[~<> ]+//g;
14 @ar = split("\t", $b);
15 $valB = pop @ar;
16 $valB =~ s/[~<> ]+//g;
17 $valA <=> $valB
18 } @rows ) {
19 print "$_\n";;