1
0
mirror of https://github.com/postgres/postgres.git synced 2025-06-25 01:02:05 +03:00

Improve psql's tabular display of wrapped-around data by inserting markers

in the formerly-always-blank columns just to left and right of the data.
Different marking is used for a line break caused by a newline in the data
than for a straight wraparound.  A newline break is signaled by a "+" in the
right margin column in ASCII mode, or a carriage return arrow in UNICODE mode.
Wraparound is signaled by a dot in the right margin as well as the following
left margin in ASCII mode, or an ellipsis symbol in the same places in UNICODE
mode.  "\pset linestyle old-ascii" is added to make the previous behavior
available if anyone really wants it.

In passing, this commit also cleans up a few regression test files that
had unintended spacing differences from the current actual output.

Roger Leigh, reviewed by Gabrielle Roth and other members of PDXPUG.
This commit is contained in:
Tom Lane
2009-11-22 05:20:41 +00:00
parent 93d3bac564
commit 1753337cf5
19 changed files with 374 additions and 260 deletions

View File

@ -829,51 +829,51 @@ DROP SERVER fdtest;
DROP FOREIGN DATA WRAPPER postgresql;
-- test asynchronous notifications
SELECT dblink_connect('dbname=contrib_regression');
dblink_connect
dblink_connect
----------------
OK
(1 row)
--should return listen
SELECT dblink_exec('LISTEN regression');
dblink_exec
dblink_exec
-------------
LISTEN
(1 row)
--should return listen
SELECT dblink_exec('LISTEN foobar');
dblink_exec
dblink_exec
-------------
LISTEN
(1 row)
SELECT dblink_exec('NOTIFY regression');
dblink_exec
dblink_exec
-------------
NOTIFY
(1 row)
SELECT dblink_exec('NOTIFY foobar');
dblink_exec
dblink_exec
-------------
NOTIFY
(1 row)
SELECT notify_name, be_pid = (select t.be_pid from dblink('select pg_backend_pid()') as t(be_pid int)) AS is_self_notify, extra from dblink_get_notify();
notify_name | is_self_notify | extra
notify_name | is_self_notify | extra
-------------+----------------+-------
regression | t |
foobar | t |
regression | t |
foobar | t |
(2 rows)
SELECT * from dblink_get_notify();
notify_name | be_pid | extra
notify_name | be_pid | extra
-------------+--------+-------
(0 rows)
SELECT dblink_disconnect();
dblink_disconnect
dblink_disconnect
-------------------
OK
(1 row)

View File

@ -17,7 +17,7 @@ CREATE TABLE ctest (data text, res text, salt text);
INSERT INTO ctest VALUES ('password', '', '');
UPDATE ctest SET salt = gen_salt('bf', 8);
UPDATE ctest SET res = crypt(data, salt);
SELECT res = crypt(data, res) AS "worked"
SELECT res = crypt(data, res) AS "worked"
FROM ctest;
worked
--------

View File

