/[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

Annotation of /sql/Makefile

Parent Directory Parent Directory | Revision Log Revision Log


Revision 1.2 - (hide annotations)
Thu Jun 7 08:45:53 2001 UTC (22 years, 11 months ago) by dpavlin
Branch: MAIN
CVS Tags: HEAD
Changes since 1.1: +18 -9 lines
save only shema in CVS, script to add presentations to news table

1 dpavlin 1.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 dpavlin 1.2 dump-shema:
11     pg_dump -s $(db) > $(db)-shema.sql
12    
13 dpavlin 1.1 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 dpavlin 1.2 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 dpavlin 1.1

  ViewVC Help
Powered by ViewVC 1.1.26