Project

General

Profile

« Previous | Next » 

Revision 2616

Added pg_version

View differences:

bin/pg_version
1
#!/bin/sh
2
# Gets the local PostgreSQL server's major (and optionally, minor) version.
3
# Usage: env [minor=1] self
4

  
5
sedEreFlag="$(test "$(uname)" = Darwin && echo E || echo r)"
6

  
7
sed () { "$(which sed)" -"$sedEreFlag" "$@";}
8

  
9
echo "$(pg_dump --version|sed -n "s/^.* ([0-9]+${minor:+\.[0-9]+}).*\$/\1/p")"
0 10

  

Also available in: Unified diff