@ -6,21 +6,21 @@ SET bytea_output TO escape;
select armor('');
armor
-----------------------------
-----BEGIN PGP MESSAGE-----
=twTO
-----END PGP MESSAGE-----
-----BEGIN PGP MESSAGE-----+
+
=twTO +
-----END PGP MESSAGE----- +
(1 row)
select armor('test');
armor
-----------------------------
-----BEGIN PGP MESSAGE-----
dGVzdA==
=+G7Q
-----END PGP MESSAGE-----
-----BEGIN PGP MESSAGE-----+
+
dGVzdA== +
=+G7Q +
-----END PGP MESSAGE----- +
(1 row)
@ -40,12 +40,12 @@ select armor('0123456789abcdef0123456789abcdef0123456789abcdef
0123456789abcdef0123456789abcdef0123456789abcdef');
armor
------------------------------------------------------------------------------
-----BEGIN PGP MESSAGE-----
MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmCjAxMjM0NTY3
ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmMDEyMzQ1Njc4OWFiY2RlZg==
=JFw5
-----END PGP MESSAGE-----
-----BEGIN PGP MESSAGE----- +
+
MDEyMzQ1Njc4OWFiY2RlZjAxMjM0NTY3ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmCjAxMjM0NTY3+
ODlhYmNkZWYwMTIzNDU2Nzg5YWJjZGVmMDEyMzQ1Njc4OWFiY2RlZg== +
=JFw5 +
-----END PGP MESSAGE----- +
(1 row)

View File

@ -11,7 +11,7 @@ yA6Ce1QTMK3KdL2MPfamsTUSAML8huCJMwYQFfE=
=JcP+
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -25,7 +25,7 @@ UTAsG35A1vYs02VARKzGz6xI2UHwFUirP+brPBg3Ee7muOx8pA==
=XtrP
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -39,7 +39,7 @@ jA0ECAMCI7YQpWqp3D1g0kQBCjB7GlX7+SQeXNleXeXQ78ZAPNliquGDq9u378zI
=rCZt
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -53,7 +53,7 @@ lceMfQdbAg6oTFyJpk/wH18GzRDphCofg0X8uLgkAKMrpcmgog==
=fB6S
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -68,7 +68,7 @@ u9YkgfJfsuRJmgQ9tmo=
=60ui
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -82,7 +82,7 @@ jA0EBwMCEeP3idNjQ1Bg0kQBf4G0wX+2QNzLh2YNwYkQgQkfYhn/hLXjV4nK9nsE
=moGf
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -97,7 +97,7 @@ KyRrHf7zEBuZiZ2AG34jNVMOLToj1jJUg5zTSdecUzQVCykWTA==
=NyLk
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -111,7 +111,7 @@ jA0EBwMCApbdlrURoWJg0kQBzHM/E0o7djY82bNuspjxjAcPFrrtp0uvDdMQ4z2m
=FxbQ
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -126,7 +126,7 @@ Ah9GXjGS1TVALzTImJbz1uHUZRfhJlFbc5yGQw==
=YvkV
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -140,7 +140,7 @@ jAwEBwEC/QTByBLI3b/SRAHPxKzI6SZBo5lAEOD+EsvKQWO4adL9tDY+++Iqy1xK
=dbXm
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -154,7 +154,7 @@ z+9ZaA/XdSx5ZiFnMym8P6r8uY9rLjjNptvvRHlxIReF+p9MNg==
=VJKg
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -168,7 +168,7 @@ Cr3i2M7TgVZ0M4jp4QL0adG1lpN5iK7aQeOwMw==
=cg+i
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -182,7 +182,7 @@ jAwECAECruOfyNDFiTnSRAEVoGXm4A9UZKkWljdzjEO/iaE7mIraltIpQMkiqCh9
=aHmC
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -196,7 +196,7 @@ q6eF6859ZVnli3BFSDSk3a4e/pXhglxmDYCfjAXkozKNYLo6yw==
=K0LS
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -210,7 +210,7 @@ rQr3WbdKdY9ufjOE5+mXI+EFkSPrF9rL9NCq6w==
=RGts
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -224,7 +224,7 @@ jAwECQECKHhrou7ZOIXSRAHWIVP+xjVQcjAVBTt+qh9SNzYe248xFTwozkwev3mO
=SUrU
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -238,7 +238,7 @@ jA0ECQMCjc8lwZu8Fz1g0kQBkEzjImi21liep5jj+3dAJ2aZFfUkohi8b3n9z+7+
=XZrG
-----END PGP MESSAGE-----
'), 'foobar');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -253,7 +253,7 @@ tTGup1mMz6Cfh1uDRErUuXpx9A0gdMu7zX0o5XjrL7WGDAZdSw==
=XKKG
-----END PGP MESSAGE-----
'), '0123456789abcdefghij');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -267,7 +267,7 @@ CMxFKadf144H/vpoV9GA0f22keQgCl0EsTE4V4lweVOPTKCMJg==
=gWDh
-----END PGP MESSAGE-----
'), '0123456789abcdefghij2jk4h5g2j54khg23h54g2kh54g2khj54g23hj54');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)
@ -281,7 +281,7 @@ FwsDabdQUz5O7bgNSnxfmyw1OifGF+W2bIn/8W+0rDf8u3+O+Q==
=OxOF
-----END PGP MESSAGE-----
'), 'x');
pgp_sym_decrypt
pgp_sym_decrypt
-----------------
Secret message.
(1 row)

View File

@ -742,8 +742,8 @@ select * from parse('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc
3 | ewri2
12 |
13 | <a href="qwe<qwe>">
12 |
:
12 | +
|
19 | /usr/local/fff
12 |
19 | /awdf/dwqe/4325
@ -775,8 +775,8 @@ select * from parse('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc
20 | -4.2
12 | .
22 | 234
12 |
:
12 | +
|
12 | <
1 | i
12 |
@ -2330,8 +2330,8 @@ Upon a woman s face. E. J. Pratt (1882 1964)
', to_tsquery('sea&thousand&years'));
headline
--------------------------------------------
<b>sea</b> a <b>thousand</b> <b>years</b>,
A <b>thousand</b> <b>years</b> to trace
<b>sea</b> a <b>thousand</b> <b>years</b>,+
A <b>thousand</b> <b>years</b> to trace +
The granite features of this cliff
(1 row)
@ -2347,8 +2347,8 @@ Upon a woman s face. E. J. Pratt (1882 1964)
', to_tsquery('granite&sea'));
headline
-------------------------------------------
<b>sea</b> a thousand years,
A thousand years to trace
<b>sea</b> a thousand years, +
A thousand years to trace +
The <b>granite</b> features of this cliff
(1 row)
@ -2364,8 +2364,8 @@ Upon a woman s face. E. J. Pratt (1882 1964)
', to_tsquery('sea'));
headline
------------------------------------
<b>sea</b> a thousand years,
A thousand years to trace
<b>sea</b> a thousand years, +
A thousand years to trace +
The granite features of this cliff
(1 row)
@ -2384,17 +2384,17 @@ ff-bg
to_tsquery('sea&foo'), 'HighlightAll=true');
headline
-----------------------------------------------------------------------------
<html>
<!-- some comment -->
<body>
<b>Sea</b> view wow <u><b>foo</b> bar</u> <i>qq</i>
<a href="http://www.google.com/foo.bar.html" target="_blank">YES &nbsp;</a>
ff-bg
<script>
document.write(15);
</script>
</body>
+
<html> +
<!-- some comment --> +
<body> +
<b>Sea</b> view wow <u><b>foo</b> bar</u> <i>qq</i> +
<a href="http://www.google.com/foo.bar.html" target="_blank">YES &nbsp;</a>+
ff-bg +
<script> +
document.write(15); +
</script> +
</body> +
</html>
(1 row)

View File

@ -742,8 +742,8 @@ select * from parse('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc
3 | ewri2
12 |
13 | <a href="qwe<qwe>">
12 |
:
12 | +
|
19 | /usr/local/fff
12 |
19 | /awdf/dwqe/4325
@ -775,8 +775,8 @@ select * from parse('default', '345 qwe@efd.r '' http://www.com/ http://aew.werc
20 | -4.2
12 | .
22 | 234
12 |
:
12 | +
|
12 | <
1 | i
12 |
@ -2330,8 +2330,8 @@ Upon a woman s face. E. J. Pratt (1882 1964)
', to_tsquery('sea&thousand&years'));
headline
--------------------------------------------
<b>sea</b> a <b>thousand</b> <b>years</b>,
A <b>thousand</b> <b>years</b> to trace
<b>sea</b> a <b>thousand</b> <b>years</b>,+
A <b>thousand</b> <b>years</b> to trace +
The granite features of this cliff
(1 row)
@ -2347,8 +2347,8 @@ Upon a woman s face. E. J. Pratt (1882 1964)
', to_tsquery('granite&sea'));
headline
-------------------------------------------
<b>sea</b> a thousand years,
A thousand years to trace
<b>sea</b> a thousand years, +
A thousand years to trace +
The <b>granite</b> features of this cliff
(1 row)
@ -2364,8 +2364,8 @@ Upon a woman s face. E. J. Pratt (1882 1964)
', to_tsquery('sea'));
headline
------------------------------------
<b>sea</b> a thousand years,
A thousand years to trace
<b>sea</b> a thousand years, +
A thousand years to trace +
The granite features of this cliff
(1 row)
@ -2384,17 +2384,17 @@ ff-bg
to_tsquery('sea&foo'), 'HighlightAll=true');
headline
-----------------------------------------------------------------------------
<html>
<!-- some comment -->
<body>
<b>Sea</b> view wow <u><b>foo</b> bar</u> <i>qq</i>
<a href="http://www.google.com/foo.bar.html" target="_blank">YES &nbsp;</a>
ff-bg
<script>
document.write(15);
</script>
</body>
+
<html> +
<!-- some comment --> +
<body> +
<b>Sea</b> view wow <u><b>foo</b> bar</u> <i>qq</i> +
<a href="http://www.google.com/foo.bar.html" target="_blank">YES &nbsp;</a>+
ff-bg +
<script> +
document.write(15); +
</script> +
</body> +
</html>
(1 row)