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

Diff of /sql/Makefile

Parent Directory Parent Directory | Revision Log Revision Log | View Patch Patch

revision 1.1.1.1 by dpavlin, Thu Mar 15 07:51:20 2001 UTC revision 1.2 by dpavlin, Thu Jun 7 08:45:53 2001 UTC
# Line 7  all: Line 7  all:
7  dump:  dump:
8          pg_dump $(db) > $(db).sql          pg_dump $(db) > $(db).sql
9    
10    dump-shema:
11            pg_dump -s $(db) > $(db)-shema.sql
12    
13  create:  create:
14          createdb $(db)          createdb $(db)
15  drop:  drop:
# Line 23  fill2: Line 26  fill2:
26          createdb $(db)2          createdb $(db)2
27          cat $(db).sql | sed 's/::text//' | sed 's/::bool//' | psql $(db)2          cat $(db).sql | sed 's/::text//' | sed 's/::bool//' | psql $(db)2
28    
29  dist:  dist2portal:
30          psql -h $(portal) -c "drop database $(db)" template1  #       psql -h $(portal) -c "drop database $(db)" template1
31          psql -h $(portal) -c "create database $(db)" template1  #       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)  #       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  dist2:  dist2test:
35          pg_dump $(db) | sed 's/::text//' | sed 's/::bool//' > $(db)-dist.sql          psql -c "drop database $(db)" template1
36          scp $(db)-dist.sql $(portal):/tmp          psql -c "create database $(db)" template1
37          ssh $(portal) 'psql -c "drop database $(db)" template1 ; createdb $(db); cd /tmp ; psql $(db) < $(db)-dist.sql'  
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    

Legend:
Removed from v.1.1.1.1  
changed lines
  Added in v.1.2

  ViewVC Help
Powered by ViewVC 1.1.26