root/bin/pg_version @ 8600
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")" |