OSDN Git Service

Allow psql multi-line column values to align in the proper columns
authorBruce Momjian <bruce@momjian.us>
Fri, 10 Feb 2006 00:39:04 +0000 (00:39 +0000)
committerBruce Momjian <bruce@momjian.us>
Fri, 10 Feb 2006 00:39:04 +0000 (00:39 +0000)
commitc01999a557b5c9ae200a95024539b823dbcfacd5
tree2e9c7fdc2c0a5042821d98e376d7377230309d1b
parent593763c086e76159cc9562e9b024ad772af9d5fe
Allow psql multi-line column values to align in the proper columns

  If the second output column value is 'a\nb', the 'b' should appear
  in the second display column, rather than the first column as it
  does now.

Change libpq's PQdsplen() to return more useful values.

> Note: this changes the PQdsplen function, it can now return zero or
> minus one which was not possible before. It doesn't appear anyone is
> actually using the functions other than psql but it is a change. The
> functions are not actually documentated anywhere so it's not like we're
> breaking a defined interface. The new semantics follow the Unicode
> standard.

BACKWARD COMPATIBLE CHANGE.

The only user-visible change I saw in the regression tests is that a
SELECT * on a table where all the columns have been dropped doesn't
return a blank line like before.  This seems like a step forward.

Martijn van Oosterhout
src/backend/utils/mb/wchar.c
src/bin/psql/mbprint.c
src/bin/psql/mbprint.h
src/bin/psql/print.c
src/test/regress/expected/alter_table.out
src/test/regress/expected/prepare.out