10000 Fix omission of -X (--no-psqlrc) in some psql invocations. · home201448/postgres@870df2b · GitHub
[go: up one dir, main page]

Skip to content

Commit 870df2b

Browse files
committed
Fix omission of -X (--no-psqlrc) in some psql invocations.
As of commit d5563d7, psql -c no longer implies -X, but not all of our regression testing scripts had gotten that memo. To ensure consistency of results across different developers, make sure that *all* invocations of psql in all scripts in our tree use -X, even where this is not what previously happened. Michael Paquier and Tom Lane
1 parent 151c4ff commit 870df2b

File tree

9 files changed

+21
-21
lines changed
  • koi8-r
  • koi8-to-win1251
  • mb
  • ssl/t
  • tools
  • 9 files changed

    +21
    -21
    lines changed

    contrib/sepgsql/test_sepgsql

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -233,7 +233,7 @@ echo "ok"
    233233

    234234
    # loadable module must be installed and not configured to permissive mode
    235235
    echo -n "checking sepgsql installation ... "
    236-
    VAL="`${CMD_PSQL} -t -c 'SHOW sepgsql.permissive' template1 2>/dev/null`"
    236+
    VAL="`${CMD_PSQL} -X -t -c 'SHOW sepgsql.permissive' template1 2>/dev/null`"
    237237
    RETVAL="$?"
    238238
    if [ $RETVAL -eq 2 ]; then
    239239
    echo "failed"
    @@ -266,7 +266,7 @@ echo "ok"
    266266
    # NOTE: this test is wrong; we really ought to be checking template0.
    267267
    # But we can't connect to that without extra pushups, and it's not worth it.
    268268
    echo -n "checking for labels in template1 ... "
    269-
    NUM=`${CMD_PSQL} -At -c 'SELECT count(*) FROM pg_catalog.pg_seclabel' template1 2>/dev/null`
    269+
    NUM=`${CMD_PSQL} -XAt -c 'SELECT count(*) FROM pg_catalog.pg_seclabel' template1 2>/dev/null`
    270270
    if [ -z "${NUM}" ]; then
    271271
    echo "failed"
    272272
    echo ""

    src/bin/pg_upgrade/test.sh

    Lines changed: 2 additions & 2 deletions
    Original file line numberDiff line numberDiff line change
    @@ -156,7 +156,7 @@ standard_initdb "$oldbindir"/initdb
    156156
    if "$MAKE" -C "$oldsrc" installcheck; then
    157157
    pg_dumpall -f "$temp_root"/dump1.sql || pg_dumpall1_status=$?
    158158
    if [ "$newsrc" != "$oldsrc" ]; then
    159-
    oldpgversion=`psql -A -t -d regression -c "SHOW server_version_num"`
    159+
    oldpgversion=`psql -X -A -t -d regression -c "SHOW server_version_num"`
    160160
    fix_sql=""
    161161
    case $oldpgversion in
    162162
    804??)
    @@ -169,7 +169,7 @@ if "$MAKE" -C "$oldsrc" installcheck; then
    169169
    fix_sql="UPDATE pg_proc SET probin = replace(probin, '$oldsrc', '$newsrc') WHERE probin LIKE '$oldsrc%';"
    170170
    ;;
    171171
    esac
    172-
    psql -d regression -c "$fix_sql;" || psql_fix_sql_status=$?
    172+
    psql -X -d regression -c "$fix_sql;" || psql_fix_sql_status=$?
    173173

    174174
    mv "$temp_root"/dump1.sql "$temp_root"/dump1.sql.orig
    175175
    sed "s;$oldsrc;$newsrc;g" " ED48 $temp_root"/dump1.sql.orig >"$temp_root"/dump1.sql

    src/test/locale/de_DE.ISO8859-1/runall

    Lines changed: 5 additions & 5 deletions
    Original file line numberDiff line numberDiff line change
    @@ -37,8 +37,8 @@ for f in char varchar text; do
    3737

    3838
    dropdb testlocale >/dev/null 2>&1
    3939
    createdb testlocale || abort "createdb failed"
    40-
    psql -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    41-
    psql testlocale < test-de.sql.in > test-de-$f.sql.out 2>/dev/null || abort "test query failed"
    40+
    psql -X -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    41+
    psql -X testlocale < test-de.sql.in > test-de-$f.sql.out 2>/dev/null || abort "test query failed"
    4242
    diff expected/test-de-$f.sql.out test-de-$f.sql.out
    4343
    done
    4444

    @@ -52,13 +52,13 @@ for f in char varchar text; do
    5252

    5353
    dropdb testlocale >/dev/null 2>&1
    5454
    createdb testlocale || abort "createdb failed"
    55-
    psql -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    56-
    psql testlocale < test-de-upper.sql.in > test-de-upper-$f.sql.out 2>/dev/null || abort "test query failed"
    55+
    psql -X -d testlocale -c "CREATE TABLE wordlist (name_en char(20), name_de $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    56+
    psql -X testlocale < test-de-upper.sql.in > test-de-upper-$f.sql.out 2>/dev/null || abort "test query failed"
    5757
    diff expected/test-de-upper-$f.sql.out test-de-upper-$f.sql.out
    5858
    done
    5959

    6060
    echo "Testing PgSQL: select on regexp..."
    61-
    psql testlocale < test-de-select.sql.in > test-de-select.sql.out 2>/dev/null || abort "select query failed"
    61+
    psql -X testlocale < test-de-select.sql.in > test-de-select.sql.out 2>/dev/null || abort "select query failed"
    6262
    diff expected/test-de-select.sql.out test-de-select.sql.out
    6363
    dropdb testlocale || abort "dropdb failed"
    6464
    echo "Finished."

    src/test/locale/gr_GR.ISO8859-7/runall

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -38,12 +38,12 @@ for f in char varchar text; do
    3838

    3939
    dropdb testlocale >/dev/null 2>&1
    4040
    createdb testlocale || abort "createdb failed"
    41-
    psql -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_gr $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    42-
    psql testlocale < test-gr.sql.in > test-gr-$f.sql.out 2>/dev/null || abort "test query failed"
    41+
    psql -X -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_gr $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    42+
    psql -X testlocale < test-gr.sql.in > test-gr-$f.sql.out 2>/dev/null || abort "test query failed"
    4343
    diff expected/test-gr-$f.sql.out test-gr-$f.sql.out
    4444
    done
    4545
    echo "Testing PgSQL: select on regexp..."
    46-
    psql testlocale < test-gr-select.sql.in > test-gr-select.sql.out 2>/dev/null || abort "select query failed"
    46+
    psql -X testlocale < test-gr-select.sql.in > test-gr-select.sql.out 2>/dev/null || abort "select query failed"
    4747
    diff expected/test-gr-select.sql.out test-gr-select.sql.out
    4848
    dropdb testlocale || abort "dropdb failed"
    4949
    echo "Finished."

    src/test/locale/koi8-r/runall

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -38,12 +38,12 @@ for f in char varchar text; do
    3838

    3939
    dropdb testlocale >/dev/null 2>&1
    4040
    createdb testlocale || abort "createdb failed"
    41-
    psql -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    42-
    psql testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
    41+
    psql -X -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    42+
    psql -X testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
    4343
    diff expected/test-koi8-$f.sql.out test-koi8-$f.sql.out
    4444
    done
    4545
    echo "Testing PgSQL: select on regexp..."
    46-
    psql testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
    46+
    psql -X testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
    4747
    diff expected/test-koi8-select.sql.out test-koi8-select.sql.out
    4848
    dropdb testlocale || abort "dropdb failed"
    4949
    echo "Finished."

    src/test/locale/koi8-to-win1251/runall

    Lines changed: 3 additions & 3 deletions
    Original file line numberDiff line numberDiff line change
    @@ -35,12 +35,12 @@ for f in char varchar text; do
    3535

    3636
    dropdb testlocale >/dev/null 2>&1
    3737
    createdb testlocale || abort "createdb failed"
    38-
    psql -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    39-
    psql testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
    38+
    psql -X -d testlocale -c "CREATE TABLE usastates (abbrev char(2), name_en char(20), name_ru $ftype);" >/dev/null 2>&1 || abort "createtable failed"
    39+
    psql -X testlocale < test-koi8.sql.in > test-koi8-$f.sql.out 2>/dev/null || abort "test query failed"
    4040
    diff expected/test-koi8-$f.sql.out test-koi8-$f.sql.out
    4141
    done
    4242
    echo "Testing PgSQL: select on regexp..."
    43-
    psql testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
    43+
    psql -X testlocale < test-koi8-select.sql.in > test-koi8-select.sql.out 2>/dev/null || abort "select query failed"
    4444
    diff expected/test-koi8-select.sql.out test-koi8-select.sql.out
    4545
    dropdb testlocale || abort "dropdb failed"
    4646
    echo "Finished."

    src/test/mb/mbregress.sh

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -17,7 +17,7 @@ fi
    1717
    dropdb --if-exists utf8
    1818
    createdb -T template0 -l C -E UTF8 utf8 || exit 1
    1919

    20-
    PSQL="psql -n -e -q"
    20+
    PSQL="psql -X -n -e -q"
    2121

    2222
    # in the test list, client-only encodings must follow the server encoding
    2323
    # they're to be tested with; see hard-coded cases below

    src/test/ssl/t/001_ssltests.pl

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -37,7 +37,7 @@ sub run_test_psql
    3737
    my $logstring = $_[1];
    3838

    3939
    my $cmd = [
    40-
    'psql', '-A', '-t', '-c', "SELECT 'connected with $connstr'",
    40+
    'psql', '-X', '-A', '-t', '-c', "SELECT 'connected with $connstr'",
    4141
    '-d', "$connstr" ];
    4242

    4343
    my $result = run_log($cmd);

    src/tools/find_static

    Lines changed: 1 addition & 1 deletion
    Original file line numberDiff line numberDiff line change
    @@ -47,4 +47,4 @@ echo "
    4747
    from debug2
    4848
    where scope = 'T' and func != 'main'
    4949
    order by file, func;
    50-
    " |psql debug
    50+
    " |psql -X debug

    0 commit comments

    Comments
     (0)
    0