Project

General

Profile

« Previous | Next » 

Revision 4544

input.Makefile: Staging tables installation: `%/install: %/create.sql`: Also log the output of commands run after create.sql

View differences:

inputs/input.Makefile
195 195

  
196 196
logInstall = $(if $(log),$(if $(quiet),&>,2>&1|tee )$(1)logs/install.log.sql)
197 197
logInstall* = $(call logInstall,$*/)
198
logInstall*Add = $(call logInstall,-a $*/)# append to log
198 199

  
199 200
# Must come before %/install to override it
200 201
sql/install: $(dbExports)
......
227 228
	($(inDatasrc); echo 'CREATE TABLE "$*" AS'; cat $<; echo ';')|"time" \
228 229
$(psqlAsBien) --echo-all --set=table='"$*"' $(logInstall*)
229 230
	-echo 'ALTER TABLE "$(datasrc)"."$*" \
230
ADD COLUMN row_num serial NOT NULL PRIMARY KEY;'|$(psqlAsBien)
231
	echo 'VACUUM ANALYZE "$(datasrc)"."$*";'|$(psqlAsBien)
231
ADD COLUMN row_num serial NOT NULL PRIMARY KEY;'|$(psqlAsBien) $(logInstall*Add)
232
	echo 'VACUUM ANALYZE "$(datasrc)"."$*";'|$(psqlAsBien) $(logInstall*Add)
232 233
	$(exportHeader)
233 234
# ignore errors if create.sql already added a primary key
234 235

  

Also available in: Unified diff