diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml index d9a455ba8bfe3dc63672477eab6b84c94cf69c0b..dc8a4819dfe14e6f879e75bba9cab0f6c84b8845 100644 --- a/doc/src/sgml/ref/psql-ref.sgml +++ b/doc/src/sgml/ref/psql-ref.sgml @@ -1,5 +1,5 @@ <!-- -$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.234 2009/11/22 22:06:30 tgl Exp $ +$PostgreSQL: pgsql/doc/src/sgml/ref/psql-ref.sgml,v 1.235 2009/11/25 20:26:30 tgl Exp $ PostgreSQL documentation --> @@ -1785,6 +1785,7 @@ lo_import 152801 or <literal>unicode</literal>. Unique abbreviations are allowed. (That would mean one letter is enough.) + The default setting is <literal>ascii</>. This option only affects the <literal>aligned</> and <literal>wrapped</> output formats. </para> @@ -1826,12 +1827,6 @@ lo_import 152801 Plain <acronym>ASCII</acronym> characters work everywhere, but Unicode characters look nicer on displays that recognize them. </para> - - <para> - If this option has not been set, the default behavior is to use - <literal>unicode</literal> style if the client character set encoding - is UTF-8, otherwise <literal>ascii</literal> style. - </para> </listitem> </varlistentry> diff --git a/doc/src/sgml/release-8.5.sgml b/doc/src/sgml/release-8.5.sgml index 95a940fa52ec759ad6ed88c807fe8e7e4e3fb5c0..5471a42375a7e59e38d30e7f8a9761bc8622d88a 100644 --- a/doc/src/sgml/release-8.5.sgml +++ b/doc/src/sgml/release-8.5.sgml @@ -1,4 +1,4 @@ -<!-- $PostgreSQL: pgsql/doc/src/sgml/release-8.5.sgml,v 1.6 2009/10/21 19:43:06 petere Exp $ --> +<!-- $PostgreSQL: pgsql/doc/src/sgml/release-8.5.sgml,v 1.7 2009/11/25 20:26:31 tgl Exp $ --> <sect1 id="release-8-5"> <title>Release 8.5alpha2</title> @@ -410,8 +410,7 @@ <emphasis>Add "pset linestyle ascii/unicode" option to psql, allowing our traditional ASCII-art style of table output to be upgraded to use Unicode box drawing characters if - desired. By default, psql will use the Unicode characters - whenever client_encoding is UTF8.</> + desired. </para> </listitem> <listitem> diff --git a/src/bin/psql/mbprint.c b/src/bin/psql/mbprint.c index 2999d56ef6f725b44119c8f08832882ab324a992..6671b0a98b9c9b24aec40a15cf70b6775d49ec0a 100644 --- a/src/bin/psql/mbprint.c +++ b/src/bin/psql/mbprint.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.36 2009/10/13 21:04:01 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/mbprint.c,v 1.37 2009/11/25 20:26:31 tgl Exp $ * * XXX this file does not really belong in psql/. Perhaps move to libpq? * It also seems that the mbvalidate function is redundant with existing @@ -30,7 +30,7 @@ typedef unsigned int pg_wchar; -int +static int pg_get_utf8_id(void) { static int utf8_id = -1; diff --git a/src/bin/psql/mbprint.h b/src/bin/psql/mbprint.h index 4d5376c7cd60a2dd559d0acb3d6a253d1da67811..4e9d933c945e29dc84c2b140848e2b11c382e1f8 100644 --- a/src/bin/psql/mbprint.h +++ b/src/bin/psql/mbprint.h @@ -1,4 +1,4 @@ -/* $PostgreSQL: pgsql/src/bin/psql/mbprint.h,v 1.14 2009/10/13 21:04:01 tgl Exp $ */ +/* $PostgreSQL: pgsql/src/bin/psql/mbprint.h,v 1.15 2009/11/25 20:26:31 tgl Exp $ */ #ifndef MBPRINT_H #define MBPRINT_H @@ -9,7 +9,6 @@ struct lineptr int width; }; -extern int pg_get_utf8_id(void); extern unsigned char *mbvalidate(unsigned char *pwcs, int encoding); extern int pg_wcswidth(const unsigned char *pwcs, size_t len, int encoding); extern void pg_wcsformat(unsigned char *pwcs, size_t len, int encoding, struct lineptr * lines, int count); diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c index b7fdc4779452235844383d6b6a4e485fb7f9399d..6c21c1628ddd1c4568e121cd7e8150b58380c890 100644 --- a/src/bin/psql/print.c +++ b/src/bin/psql/print.c @@ -3,7 +3,7 @@ * * Copyright (c) 2000-2009, PostgreSQL Global Development Group * - * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.118 2009/11/22 05:20:41 tgl Exp $ + * $PostgreSQL: pgsql/src/bin/psql/print.c,v 1.119 2009/11/25 20:26:31 tgl Exp $ */ #include "postgres_fe.h" @@ -2550,10 +2550,13 @@ setDecimalLocale(void) const printTextFormat * get_line_style(const printTableOpt *opt) { + /* + * Note: this function mainly exists to preserve the convention that + * a printTableOpt struct can be initialized to zeroes to get default + * behavior. + */ if (opt->line_style != NULL) return opt->line_style; - else if (opt->encoding == pg_get_utf8_id()) - return &pg_utf8format; else return &pg_asciiformat; } diff --git a/src/test/regress/pg_regress_main.c b/src/test/regress/pg_regress_main.c index 9dd99bc6b90d8c252c68a34831077237df9ad98c..e3d1ed3775629f0eb7c8654d7fe613063e3e25ba 100644 --- a/src/test/regress/pg_regress_main.c +++ b/src/test/regress/pg_regress_main.c @@ -11,7 +11,7 @@ * Portions Copyright (c) 1996-2009, PostgreSQL Global Development Group * Portions Copyright (c) 1994, Regents of the University of California * - * $PostgreSQL: pgsql/src/test/regress/pg_regress_main.c,v 1.7 2009/10/13 21:04:01 tgl Exp $ + * $PostgreSQL: pgsql/src/test/regress/pg_regress_main.c,v 1.8 2009/11/25 20:26:31 tgl Exp $ * *------------------------------------------------------------------------- */ @@ -59,7 +59,7 @@ psql_start_test(const char *testname, add_stringlist_item(expectfiles, expectfile); snprintf(psql_cmd, sizeof(psql_cmd), - SYSTEMQUOTE "\"%s%spsql\" -X -a -q -P linestyle=ascii -d \"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE, + SYSTEMQUOTE "\"%s%spsql\" -X -a -q -d \"%s\" < \"%s\" > \"%s\" 2>&1" SYSTEMQUOTE, psqldir ? psqldir : "", psqldir ? "/" : "", dblist->str,