repo.or.cz
/
PostgreSQL.git
/
blob
commit
grep
author
committer
pickaxe
?
search:
re
summary
|
log
|
graphiclog1
|
graphiclog2
|
commit
|
commitdiff
|
tree
|
refs
|
edit
|
fork
blame
|
history
|
raw
|
HEAD
Fix pg_dump bug in the database-level collation patch. "datcollate" and
[PostgreSQL.git]
/
contrib
/
seg
/
sort-segments.pl
blob
1205d3b972275ee909808926267d0b5277fb2654
1
#!/usr/bin/perl
2
3
# this script will sort any table with the segment data type in its last column
4
5
while
(<>) {
6
chomp
;
7
push
@rows
,
$_
;
8
}
9
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
"
;;
20
}