Project

General

Profile

« Previous | Next » 

Revision 6098

root Makefile: VegBIEN DB: Schemas: Run all schema installs and uninstalls using no_search_path=1, so that the schemas in the automatic search_path are not required for the command to run

View differences:

Makefile
206 206
schemasReversed := public py_functions functions temp
207 207
schemas/uninstall: $(schemasReversed:%=schemas/%/uninstall) ;
208 208

  
209
psqlNoSearchPath := env no_search_path=1 $(psqlAsBien)
210

  
209 211
### public
210 212

  
211 213
schemas/public/install: schemas/vegbien.sql _always
212
	-echo $(call mkSchemaCmd,public)|env public= $(psqlAsBien)
214
	-echo $(call mkSchemaCmd,public)|$(psqlNoSearchPath)
213 215
	<$< $(psqlAsBien)
214 216
# ignore errors if schema exists
215 217
# public schema will be owned by bien
......
217 219

  
218 220
schemas/public/uninstall: _always
219 221
	@$(confirmRmPublicSchema)
220
	echo $(rmPublicSchema)|env public= $(psqlAsBien)
222
	echo $(rmPublicSchema)|$(psqlNoSearchPath)
221 223

  
222 224
schemas/rename/%: _always
223
	echo 'ALTER SCHEMA public RENAME TO "$*";'|$(psqlAsBien)
225
	echo 'ALTER SCHEMA public RENAME TO "$*";'|$(psqlNoSearchPath)
224 226
	$(MAKE) schemas/public/install
225 227

  
226 228
schemas/rotate: _always schemas/rename/public.$(version) ;
......
228 230
### py_functions
229 231

  
230 232
schemas/py_functions/install: schemas/py_functions.sql _always
231
	-<$< $(psqlAsAdminVegbien)
233
	-<$< env public= $(psqlAsAdminVegbien)
232 234
# ignore errors if schema exists
233 235

  
234 236
### Others
235 237

  
236 238
schemas/%/install: schemas/%.sql _always
237
	-<$< $(psqlAsBien)
239
	-<$< $(psqlNoSearchPath)
238 240
# ignore errors if schema exists
239 241

  
240 242
schemas/%/uninstall: _always
241
	echo $(call rmSchemaCmd,$*)|$(psqlAsBien)
243
	echo $(call rmSchemaCmd,$*)|$(psqlNoSearchPath)
242 244

  
243 245
# Needed on Ubuntu 12.04 (also other Linuxes?) because %/reinstall is ignored.
244 246
schemas/temp/reinstall: _always schemas/temp/uninstall schemas/temp/install ;

Also available in: Unified diff