mirror of
https://github.com/postgres/postgres.git
synced 2025-08-02 09:26:47 +03:00
config
contrib
adddepend
adminpack
btree_gin
btree_gist
chkpass
citext
cube
dbase
dblink
dbmirror
dict_int
dict_xsyn
earthdistance
fulltextindex
fuzzystrmatch
hstore
intagg
intarray
isbn_issn
isn
lo
ltree
mSQL-interface
mac
oid2name
oracle
pageinspect
pg_archivecleanup
pg_buffercache
pg_freespacemap
pg_standby
pg_stat_statements
pg_trgm
pg_upgrade
pgbench
pgcrypto
pgrowlocks
pgstattuple
seg
data
expected
sql
.gitignore
Makefile
README.seg
seg-validate.pl
seg.c
seg.sql.in
segdata.h
segparse.y
segscan.l
sort-segments.pl
spi
sslinfo
start-scripts
tablefunc
test_parser
tips
tsearch2
unaccent
userlock
vacuumlo
xml2
Makefile
README
contrib-global.mk
doc
src
.gitignore
COPYRIGHT
GNUmakefile.in
Makefile
README
README.git
aclocal.m4
configure
configure.in
21 lines
346 B
Perl
Executable File
21 lines
346 B
Perl
Executable File
#!/usr/bin/perl
|
|
|
|
# this script will sort any table with the segment data type in its last column
|
|
|
|
while (<>) {
|
|
chomp;
|
|
push @rows, $_;
|
|
}
|
|
|
|
foreach ( sort {
|
|
@ar = split("\t", $a);
|
|
$valA = pop @ar;
|
|
$valA =~ s/[~<> ]+//g;
|
|
@ar = split("\t", $b);
|
|
$valB = pop @ar;
|
|
$valB =~ s/[~<> ]+//g;
|
|
$valA <=> $valB
|
|
} @rows ) {
|
|
print "$_\n";;
|
|
}
|