mirror of
https://github.com/sourcegraph/sourcegraph.git
synced 2026-02-06 19:21:50 +00:00
Ignore system psqlrc and local .psqlrc when dropping test databases (#22315)
Depending on your particular .psqlrc customizations, omitting the -X flag from psql invocations may include formatting details in the output: # psql -c 'copy (select 1) to stdout' Border style is 2. Line style is unicode. 1 Time: 0.553 ms That disrupts downstream tools like grep. The -X flag skips reading the system psqlrc and local .psqlrc file, which fixes the issue: # psql -Xc 'copy (select 1) to stdout' 1
This commit is contained in:
parent
d307934704
commit
4e7c93b3c6
@ -2,7 +2,7 @@
|
||||
|
||||
set -eo pipefail
|
||||
|
||||
for dbname in $(psql -c "copy (select datname from pg_database where datname like 'sourcegraph-test-%') to stdout"); do
|
||||
for dbname in $(psql -Xc "copy (select datname from pg_database where datname like 'sourcegraph-test-%') to stdout"); do
|
||||
dropdb "$dbname"
|
||||
echo "dropped $dbname"
|
||||
done
|
||||
|
||||
Loading…
Reference in New Issue
Block a user