On Wed, Mar 25, 2015 at 02:18:58PM +0900, Michael Paquier wrote:
> > [options="header",cols="<l,<l",frame="none"]
> > |====
> > |5 2.2+^.^ |4 2.2+^.^
> > |2 2.2+^.^ |3 2.2+^.^
> > |====
>
> Hm. This is still incorrect. You should remove options="header" here
> or the first tuple is treated as a header in the case
> non-expanded/tuple-only. Your patch removes correctly the header for
> the expanded/tuple-only case though.
> Regards,
OK, fixed. Thanks for the testing. Patch attached. New output:
---------------------------------------------------------------------------
test=> \pset format asciidoc
Output format is asciidoc.
test=> \t
Tuples only is on.
test=> table "5 2.2+^.^" ;
[cols="<l,<l",frame="none"]
|====
|5 2.2+^.^ |4 2.2+^.^
|2 2.2+^.^ |3 2.2+^.^
|====
--
Bruce Momjian <[email protected]> http://momjian.us
EnterpriseDB http://enterprisedb.com
+ Everyone has their own god. +
diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
new file mode 100644
index a637001..82a91ec
*** a/doc/src/sgml/ref/psql-ref.sgml
--- b/doc/src/sgml/ref/psql-ref.sgml
*************** lo_import 152801
*** 2092,2099 ****
<literal>aligned</literal>, <literal>wrapped</literal>,
<literal>html</literal>,
<literal>latex</literal> (uses <literal>tabular</literal>),
! <literal>latex-longtable</literal>, or
! <literal>troff-ms</literal>.
Unique abbreviations are allowed. (That would mean one letter
is enough.)
</para>
--- 2092,2099 ----
<literal>aligned</literal>, <literal>wrapped</literal>,
<literal>html</literal>,
<literal>latex</literal> (uses <literal>tabular</literal>),
! <literal>latex-longtable</literal>,
! <literal>troff-ms</literal>, or <literal>asciidoc</literal>.
Unique abbreviations are allowed. (That would mean one letter
is enough.)
</para>
*************** lo_import 152801
*** 2120,2126 ****
<para>
The <literal>html</>, <literal>latex</>,
! <literal>latex-longtable</literal>, and <literal>troff-ms</>
formats put out tables that are intended to
be included in documents using the respective mark-up
language. They are not complete documents! This might not be
--- 2120,2127 ----
<para>
The <literal>html</>, <literal>latex</>,
! <literal>latex-longtable</literal>, <literal>troff-ms</>,
! and <literal>asciidoc</>
formats put out tables that are intended to
be included in documents using the respective mark-up
language. They are not complete documents! This might not be
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
new file mode 100644
index 7c9f28d..a96f0ef
*** a/src/bin/psql/command.c
--- b/src/bin/psql/command.c
*************** _align2string(enum printFormat in)
*** 2257,2262 ****
--- 2257,2265 ----
case PRINT_TROFF_MS:
return "troff-ms";
break;
+ case PRINT_ASCIIDOC:
+ return "asciidoc";
+ break;
}
return "unknown";
}
*************** do_pset(const char *param, const char *v
*** 2330,2338 ****
popt->topt.format = PRINT_LATEX_LONGTABLE;
else if (pg_strncasecmp("troff-ms", value, vallen) == 0)
popt->topt.format = PRINT_TROFF_MS;
else
{
! psql_error("\\pset: allowed formats are unaligned, aligned, wrapped, html, latex, troff-ms\n");
return false;
}
--- 2333,2343 ----
popt->topt.format = PRINT_LATEX_LONGTABLE;
else if (pg_strncasecmp("troff-ms", value, vallen) == 0)
popt->topt.format = PRINT_TROFF_MS;
+ else if (pg_strncasecmp("asciidoc", value, vallen) == 0)
+ popt->topt.format = PRINT_ASCIIDOC;
else
{
! psql_error("\\pset: allowed formats are unaligned, aligned, wrapped, html, latex, troff-ms, asciidoc\n");
return false;
}
diff --git a/src/bin/psql/help.c b/src/bin/psql/help.c
new file mode 100644
index ac0dc27..93a517e
*** a/src/bin/psql/help.c
--- b/src/bin/psql/help.c
*************** helpVariables(unsigned short int pager)
*** 351,357 ****
fprintf(output, _(" expanded (or x) toggle expanded output\n"));
fprintf(output, _(" fieldsep field separator for unaligned output (default '|')\n"));
fprintf(output, _(" fieldsep_zero set field separator in unaligned mode to zero\n"));
! fprintf(output, _(" format set output format [unaligned, aligned, wrapped, html, latex, ..]\n"));
fprintf(output, _(" footer enable or disable display of the table footer [on, off]\n"));
fprintf(output, _(" linestyle set the border line drawing style [ascii, old-ascii, unicode]\n"));
fprintf(output, _(" null set the string to be printed in place of a null value\n"));
--- 351,357 ----
fprintf(output, _(" expanded (or x) toggle expanded output\n"));
fprintf(output, _(" fieldsep field separator for unaligned output (default '|')\n"));
fprintf(output, _(" fieldsep_zero set field separator in unaligned mode to zero\n"));
! fprintf(output, _(" format set output format [unaligned, aligned, wrapped, html, latex, asciidoc ..]\n"));
fprintf(output, _(" footer enable or disable display of the table footer [on, off]\n"));
fprintf(output, _(" linestyle set the border line drawing style [ascii, old-ascii, unicode]\n"));
fprintf(output, _(" null set the string to be printed in place of a null value\n"));
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
new file mode 100644
index 40e5098..c3f317e
*** a/src/bin/psql/print.c
--- b/src/bin/psql/print.c
*************** print_troff_ms_vertical(const printTable
*** 2487,2492 ****
--- 2487,2712 ----
}
}
+ /*************************/
+ /* ASCIIDOC */
+ /*************************/
+
+ static void
+ asciidoc_escaped_print(const char *in, FILE *fout)
+ {
+ const char *p;
+ for (p = in; *p; p++)
+ {
+ switch(*p)
+ {
+ case '|':
+ fputs("\\|", fout);
+ break;
+ default:
+ fputc(*p, fout);
+ }
+ }
+ }
+
+ static void
+ print_asciidoc_text(const printTableContent *cont, FILE *fout)
+ {
+ bool opt_tuples_only = cont->opt->tuples_only;
+ unsigned short opt_border = cont->opt->border;
+ unsigned int i;
+ const char *const * ptr;
+
+ if (cancel_pressed)
+ return;
+
+ if (cont->opt->start_table)
+ {
+ /* print table in new paragraph - enforce preliminary new line */
+ fputs("\n", fout);
+
+ /* print title */
+ if (!opt_tuples_only && cont->title)
+ {
+ fputs(".", fout);
+ fputs(cont->title, fout);
+ fputs("\n", fout);
+ }
+
+ /* print table [] header definition */
+ fprintf(fout, "[%scols=\"", !opt_tuples_only ? "options=\"header\"," : "");
+ for(i = 0; i < cont->ncolumns; i++)
+ {
+ if (i != 0)
+ fputs(",", fout);
+ fprintf(fout, "%s", cont->aligns[(i) % cont->ncolumns] == 'r' ? ">l" : "<l");
+ }
+ fputs("\"", fout);
+ switch (opt_border)
+ {
+ case 0:
+ fputs(",frame=\"none\",grid=\"none\"", fout);
+ break;
+ case 1:
+ fputs(",frame=\"none\"", fout);
+ break;
+ case 2:
+ fputs(",frame=\"all\",grid=\"all\"", fout);
+ break;
+ }
+ fputs("]\n", fout);
+ fputs("|====\n", fout);
+
+ /* print headers */
+ if (!opt_tuples_only)
+ {
+ for (ptr = cont->headers; *ptr; ptr++)
+ {
+ if (ptr != cont->headers)
+ fputs(" ", fout);
+ fputs("^l|", fout);
+ asciidoc_escaped_print(*ptr, fout);
+ }
+ fputs("\n", fout);
+ }
+ }
+
+ /* print cells */
+ for (i = 0, ptr = cont->cells; *ptr; i++, ptr++)
+ {
+ if (i % cont->ncolumns == 0)
+ {
+ if (cancel_pressed)
+ break;
+ }
+
+ if (i % cont->ncolumns != 0)
+ fputs(" ", fout);
+ fputs("|", fout);
+
+ /* protect against needless spaces */
+ if ((*ptr)[strspn(*ptr, " \t")] == '\0')
+ {
+ if ((i + 1) % cont->ncolumns != 0)
+ fputs(" ", fout);
+ }
+ else
+ asciidoc_escaped_print(*ptr, fout);
+
+ if ((i + 1) % cont->ncolumns == 0)
+ fputs("\n", fout);
+ }
+
+ fputs("|====\n", fout);
+
+ if (cont->opt->stop_table)
+ {
+ printTableFooter *footers = footers_with_default(cont);
+
+ /* print footers */
+ if (!opt_tuples_only && footers != NULL && !cancel_pressed)
+ {
+ printTableFooter *f;
+
+ fputs("\n....\n", fout);
+ for (f = footers; f; f = f->next)
+ {
+ fputs(f->data, fout);
+ fputs("\n", fout);
+ }
+ fputs("....\n", fout);
+ }
+ }
+ }
+
+ static void
+ print_asciidoc_vertical(const printTableContent *cont, FILE *fout)
+ {
+ bool opt_tuples_only = cont->opt->tuples_only;
+ unsigned short opt_border = cont->opt->border;
+ unsigned long record = cont->opt->prior_records + 1;
+ unsigned int i;
+ const char *const * ptr;
+
+ if (cancel_pressed)
+ return;
+
+ if (cont->opt->start_table)
+ {
+ /* print table in new paragraph - enforce preliminary new line */
+ fputs("\n", fout);
+
+ /* print title */
+ if (!opt_tuples_only && cont->title)
+ {
+ fputs(".", fout);
+ fputs(cont->title, fout);
+ fputs("\n", fout);
+ }
+
+ /* print table [] header definition */
+ fputs("[cols=\"h,l\"", fout);
+ switch (opt_border)
+ {
+ case 0:
+ fputs(",frame=\"none\",grid=\"none\"", fout);
+ break;
+ case 1:
+ fputs(",frame=\"none\"", fout);
+ break;
+ case 2:
+ fputs(",frame=\"all\",grid=\"all\"", fout);
+ break;
+ }
+ fputs("]\n", fout);
+ fputs("|====\n", fout);
+ }
+
+ /* print records */
+ for (i = 0, ptr = cont->cells; *ptr; i++, ptr++)
+ {
+ if (i % cont->ncolumns == 0)
+ {
+ if (cancel_pressed)
+ break;
+ if (!opt_tuples_only)
+ fprintf(fout,
+ "2+^|Record %lu\n",
+ record++);
+ else
+ fputs("2+|\n", fout);
+ }
+
+ fputs("<l|", fout);
+ asciidoc_escaped_print(cont->headers[i % cont->ncolumns], fout);
+
+ fprintf(fout, " %s|", cont->aligns[i % cont->ncolumns] == 'r' ? ">l" : "<l");
+ /* is string only whitespace? */
+ if ((*ptr)[strspn(*ptr, " \t")] == '\0')
+ fputs(" ", fout);
+ else
+ asciidoc_escaped_print(*ptr, fout);
+ fputs("\n", fout);
+ }
+
+ fputs("|====\n", fout);
+
+ if (cont->opt->stop_table)
+ {
+ /* print footers */
+ if (!opt_tuples_only && cont->footers != NULL && !cancel_pressed)
+ {
+ printTableFooter *f;
+
+ fputs("\n....\n", fout);
+ for (f = cont->footers; f; f = f->next)
+ {
+ fputs(f->data, fout);
+ fputs("\n", fout);
+ }
+ fputs("....\n", fout);
+ }
+ }
+ }
/********************************/
/* Public functions */
*************** printTable(const printTableContent *cont
*** 2884,2889 ****
--- 3104,3115 ----
else
print_troff_ms_text(cont, fout);
break;
+ case PRINT_ASCIIDOC:
+ if (cont->opt->expanded == 1)
+ print_asciidoc_vertical(cont, fout);
+ else
+ print_asciidoc_text(cont, fout);
+ break;
default:
fprintf(stderr, _("invalid output format (internal error): %d"),
cont->opt->format);
*************** strlen_max_width(unsigned char *str, int
*** 3112,3114 ****
--- 3338,3342 ----
return str - start;
}
+
+
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
new file mode 100644
index a1a89d0..a7eff99
*** a/src/bin/psql/print.h
--- b/src/bin/psql/print.h
*************** enum printFormat
*** 20,26 ****
PRINT_HTML,
PRINT_LATEX,
PRINT_LATEX_LONGTABLE,
! PRINT_TROFF_MS
/* add your favourite output format here ... */
};
--- 20,27 ----
PRINT_HTML,
PRINT_LATEX,
PRINT_LATEX_LONGTABLE,
! PRINT_TROFF_MS,
! PRINT_ASCIIDOC
/* add your favourite output format here ... */
};
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
new file mode 100644
index e39a07c..82653f7
*** a/src/bin/psql/tab-complete.c
--- b/src/bin/psql/tab-complete.c
*************** psql_completion(const char *text, int st
*** 3791,3797 ****
{
static const char *const my_list[] =
{"unaligned", "aligned", "wrapped", "html", "latex",
! "troff-ms", NULL};
COMPLETE_WITH_LIST_CS(my_list);
}
--- 3791,3797 ----
{
static const char *const my_list[] =
{"unaligned", "aligned", "wrapped", "html", "latex",
! "troff-ms", "asciidoc", NULL};
COMPLETE_WITH_LIST_CS(my_list);
}
diff --git a/src/test/regress/expected/psql.out b/src/test/regress/expected/psql.out
new file mode 100644
index e87b82b..7963ee5
*** a/src/test/regress/expected/psql.out
--- b/src/test/regress/expected/psql.out
*************** execute q;
*** 2125,2127 ****
--- 2125,2333 ----
+------------------+-------------------+
deallocate q;
+ prepare q as select ' | = | lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&' as " | -- | 012345678 9abc def!*@#&!@(*&*~~_+-=\ \", '11' as "0123456789", 11 as int from generate_series(1,10) as n;
+ \pset format asciidoc
+ \pset expanded off
+ \pset border 0
+ execute q;
+
+ [options="header",cols="<l,<l,>l",frame="none",grid="none"]
+ |====
+ ^l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ ^l|0123456789 ^l|int
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ |====
+
+ ....
+ (10 rows)
+ ....
+ \pset border 1
+ execute q;
+
+ [options="header",cols="<l,<l,>l",frame="none"]
+ |====
+ ^l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ ^l|0123456789 ^l|int
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ |====
+
+ ....
+ (10 rows)
+ ....
+ \pset border 2
+ execute q;
+
+ [options="header",cols="<l,<l,>l",frame="all",grid="all"]
+ |====
+ ^l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ ^l|0123456789 ^l|int
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ | \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (& |11 |11
+ |====
+
+ ....
+ (10 rows)
+ ....
+ \pset expanded on
+ \pset border 0
+ execute q;
+
+ [cols="h,l",frame="none",grid="none"]
+ |====
+ 2+^|Record 1
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 2
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 3
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 4
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 5
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 6
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 7
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 8
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 9
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 10
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ |====
+ \pset border 1
+ execute q;
+
+ [cols="h,l",frame="none"]
+ |====
+ 2+^|Record 1
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 2
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 3
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 4
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 5
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 6
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 7
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 8
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 9
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 10
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ |====
+ \pset border 2
+ execute q;
+
+ [cols="h,l",frame="all",grid="all"]
+ |====
+ 2+^|Record 1
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 2
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 3
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 4
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 5
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 6
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 7
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 8
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 9
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ 2+^|Record 10
+ <l| \| -- \| 012345678 9abc def!*@#&!@(*&*~~_+-=\ \ <l| \| = \| lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&
+ <l|0123456789 <l|11
+ <l|int >l|11
+ |====
+ deallocate q;
diff --git a/src/test/regress/sql/psql.sql b/src/test/regress/sql/psql.sql
new file mode 100644
index 5ccc68f..fa1df8b
*** a/src/test/regress/sql/psql.sql
--- b/src/test/regress/sql/psql.sql
*************** execute q;
*** 276,278 ****
--- 276,303 ----
execute q;
deallocate q;
+
+ prepare q as select ' | = | lkjsafi\\/ /oeu rio)(!@&*#)*(!&@*) \ (&' as " | -- | 012345678 9abc def!*@#&!@(*&*~~_+-=\ \", '11' as "0123456789", 11 as int from generate_series(1,10) as n;
+
+ \pset format asciidoc
+ \pset expanded off
+ \pset border 0
+ execute q;
+
+ \pset border 1
+ execute q;
+
+ \pset border 2
+ execute q;
+
+ \pset expanded on
+ \pset border 0
+ execute q;
+
+ \pset border 1
+ execute q;
+
+ \pset border 2
+ execute q;
+
+ deallocate q;
--
Sent via pgsql-hackers mailing list ([email protected])
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers