1
0
mirror of https://github.com/postgres/postgres.git synced 2025-07-28 23:42:10 +03:00

Gene Selkov's SEG datatype (GiST example code)

This commit is contained in:
Tom Lane
2000-12-11 20:40:33 +00:00
parent 9892ddf5ee
commit a3694b420f
14 changed files with 6076 additions and 0 deletions

20
contrib/seg/sort-segments.pl Executable file
View File

@ -0,0 +1,20 @@
#!/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";;
}