Skip to content

Commit

Permalink
Merge pull request #749 from arp242/psqlrc
Browse files Browse the repository at this point in the history
pgsql: add -X to psql commands to prevent loading ~/.psqlrc
  • Loading branch information
syohex committed Jun 3, 2020
2 parents 3eea79e + f371431 commit 3b247d3
Showing 1 changed file with 5 additions and 5 deletions.
10 changes: 5 additions & 5 deletions src/_pgsql_utils
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,7 @@ _pgsql_users () {

_pgsql_user_sql='select r.rolname from pg_catalog.pg_roles r where r.rolcanlogin = true'

compadd "$@" - $( psql $_pgsql_params[@] -Aqt -c $_pgsql_user_sql template1 2>/dev/null )
compadd "$@" - $( psql $_pgsql_params[@] -XAqt -c $_pgsql_user_sql template1 2>/dev/null )

}

Expand Down Expand Up @@ -122,7 +122,7 @@ _pgsql_tables () {
order by 1"

compadd "$@" - \
$( psql $_pgsql_params[@] -Aqt -c $_pgsql_table_sql $db 2>/dev/null )
$( psql $_pgsql_params[@] -AXqt -c $_pgsql_table_sql $db 2>/dev/null )
}

_pgsql_schemas () {
Expand All @@ -139,7 +139,7 @@ _pgsql_schemas () {
order by 1;"

compadd "$@" - \
$( psql $_pgsql_params[@] -Aqt -c $_pgsql_schema_sql $db 2>/dev/null )
$( psql $_pgsql_params[@] -AXqt -c $_pgsql_schema_sql $db 2>/dev/null )
}

_pgsql_databases () {
Expand All @@ -159,7 +159,7 @@ _pgsql_databases () {

compadd "$@" - \
${(f)_pgsql_services} \
$( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 2>/dev/null )
$( psql $_pgsql_params[@] -AXtq -c $_pgsql_db_sql template1 2>/dev/null )
}

_pgsql_encodings () {
Expand All @@ -169,7 +169,7 @@ _pgsql_encodings () {
local _pgsql_db_sql
_pgsql_db_sql="select pg_encoding_to_char(i) from generate_series(0,100) i;"

compadd "$@" - $( psql $_pgsql_params[@] -Atq -c $_pgsql_db_sql template1 )
compadd "$@" - $( psql $_pgsql_params[@] -AXtq -c $_pgsql_db_sql template1 )
}


Expand Down

0 comments on commit 3b247d3

Please sign in to comment.