Project

General

Profile

« Previous | Next » 

Revision 12800

*{.sh,run}: stderr_matches() wrapper calls: removed no longer needed prep_try/rethrow

View differences:

db.sh
362 362
	)
363 363
}
364 364

  
365
pg_schema_exists() # usage: prep_try; if schema=... pg_schema_exists; \
366
# then rethrow; ...; fi; rethrow
367
# OR prep_try; schema=... pg_schema_exists || { rethrow; ...; }; rethrow
365
pg_schema_exists() # usage: schema=... pg_schema_exists
368 366
{
369 367
	echo_func; : "${schema:?}"; mk_schema_esc
370
	prep_try; pattern='cannot create temporary relation in non-temporary schema' \
368
	pattern='cannot create temporary relation in non-temporary schema' \
371 369
ignore_e=3 stderr_matches psql <<<"CREATE TEMP TABLE $schema_esc.t ()"
372 370
}
373 371

  
......
377 375
	clog++ pg_schema_exists || die "schema $schema does not exist"
378 376
}
379 377

  
380
pg_table_exists() # usage: prep_try; if [schema=...] table=... pg_table_exists; \
381
# then rethrow; ...; fi; rethrow
382
# OR prep_try; table=... pg_table_exists || { rethrow; ...; }; rethrow
378
pg_table_exists() # usage: [schema=...] table=... pg_table_exists
383 379
{
384 380
	echo_func; : "${table:?}"; mk_table_esc
385
	prep_try; pattern='relation .* does not exist' \
381
	pattern='relation .* does not exist' \
386 382
ignore_e=3 stderr_matches psql <<<"SELECT NULL FROM $table_esc LIMIT 0"
387 383
}
388 384

  

Also available in: Unified diff