psql latex and newlines - Mailing list pgsql-general

From Wim Bertels
Subject psql latex and newlines
Date
Msg-id 1323713712.2454.14.camel@zwerfkat
Whole thread Raw
Responses Re: psql latex and newlines
List pgsql-general
Hallo,

psql latex output format needs to differentiate between a newline and a
tabularnewline.

the problem arises when u have a field value that contains a newline
character, when this field is not the first column, then all the data
after this newline comes in the first column..

u can try this out, writing a function or table,
and then add 'enters' or newline in the COMMENT on this function or
table.

the \pset recordsep doesn't solve this, since the mistakes take place
within the same record.

so first:
make some function of table
\o tofile
\pset format latex
\df+ \dt+ or ..

eg:
-- latex generated: with the wrong layout

\begin{tabular}{|c|l|}

\hline

\multicolumn{2}{|c|}{\textit{Record 1}} \\

\hline

entry1\_test & test \\

..

out\_result & TABLE(out\_field1 integer,\\ out\_field2 character
varying,\\ out\_del boolean) \\
out\_description & This function deletes a record\\ given the
following .. foreign\_key\_violation.\\ \\

\hline

Compared with text output, right layout:
-[ RECORD1 ]------------+--------------------------------------------------------------
entry1_test             | test
..

out_resultdatatypes     | TABLE(out_field1 integer,
                        :  out_field2 character varying,
                        :  out_del boolean)
out_description         | This function deletes a record
                        :         given the following ..
..
                        :         .. foreign_key_violation.


mvg,
Wim



pgsql-general by date:

Previous
From: Wojciech Strzałka
Date:
Subject: Re: Problem installing PG9.1 using yum
Next
From: Scot Kreienkamp
Date:
Subject: initdb with lc-collate=C