mirror of
https://github.com/YunoHost-Apps/noalyss_ynh.git
synced 2024-09-03 19:46:20 +02:00
29 lines
410 B
Bash
29 lines
410 B
Bash
|
#!/bin/bash
|
||
|
#
|
||
|
#
|
||
|
# Author Dany De Bontridder
|
||
|
# Under the GPL 2 minimun
|
||
|
#
|
||
|
Help () {
|
||
|
cat <<_eof
|
||
|
$0 [option] database
|
||
|
-f function only
|
||
|
-t table only
|
||
|
_eof
|
||
|
}
|
||
|
|
||
|
|
||
|
if [ $# -lt 2 ]; then
|
||
|
Help
|
||
|
fi
|
||
|
|
||
|
case "$1" in
|
||
|
-f)
|
||
|
pg_dump -s "$2"|awk '/CREATE FUNCTION/,/LANGUAGE/ { print $0;}'
|
||
|
;;
|
||
|
-t)
|
||
|
pg_dump -s "$2"| awk '/CREATE TABLE/,/;/ { print $0;}'
|
||
|
pg_dump -s "$2"| awk '/ALTER TABLE/,/;/ { print $0;}'
|
||
|
;;
|
||
|
esac
|