/[pliva-si]/.data/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 /.data/sql/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.1 - (show annotations)
Fri Jun 29 22:43:27 2001 UTC (22 years, 9 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
perm, .data dir

1 db=plivasi
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 dump-shema:
11 pg_dump -s $(db) > $(db)-shema.sql
12
13 create:
14 createdb $(db)
15 drop:
16 psql -c "drop database $(db)" template1
17
18 insert:
19 # psql $(db) < $(db).sql
20 cat $(db).sql | sed 's/::text//' | sed 's/::bool//' | psql $(db)
21
22 fill: drop create insert
23
24 fill2:
25 psql -c "drop database $(db)2" template1
26 createdb $(db)2
27 cat $(db).sql | sed 's/::text//' | sed 's/::bool//' | psql $(db)2
28
29 dist2portal:
30 # psql -h $(portal) -c "drop database $(db)" template1
31 # psql -h $(portal) -c "create database $(db)" template1
32 # 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)
33
34 dist2test:
35 psql -c "drop database $(db)" template1
36 psql -c "create database $(db)" template1
37
38 # pg_dump -h $(portal) $(db) | \
39
40 ssh portal "pg_dump $(db)" | \
41 sed -e 's/::"*text"*//gi' -e 's/::"*bool"*//gi' -e 's/::"*varchar"*//gi' -e 's/::"*bpchar"*//gi' |\
42 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 $(db)
43
44

  ViewVC Help
Powered by ViewVC 1.1.26