Adapt to Postgresl 9
This commit is contained in:
parent
8c1e344cce
commit
c9666486c9
13 changed files with 48 additions and 10632 deletions
|
|
@ -1,4 +1,5 @@
|
|||
pg_dump -O -U dany -s ${DOMAIN}mod1|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
|
||||
pg_dump -O -U dany -s rel671dossier10104|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
|
||||
# pg_dump -O -U dany -s ${DOMAIN}mod1|grep -v "COMMENT ON SCHEMA public IS 'Standard public schema';" |sed "/^--/d" > schema.sql
|
||||
awk '/SEQUENCE/,/;/ { print $0;}' < schema.sql > sequence.sql
|
||||
awk '/CREATE DOMAIN/,/;/ { print $0;}' < schema.sql > table.sql
|
||||
awk '/CREATE TABLE/,/;/ { print $0;}' < schema.sql >> table.sql
|
||||
|
|
@ -13,14 +14,17 @@ echo "SET search_path = public, pg_catalog;"
|
|||
|
||||
|
||||
awk '/ALTER TABLE/,/;/ { print $0;}' < schema.sql >> constraint.sql
|
||||
awk '/COMMENT ON CONSTRAINT/,/;/ { print $0;}' < schema.sql >> constraint.sql
|
||||
|
||||
# function in XML
|
||||
## awk 'BEGIN{print "<PROCEDURES>";} /CREATE FUNCTION/,/\$\$;/ { if (/CREATE FUNCTION/) {print "<procedure>";} if (/\$\$;/) {print "</procedure>";} print $0;} END { print "</PROCEDURES>";}' < schema.sql
|
||||
awk '/CREATE FUNCTION/,/\$\$;/ { print $0;}' < schema.sql > function.sql
|
||||
awk '/COMMENT/,/;/ {print $0;}' < schema.sql > comment.sql
|
||||
|
||||
sed -i -e "/ALTER TABLE.*/d" -e "/ADD CONSTRAINT/d" -e "/CREATE PROCEDURAL/d" schema.sql
|
||||
sed -i -e "/ALTER TABLE.*/d" -e "/COMMENT ON CONSTRAINT/d" -e "/ADD CONSTRAINT/d" -e "/CREATE PROCEDURAL/d" schema.sql
|
||||
|
||||
grep setval schema.sql >> sequence.sql
|
||||
pg_dump -O -U dany --data-only --column-inserts -O ${DOMAIN}mod1 |sed "/^--/d" > data.sql
|
||||
echo "set search_path = public, comptaproc,pg_catalog ;" > data.sql
|
||||
pg_dump -O -U dany --data-only --column-inserts -O ${DOMAIN}mod1 |sed "/^--/d" | sed -e "/SET search_path/d" >> data.sql
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue