/[corp]/sql/Makefile
This is repository of my old source code which isn't updated any more. Go to git.rot13.org for current projects!
ViewVC logotype

Contents of /sql/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1.1.1 - (show annotations) (vendor branch)
Thu Mar 15 07:51:20 2001 UTC (21 years, 10 months ago) by dpavlin
Branch: DbP
CVS Tags: r1
Changes since 1.1: +0 -0 lines
initial import

1 db=corp
2 portal=portal.pliva.hr
3
4 all:
5 @echo dump,create,drop,insert,fill
6
7 dump:
8 pg_dump $(db) > $(db).sql
9
10 create:
11 createdb $(db)
12 drop:
13 psql -c "drop database $(db)" template1
14
15 insert:
16 # psql $(db) < $(db).sql
17 cat $(db).sql | sed 's/::text//' | sed 's/::bool//' | psql $(db)
18
19 fill: drop create insert
20
21 fill2:
22 psql -c "drop database $(db)2" template1
23 createdb $(db)2
24 cat $(db).sql | sed 's/::text//' | sed 's/::bool//' | psql $(db)2
25
26 dist:
27 psql -h $(portal) -c "drop database $(db)" template1
28 psql -h $(portal) -c "create database $(db)" template1
29 pg_dump $(db) | sed 's/::text//' | sed 's/::bool//' | sed 's/ \([01][0-9]\)-\([0123][0-9]\)-\([12][0-9][0-9][0-9]\) / \2-\1-\3 /g' | sed 's,/usr/lib/pgsql/,/usr/lib/postgresql/lib/,g' | psql -h $(portal) $(db)
30
31 dist2:
32 pg_dump $(db) | sed 's/::text//' | sed 's/::bool//' > $(db)-dist.sql
33 scp $(db)-dist.sql $(portal):/tmp
34 ssh $(portal) 'psql -c "drop database $(db)" template1 ; createdb $(db); cd /tmp ; psql $(db) < $(db)-dist.sql'
35

  ViewVC Help
Powered by ViewVC 1.1.26