new unicode table border styles for psql

Started by Pavel Stehuleabout 12 years ago36 messages
#1Pavel Stehule
pavel.stehule@gmail.com

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for
final presentation.

Do you think so this feature is generally interesting and should be in core?

Regards

Pavel

#2Szymon Guz
mabewlun@gmail.com
In reply to: Pavel Stehule (#1)
Re: new unicode table border styles for psql

On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for
final presentation.

Do you think so this feature is generally interesting and should be in
core?

Regards

Pavel

YES!

- Szymon

#3amul sul
sul_amul@yahoo.co.in
In reply to: Szymon Guz (#2)
Re: new unicode table border styles for psql

YES!

+1

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#4Pavel Stehule
pavel.stehule@gmail.com
In reply to: Szymon Guz (#2)
1 attachment(s)
Re: new unicode table border styles for psql

So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel

2013/11/21 Szymon Guz <mabewlun@gmail.com>

Show quoted text

On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for
final presentation.

Do you think so this feature is generally interesting and should be in
core?

Regards

Pavel

YES!

- Szymon

Attachments:

psql-pretty-borders.patchtext/x-patch; charset=UTF-8; name=psql-pretty-borders.patchDownload
commit 170c25a680a43a9bd96e2ca923cbd2492d35ceda
Author: root <root@localhost.localdomain>
Date:   Thu Nov 21 20:16:00 2013 +0100

    initial

diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 638d8cb..7b2b621 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -2271,7 +2271,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
 			psql_error("\\pset: allowed formats are unaligned, aligned, wrapped, html, latex, troff-ms\n");
 			return false;
 		}
-
 	}
 
 	/* set table line style */
@@ -2285,12 +2284,27 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
 			popt->topt.line_style = &pg_asciiformat_old;
 		else if (pg_strncasecmp("unicode", value, vallen) == 0)
 			popt->topt.line_style = &pg_utf8format;
+		else if (pg_strncasecmp("unicode2", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8format2;
+		else if (pg_strncasecmp("unicode-double1", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double1format;
+		else if (pg_strncasecmp("unicode-double2", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double2format;
+		else if (pg_strncasecmp("unicode-double3", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double3format;
+		else if (pg_strncasecmp("unicode-double4", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double4format;
+		else if (pg_strncasecmp("unicode-double5", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double5format;
+		else if (pg_strncasecmp("unicode-bold1", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8bold1format;
+		else if (pg_strncasecmp("unicode-bold2", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8bold2format;
 		else
 		{
 			psql_error("\\pset: allowed line styles are ascii, old-ascii, unicode\n");
 			return false;
 		}
-
 	}
 
 	/* set border style/width */
@@ -2298,7 +2312,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
 	{
 		if (value)
 			popt->topt.border = atoi(value);
-
 	}
 
 	/* set expanded/vertical mode */
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 736225c..6f4473a 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -54,6 +54,8 @@ const printTextFormat pg_asciiformat =
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
+		{"-", "+", "+", "+"},
+		{"", "|", "|", "|"},
 		{"", "|", "|", "|"}
 	},
 	"|",
@@ -75,6 +77,8 @@ const printTextFormat pg_asciiformat_old =
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
+		{"-", "+", "+", "+"},
+		{"", "|", "|", "|"},
 		{"", "|", "|", "|"}
 	},
 	":",
@@ -97,9 +101,13 @@ const printTextFormat pg_utf8format =
 		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
 		/* ─, ├, ┼, ┤ */
 		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
 		/* ─, └, ┴, ┘ */
 		{"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
 		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
 		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
 	},
 	/* │ */
@@ -121,6 +129,253 @@ const printTextFormat pg_utf8format =
 	true
 };
 
+const printTextFormat pg_utf8format2 = {
+	"unicode2",
+	{
+		/* ─, ┌, ┬, ┐ */
+		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
+		/* ─, ├, ┴, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\264", "\342\224\244"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, └, ─, ┘ */
+		{"\342\224\200", "\342\224\224", "\342\224\200", "\342\224\230"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double1format = {
+	"unicode-double1",
+	{
+		/* ═, ╔, ╤, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\244", "\342\225\227"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ═, ╚, ╧, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\247", "\342\225\235"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double2format = {
+	"unicode-double2",
+	{
+		/* ═, ╔, ╤, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\244", "\342\225\227"},
+		/* ═, ╠, ╪, ╣ */
+		{"\342\225\220", "\342\225\240", "\342\225\252", "\342\225\243"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ═, ╚, ╧, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\247", "\342\225\235"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double3format = {
+	"unicode-double3",
+	{
+		/* ═, ╔, ╦, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\246", "\342\225\227"},
+		/* ═, ╠, ╩, ╣ */
+		{"\342\225\220", "\342\225\240", "\342\225\251", "\342\225\243"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ═, ╚, ═, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\220", "\342\225\235"},
+		/* N/A, ║, ║, ║ */
+		{"", "\342\225\221", "\342\225\221", "\342\225\221"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"},
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double4format = {
+	"unicode-double4",
+	{
+		/* ═, ╔, ╦, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\246", "\342\225\227"},
+		/* ═, ╠, ╬, ╣ */
+		{"\342\225\220", "\342\225\240", "\342\225\254", "\342\225\243"},
+		/* ─, ╟, ╫, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\225\253", "\342\225\242"},
+		/* ═, ╚, ╩, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\251", "\342\225\235"},
+		/* N/A, ║, ║, ║ */
+		{"", "\342\225\221", "\342\225\221", "\342\225\221"},
+		/* N/A, ║, ║, ║ */
+		{"", "\342\225\221", "\342\225\221", "\342\225\221"}
+	},
+	/* ║ */
+	"\342\225\221",
+	/* ║ */
+	"\342\225\221",
+	/* ║ */
+	"\342\225\221",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double5format = {
+	"unicode-double5",
+	{
+		/* ─, ┌, ┬, ┐ */
+		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
+		/* ═, ╞, ╪, ╡ */
+		{"\342\225\220", "\342\225\236", "\342\225\252", "\342\225\241"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, └, ┴, ┘ */
+		{"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8bold1format = {
+	"unicode-bold1",
+	{
+		/* ─, ┌, ┬, ┐ */
+		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
+		/* ━, ┝, ┿, ┥ */
+		{"\342\224\201", "\342\224\235", "\342\224\277", "\342\224\245"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, └, ┴, ┘ */
+		{"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8bold2format = {
+	"unicode-bold2",
+	{
+		/* ━, ┏, ┯, ┓ */
+		{"\342\224\201", "\342\224\217", "\342\224\257", "\342\224\223"},
+		/* ━, ┣, ┿, ┫ */
+		{"\342\224\201", "\342\224\243", "\342\224\277", "\342\224\253"},
+		/* ─, ┠, ┼, ┨ */
+		{"\342\224\200", "\342\224\240", "\342\224\274", "\342\224\250"},
+		/* ━, ┗, ┷, ┛ */
+		{"\342\224\201", "\342\224\227", "\342\224\267", "\342\224\233"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\203", "\342\224\202", "\342\224\203"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\203", "\342\224\202", "\342\224\203"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
 
 /* Local functions */
 static int	strlen_max_width(unsigned char *str, int *target_width, int encoding);
@@ -465,9 +720,9 @@ _print_horizontal_line(const unsigned int ncolumns, const unsigned int *widths,
 	unsigned int i,
 				j;
 
-	if (border == 1)
+	if (border == 1 || border == 3)
 		fputs(lformat->hrule, fout);
-	else if (border == 2)
+	else if (border == 2 || border == 4)
 		fprintf(fout, "%s%s", lformat->leftvrule, lformat->hrule);
 
 	for (i = 0; i < ncolumns; i++)
@@ -485,9 +740,9 @@ _print_horizontal_line(const unsigned int ncolumns, const unsigned int *widths,
 		}
 	}
 
-	if (border == 2)
+	if (border == 2 || border == 4)
 		fprintf(fout, "%s%s", lformat->hrule, lformat->rightvrule);
-	else if (border == 1)
+	else if (border == 1 || border == 3)
 		fputs(lformat->hrule, fout);
 
 	fputc('\n', fout);
@@ -505,6 +760,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	unsigned short opt_border = cont->opt->border;
 	const printTextFormat *format = get_line_style(cont->opt);
 	const printTextLineFormat *dformat = &format->lrule[PRINT_RULE_DATA];
+	const printTextLineFormat *hformat = &format->lrule[PRINT_RULE_ATTRNAME];
 
 	unsigned int col_count = 0,
 				cell_count = 0;
@@ -524,6 +780,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	unsigned int total_header_width;
 	unsigned int extra_row_output_lines = 0;
 	unsigned int extra_output_lines = 0;
+	bool first_datarow = true;
 
 	const char *const * ptr;
 
@@ -538,8 +795,8 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	if (cancel_pressed)
 		return;
 
-	if (opt_border > 2)
-		opt_border = 2;
+	if (opt_border > 4)
+		opt_border = 4;
 
 	if (cont->ncolumns > 0)
 	{
@@ -817,7 +1074,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 			int			more_col_wrapping;
 			int			curr_nl_line;
 
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				_print_horizontal_line(col_count, width_wrap, opt_border,
 									   PRINT_RULE_TOP, format, fout);
 
@@ -831,8 +1088,8 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 			memset(header_done, false, col_count * sizeof(bool));
 			while (more_col_wrapping)
 			{
-				if (opt_border == 2)
-					fputs(dformat->leftvrule, fout);
+				if (opt_border == 2 || opt_border == 4)
+					fputs(hformat->leftvrule, fout);
 
 				for (i = 0; i < cont->ncolumns; i++)
 				{
@@ -866,17 +1123,17 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 							  fout);
 
 					if (opt_border != 0 && i < col_count - 1)
-						fputs(dformat->midvrule, fout);
+						fputs(hformat->midvrule, fout);
 				}
 				curr_nl_line++;
 
-				if (opt_border == 2)
+				if (opt_border == 2 || opt_border == 4)
 					fputs(dformat->rightvrule, fout);
 				fputc('\n', fout);
 			}
 
 			_print_horizontal_line(col_count, width_wrap, opt_border,
-								   PRINT_RULE_MIDDLE, format, fout);
+								   PRINT_RULE_HEADER, format, fout);
 		}
 	}
 
@@ -884,6 +1141,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	for (i = 0, ptr = cont->cells; *ptr; i += col_count, ptr += col_count)
 	{
 		bool		more_lines;
+		bool		first_line = true;
 
 		if (cancel_pressed)
 			break;
@@ -909,8 +1167,17 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 		{
 			more_lines = false;
 
+			if ((opt_border == 3 || opt_border == 4) && !first_datarow && first_line)
+			{
+				_print_horizontal_line(col_count, width_wrap, opt_border,
+								   PRINT_RULE_MIDDLE, format, fout);
+				first_line = false;
+			}
+			else if (first_datarow)
+				first_datarow = false;
+
 			/* left border */
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				fputs(dformat->leftvrule, fout);
 
 			/* for each column */
@@ -920,7 +1187,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 				struct lineptr *this_line = &col_lineptrs[j][curr_nl_line[j]];
 				int			bytes_to_output;
 				int			chars_to_output = width_wrap[j];
-				bool		finalspaces = (opt_border == 2 || j < col_count - 1);
+				bool		finalspaces = ((opt_border == 2 || opt_border == 4) || j < col_count - 1);
 
 				/* Print left-hand wrap or newline mark */
 				if (opt_border != 0)
@@ -1014,7 +1281,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 					fputs(format->wrap_right, fout);
 				else if (wrap[j] == PRINT_LINE_WRAP_NEWLINE)
 					fputs(format->nl_right, fout);
-				else if (opt_border == 2 || j < col_count - 1)
+				else if ((opt_border == 2 || opt_border == 4) || j < col_count - 1)
 					fputc(' ', fout);
 
 				/* Print column divider, if not the last column */
@@ -1032,7 +1299,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 			}
 
 			/* end-of-row border */
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				fputs(dformat->rightvrule, fout);
 			fputc('\n', fout);
 
@@ -1043,7 +1310,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	{
 		printTableFooter *footers = footers_with_default(cont);
 
-		if (opt_border == 2 && !cancel_pressed)
+		if ((opt_border == 2 || opt_border == 4) && !cancel_pressed)
 			_print_horizontal_line(col_count, width_wrap, opt_border,
 								   PRINT_RULE_BOTTOM, format, fout);
 
@@ -1098,7 +1365,7 @@ print_aligned_vertical_line(const printTableContent *cont,
 	unsigned int i;
 	int			reclen = 0;
 
-	if (opt_border == 2)
+	if (opt_border == 2 || opt_border == 4)
 		fprintf(fout, "%s%s", lformat->leftvrule, lformat->hrule);
 	else if (opt_border == 1)
 		fputs(lformat->hrule, fout);
@@ -1136,7 +1403,7 @@ print_aligned_vertical_line(const printTableContent *cont,
 		reclen = 0;
 	for (i = reclen; i < dwidth; i++)
 		fputs(opt_border > 0 ? lformat->hrule : " ", fout);
-	if (opt_border == 2)
+	if (opt_border == 2 || opt_border == 4)
 		fprintf(fout, "%s%s", lformat->hrule, lformat->rightvrule);
 	fputc('\n', fout);
 }
@@ -1250,14 +1517,14 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 		else if (!(*(ptr + 1)))
 			pos = PRINT_RULE_BOTTOM;
 		else
-			pos = PRINT_RULE_MIDDLE;
+			pos = PRINT_RULE_HEADER;
 
 		if (i % cont->ncolumns == 0)
 		{
 			if (!opt_tuples_only)
 				print_aligned_vertical_line(cont, record++, hwidth, dwidth,
 											pos, fout);
-			else if (i != 0 || !cont->opt->start_table || opt_border == 2)
+			else if (i != 0 || !cont->opt->start_table || opt_border == 2 || opt_border == 4)
 				print_aligned_vertical_line(cont, 0, hwidth, dwidth,
 											pos, fout);
 		}
@@ -1274,7 +1541,7 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 		dcomplete = hcomplete = 0;
 		while (!dcomplete || !hcomplete)
 		{
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				fprintf(fout, "%s ", dformat->leftvrule);
 			if (!hcomplete)
 			{
@@ -1317,7 +1584,7 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 
 	if (cont->opt->stop_table)
 	{
-		if (opt_border == 2 && !cancel_pressed)
+		if ((opt_border == 2 || opt_border == 4) && !cancel_pressed)
 			print_aligned_vertical_line(cont, 0, hwidth, dwidth,
 										PRINT_RULE_BOTTOM, fout);
 
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index 9cfa3b6..f5c527d 100644
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
@@ -37,8 +37,10 @@ typedef enum printTextRule
 {
 	/* Additional context for selecting line drawing characters */
 	PRINT_RULE_TOP,				/* top horizontal line */
+	PRINT_RULE_HEADER,			/* header-data horizontal line */
 	PRINT_RULE_MIDDLE,			/* intra-data horizontal line */
 	PRINT_RULE_BOTTOM,			/* bottom horizontal line */
+	PRINT_RULE_ATTRNAME,			/* separators between attrnames */
 	PRINT_RULE_DATA				/* data line (hrule is unused here) */
 } printTextRule;
 
@@ -54,7 +56,7 @@ typedef struct printTextFormat
 {
 	/* A complete line style */
 	const char *name;			/* for display purposes */
-	printTextLineFormat lrule[4];		/* indexed by enum printTextRule */
+	printTextLineFormat lrule[6];		/* indexed by enum printTextRule */
 	const char *midvrule_nl;	/* vertical line for continue after newline */
 	const char *midvrule_wrap;	/* vertical line for wrapped data */
 	const char *midvrule_blank; /* vertical line for blank data */
@@ -152,7 +154,15 @@ typedef struct printQueryOpt
 extern const printTextFormat pg_asciiformat;
 extern const printTextFormat pg_asciiformat_old;
 extern const printTextFormat pg_utf8format;
-
+extern const printTextFormat pg_utf8format2;
+
+extern const printTextFormat pg_utf8double1format;
+extern const printTextFormat pg_utf8double2format;
+extern const printTextFormat pg_utf8double3format;
+extern const printTextFormat pg_utf8double4format;
+extern const printTextFormat pg_utf8double5format;
+extern const printTextFormat pg_utf8bold1format;
+extern const printTextFormat pg_utf8bold2format;
 
 extern FILE *PageOutput(int lines, unsigned short int pager);
 extern void ClosePager(FILE *pagerpipe);
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 2a0bb71..5c74c9d 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3355,10 +3355,20 @@ psql_completion(char *text, int start, int end)
 		else if (strcmp(prev_wd, "linestyle") == 0)
 		{
 			static const char *const my_list[] =
-			{"ascii", "old-ascii", "unicode", NULL};
+			{"ascii", "old-ascii", "unicode", "unicode2", "unicode-double1",
+		 "unicode-double2", "unicode-double3", "unicode-double4", "unicode-double5",
+		 "unicode-bold1", "unicode-bold2", NULL};
 
 			COMPLETE_WITH_LIST_CS(my_list);
 		}
+		else if (strcmp(prev_wd, "border") == 0 &&
+				strcmp(prev2_wd, "\\pset") == 0)
+		{
+			static const char *const list_PREPARE[] =
+				{"0", "1", "2", "3", "4", NULL};
+
+			COMPLETE_WITH_LIST(list_PREPARE);
+		}
 	}
 	else if (strcmp(prev_wd, "\\set") == 0)
 	{
#5Szymon Guz
mabewlun@gmail.com
In reply to: Pavel Stehule (#4)
Re: new unicode table border styles for psql

On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:

So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel

2013/11/21 Szymon Guz <mabewlun@gmail.com>

On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com> wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in
core?

Regards

Pavel

YES!

- Szymon

That's pretty cool, I'd love to see it in the core, however it doesn't
contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

#6Szymon Guz
mabewlun@gmail.com
In reply to: Szymon Guz (#5)
Re: new unicode table border styles for psql

On 21 November 2013 21:15, Szymon Guz <mabewlun@gmail.com> wrote:

On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:

So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel

2013/11/21 Szymon Guz <mabewlun@gmail.com>

On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com>wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in
core?

Regards

Pavel

YES!

- Szymon

That's pretty cool, I'd love to see it in the core, however it doesn't
contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

Hi Pavel,
I've found two errors in the documentation at
http://postgres.cz/wiki/Pretty_borders_in_psql

1)

The unicode-double5 style looks like:

x=# select * from t;
┌───┬───┬───┐
│ a │ b │ t │
╞═══╪═══╪═══╡
│ 1 │ 1 │ a │
├───┼───┼───┤
│ 2 │ 2 │ b │
├───┼───┼───┤
│ 3 │ 3 │ c │
└───┴───┴───┘
(3 rows)

(There are horizontal lines between rows)

2) There is no unicode-double6 in psql, however it exists on the website.

regards,
Szymon

#7Pavel Stehule
pavel.stehule@gmail.com
In reply to: Szymon Guz (#6)
Re: new unicode table border styles for psql

I should to appen list of new styles to doc. Style double6 doesnt exist,
because I renamed double5 to bold1 (and created second bold2)

I will update patch tomorrow - it will be in cf4

Regards

Pavel
Dne 21.11.2013 21:37 "Szymon Guz" <mabewlun@gmail.com> napsal(a):

Show quoted text

On 21 November 2013 21:15, Szymon Guz <mabewlun@gmail.com> wrote:

On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:

So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel

2013/11/21 Szymon Guz <mabewlun@gmail.com>

On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com>wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in
core?

Regards

Pavel

YES!

- Szymon

That's pretty cool, I'd love to see it in the core, however it doesn't
contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

Hi Pavel,
I've found two errors in the documentation at
http://postgres.cz/wiki/Pretty_borders_in_psql

1)

The unicode-double5 style looks like:

x=# select * from t;
┌───┬───┬───┐
│ a │ b │ t │
╞═══╪═══╪═══╡
│ 1 │ 1 │ a │
├───┼───┼───┤
│ 2 │ 2 │ b │
├───┼───┼───┤
│ 3 │ 3 │ c │
└───┴───┴───┘
(3 rows)

(There are horizontal lines between rows)

2) There is no unicode-double6 in psql, however it exists on the website.

regards,
Szymon

#8Merlin Moncure
mmoncure@gmail.com
In reply to: Pavel Stehule (#1)
Re: new unicode table border styles for psql

On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for
final presentation.

great. hm, maybe we could integrate color? (see:
http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html).

merlin

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#9Peter Eisentraut
peter_e@gmx.net
In reply to: Pavel Stehule (#1)
Re: new unicode table border styles for psql

On 11/21/13, 2:09 AM, Pavel Stehule wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in core?

Maybe make the border setting a string containing the various characters
by index. Then everyone can create their own crazy borders.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#10Andrew Dunstan
andrew@dunslane.net
In reply to: Peter Eisentraut (#9)
Re: new unicode table border styles for psql

On 11/21/2013 04:39 PM, Peter Eisentraut wrote:

On 11/21/13, 2:09 AM, Pavel Stehule wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in core?

Maybe make the border setting a string containing the various characters
by index. Then everyone can create their own crazy borders.

Why not just reinvent termcap / terminfo? :-)

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#11Pavel Stehule
pavel.stehule@gmail.com
In reply to: Peter Eisentraut (#9)
Re: new unicode table border styles for psql

Hello

2013/11/21 Peter Eisentraut <peter_e@gmx.net>

On 11/21/13, 2:09 AM, Pavel Stehule wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in

core?

Maybe make the border setting a string containing the various characters
by index. Then everyone can create their own crazy borders.

I seriously though about it, but not sure if it is good way.

- So we still have to deliver some basic set of styles still.
- People prefer prefabricate solution with simply activation now - so
customization use only a few people
- buitin style requires about 110 bytes and it is safe and verified,
dynamic styling requires some parser, maybe some other checks

So for this use case I prefer very primitive (and simple) design as was
proposed.

Regards

Pavel

#12Pavel Stehule
pavel.stehule@gmail.com
In reply to: Merlin Moncure (#8)
Re: new unicode table border styles for psql

Hello

2013/11/21 Merlin Moncure <mmoncure@gmail.com>

On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting for
final presentation.

great. hm, maybe we could integrate color? (see:

http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html
).

it is next possible enhancing - I would to go forward in small steps,
please :)

minimally (and independent on proposed patch) we can introduce some like
"final regexp filtering" - that can be used for this or other purposes.

Regards

Pavel

Show quoted text

merlin

#13Pavel Stehule
pavel.stehule@gmail.com
In reply to: Szymon Guz (#6)
1 attachment(s)
Re: new unicode table border styles for psql

2013/11/21 Szymon Guz <mabewlun@gmail.com>

On 21 November 2013 21:15, Szymon Guz <mabewlun@gmail.com> wrote:

On 21 November 2013 20:20, Pavel Stehule <pavel.stehule@gmail.com> wrote:

So here is patch for 9.4

7 new line styles, 2 new border styles, \pset border autocomplete

Regards

Pavel

2013/11/21 Szymon Guz <mabewlun@gmail.com>

On 21 November 2013 08:09, Pavel Stehule <pavel.stehule@gmail.com>wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in
core?

Regards

Pavel

YES!

- Szymon

That's pretty cool, I'd love to see it in the core, however it doesn't
contain any documentation, so I'm afraid it will be hard to use for people.

thanks,
Szymon

Hi Pavel,
I've found two errors in the documentation at
http://postgres.cz/wiki/Pretty_borders_in_psql

1)

The unicode-double5 style looks like:

x=# select * from t;
┌───┬───┬───┐
│ a │ b │ t │
╞═══╪═══╪═══╡
│ 1 │ 1 │ a │
├───┼───┼───┤
│ 2 │ 2 │ b │
├───┼───┼───┤
│ 3 │ 3 │ c │
└───┴───┴───┘
(3 rows)

(There are horizontal lines between rows)

2) There is no unicode-double6 in psql, however it exists on the website.

website is related to patch for 9.3 (I add note there)

patch for 9.4 is fixed - and now with small doc

Regards

Pavel

Show quoted text

regards,
Szymon

Attachments:

psql-pretty-borders.patchtext/x-patch; charset=UTF-8; name=psql-pretty-borders.patchDownload
commit 43f0026617891485f5ceddce6024b164622ac4cc
Author: root <root@localhost.localdomain>
Date:   Thu Nov 21 20:16:00 2013 +0100

    initial

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 264cfe6..aad2304 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -1947,7 +1947,8 @@ lo_import 152801
           <acronym>HTML</acronym> format, this will translate directly
           into the <literal>border=...</literal> attribute; in the
           other formats only values 0 (no border), 1 (internal dividing lines),
-          and 2 (table frame) make sense.
+          and 2 (table frame), 3 (internal dividing lines with rows
+          separators), 4 (table frame with internal divided cells).
           <literal>latex</literal> and <literal>latex-longtable</literal>
           also support a <literal>border</literal> value of 3 which adds
           a dividing line between each row.
@@ -2087,8 +2088,11 @@ lo_import 152801
           <listitem>
           <para>
           Sets the border line drawing style to one
-          of <literal>ascii</literal>, <literal>old-ascii</literal>
-          or <literal>unicode</literal>.
+          of <literal>ascii</literal>, <literal>old-ascii</literal>,
+          <literal>unicode</literal>, <literal>unicode-double1</literal>,
+          <literal>unicode-double2</literal>, <literal>unicode-double3</literal>,
+          <literal>unicode-double4</literal>, <literal>unicode-double5</literal>,
+          <literal>unicode-bold1</literal> or <literal>unicode-bold2</literal>.
           Unique abbreviations are allowed.  (That would mean one
           letter is enough.)
           The default setting is <literal>ascii</>.
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 638d8cb..7b2b621 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -2271,7 +2271,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
 			psql_error("\\pset: allowed formats are unaligned, aligned, wrapped, html, latex, troff-ms\n");
 			return false;
 		}
-
 	}
 
 	/* set table line style */
@@ -2285,12 +2284,27 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
 			popt->topt.line_style = &pg_asciiformat_old;
 		else if (pg_strncasecmp("unicode", value, vallen) == 0)
 			popt->topt.line_style = &pg_utf8format;
+		else if (pg_strncasecmp("unicode2", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8format2;
+		else if (pg_strncasecmp("unicode-double1", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double1format;
+		else if (pg_strncasecmp("unicode-double2", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double2format;
+		else if (pg_strncasecmp("unicode-double3", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double3format;
+		else if (pg_strncasecmp("unicode-double4", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double4format;
+		else if (pg_strncasecmp("unicode-double5", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8double5format;
+		else if (pg_strncasecmp("unicode-bold1", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8bold1format;
+		else if (pg_strncasecmp("unicode-bold2", value, vallen) == 0)
+			popt->topt.line_style = &pg_utf8bold2format;
 		else
 		{
 			psql_error("\\pset: allowed line styles are ascii, old-ascii, unicode\n");
 			return false;
 		}
-
 	}
 
 	/* set border style/width */
@@ -2298,7 +2312,6 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
 	{
 		if (value)
 			popt->topt.border = atoi(value);
-
 	}
 
 	/* set expanded/vertical mode */
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 736225c..6f4473a 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -54,6 +54,8 @@ const printTextFormat pg_asciiformat =
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
+		{"-", "+", "+", "+"},
+		{"", "|", "|", "|"},
 		{"", "|", "|", "|"}
 	},
 	"|",
@@ -75,6 +77,8 @@ const printTextFormat pg_asciiformat_old =
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
 		{"-", "+", "+", "+"},
+		{"-", "+", "+", "+"},
+		{"", "|", "|", "|"},
 		{"", "|", "|", "|"}
 	},
 	":",
@@ -97,9 +101,13 @@ const printTextFormat pg_utf8format =
 		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
 		/* ─, ├, ┼, ┤ */
 		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
 		/* ─, └, ┴, ┘ */
 		{"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
 		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
 		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
 	},
 	/* │ */
@@ -121,6 +129,253 @@ const printTextFormat pg_utf8format =
 	true
 };
 
+const printTextFormat pg_utf8format2 = {
+	"unicode2",
+	{
+		/* ─, ┌, ┬, ┐ */
+		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
+		/* ─, ├, ┴, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\264", "\342\224\244"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, └, ─, ┘ */
+		{"\342\224\200", "\342\224\224", "\342\224\200", "\342\224\230"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double1format = {
+	"unicode-double1",
+	{
+		/* ═, ╔, ╤, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\244", "\342\225\227"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ═, ╚, ╧, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\247", "\342\225\235"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double2format = {
+	"unicode-double2",
+	{
+		/* ═, ╔, ╤, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\244", "\342\225\227"},
+		/* ═, ╠, ╪, ╣ */
+		{"\342\225\220", "\342\225\240", "\342\225\252", "\342\225\243"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ═, ╚, ╧, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\247", "\342\225\235"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double3format = {
+	"unicode-double3",
+	{
+		/* ═, ╔, ╦, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\246", "\342\225\227"},
+		/* ═, ╠, ╩, ╣ */
+		{"\342\225\220", "\342\225\240", "\342\225\251", "\342\225\243"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ═, ╚, ═, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\220", "\342\225\235"},
+		/* N/A, ║, ║, ║ */
+		{"", "\342\225\221", "\342\225\221", "\342\225\221"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"},
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double4format = {
+	"unicode-double4",
+	{
+		/* ═, ╔, ╦, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\246", "\342\225\227"},
+		/* ═, ╠, ╬, ╣ */
+		{"\342\225\220", "\342\225\240", "\342\225\254", "\342\225\243"},
+		/* ─, ╟, ╫, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\225\253", "\342\225\242"},
+		/* ═, ╚, ╩, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\251", "\342\225\235"},
+		/* N/A, ║, ║, ║ */
+		{"", "\342\225\221", "\342\225\221", "\342\225\221"},
+		/* N/A, ║, ║, ║ */
+		{"", "\342\225\221", "\342\225\221", "\342\225\221"}
+	},
+	/* ║ */
+	"\342\225\221",
+	/* ║ */
+	"\342\225\221",
+	/* ║ */
+	"\342\225\221",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8double5format = {
+	"unicode-double5",
+	{
+		/* ─, ┌, ┬, ┐ */
+		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
+		/* ═, ╞, ╪, ╡ */
+		{"\342\225\220", "\342\225\236", "\342\225\252", "\342\225\241"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, └, ┴, ┘ */
+		{"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8bold1format = {
+	"unicode-bold1",
+	{
+		/* ─, ┌, ┬, ┐ */
+		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
+		/* ━, ┝, ┿, ┥ */
+		{"\342\224\201", "\342\224\235", "\342\224\277", "\342\224\245"},
+		/* ─, ├, ┼, ┤ */
+		{"\342\224\200", "\342\224\234", "\342\224\274", "\342\224\244"},
+		/* ─, └, ┴, ┘ */
+		{"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_utf8bold2format = {
+	"unicode-bold2",
+	{
+		/* ━, ┏, ┯, ┓ */
+		{"\342\224\201", "\342\224\217", "\342\224\257", "\342\224\223"},
+		/* ━, ┣, ┿, ┫ */
+		{"\342\224\201", "\342\224\243", "\342\224\277", "\342\224\253"},
+		/* ─, ┠, ┼, ┨ */
+		{"\342\224\200", "\342\224\240", "\342\224\274", "\342\224\250"},
+		/* ━, ┗, ┷, ┛ */
+		{"\342\224\201", "\342\224\227", "\342\224\267", "\342\224\233"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\203", "\342\224\202", "\342\224\203"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\203", "\342\224\202", "\342\224\203"}
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
 
 /* Local functions */
 static int	strlen_max_width(unsigned char *str, int *target_width, int encoding);
@@ -465,9 +720,9 @@ _print_horizontal_line(const unsigned int ncolumns, const unsigned int *widths,
 	unsigned int i,
 				j;
 
-	if (border == 1)
+	if (border == 1 || border == 3)
 		fputs(lformat->hrule, fout);
-	else if (border == 2)
+	else if (border == 2 || border == 4)
 		fprintf(fout, "%s%s", lformat->leftvrule, lformat->hrule);
 
 	for (i = 0; i < ncolumns; i++)
@@ -485,9 +740,9 @@ _print_horizontal_line(const unsigned int ncolumns, const unsigned int *widths,
 		}
 	}
 
-	if (border == 2)
+	if (border == 2 || border == 4)
 		fprintf(fout, "%s%s", lformat->hrule, lformat->rightvrule);
-	else if (border == 1)
+	else if (border == 1 || border == 3)
 		fputs(lformat->hrule, fout);
 
 	fputc('\n', fout);
@@ -505,6 +760,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	unsigned short opt_border = cont->opt->border;
 	const printTextFormat *format = get_line_style(cont->opt);
 	const printTextLineFormat *dformat = &format->lrule[PRINT_RULE_DATA];
+	const printTextLineFormat *hformat = &format->lrule[PRINT_RULE_ATTRNAME];
 
 	unsigned int col_count = 0,
 				cell_count = 0;
@@ -524,6 +780,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	unsigned int total_header_width;
 	unsigned int extra_row_output_lines = 0;
 	unsigned int extra_output_lines = 0;
+	bool first_datarow = true;
 
 	const char *const * ptr;
 
@@ -538,8 +795,8 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	if (cancel_pressed)
 		return;
 
-	if (opt_border > 2)
-		opt_border = 2;
+	if (opt_border > 4)
+		opt_border = 4;
 
 	if (cont->ncolumns > 0)
 	{
@@ -817,7 +1074,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 			int			more_col_wrapping;
 			int			curr_nl_line;
 
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				_print_horizontal_line(col_count, width_wrap, opt_border,
 									   PRINT_RULE_TOP, format, fout);
 
@@ -831,8 +1088,8 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 			memset(header_done, false, col_count * sizeof(bool));
 			while (more_col_wrapping)
 			{
-				if (opt_border == 2)
-					fputs(dformat->leftvrule, fout);
+				if (opt_border == 2 || opt_border == 4)
+					fputs(hformat->leftvrule, fout);
 
 				for (i = 0; i < cont->ncolumns; i++)
 				{
@@ -866,17 +1123,17 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 							  fout);
 
 					if (opt_border != 0 && i < col_count - 1)
-						fputs(dformat->midvrule, fout);
+						fputs(hformat->midvrule, fout);
 				}
 				curr_nl_line++;
 
-				if (opt_border == 2)
+				if (opt_border == 2 || opt_border == 4)
 					fputs(dformat->rightvrule, fout);
 				fputc('\n', fout);
 			}
 
 			_print_horizontal_line(col_count, width_wrap, opt_border,
-								   PRINT_RULE_MIDDLE, format, fout);
+								   PRINT_RULE_HEADER, format, fout);
 		}
 	}
 
@@ -884,6 +1141,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	for (i = 0, ptr = cont->cells; *ptr; i += col_count, ptr += col_count)
 	{
 		bool		more_lines;
+		bool		first_line = true;
 
 		if (cancel_pressed)
 			break;
@@ -909,8 +1167,17 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 		{
 			more_lines = false;
 
+			if ((opt_border == 3 || opt_border == 4) && !first_datarow && first_line)
+			{
+				_print_horizontal_line(col_count, width_wrap, opt_border,
+								   PRINT_RULE_MIDDLE, format, fout);
+				first_line = false;
+			}
+			else if (first_datarow)
+				first_datarow = false;
+
 			/* left border */
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				fputs(dformat->leftvrule, fout);
 
 			/* for each column */
@@ -920,7 +1187,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 				struct lineptr *this_line = &col_lineptrs[j][curr_nl_line[j]];
 				int			bytes_to_output;
 				int			chars_to_output = width_wrap[j];
-				bool		finalspaces = (opt_border == 2 || j < col_count - 1);
+				bool		finalspaces = ((opt_border == 2 || opt_border == 4) || j < col_count - 1);
 
 				/* Print left-hand wrap or newline mark */
 				if (opt_border != 0)
@@ -1014,7 +1281,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 					fputs(format->wrap_right, fout);
 				else if (wrap[j] == PRINT_LINE_WRAP_NEWLINE)
 					fputs(format->nl_right, fout);
-				else if (opt_border == 2 || j < col_count - 1)
+				else if ((opt_border == 2 || opt_border == 4) || j < col_count - 1)
 					fputc(' ', fout);
 
 				/* Print column divider, if not the last column */
@@ -1032,7 +1299,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 			}
 
 			/* end-of-row border */
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				fputs(dformat->rightvrule, fout);
 			fputc('\n', fout);
 
@@ -1043,7 +1310,7 @@ print_aligned_text(const printTableContent *cont, FILE *fout)
 	{
 		printTableFooter *footers = footers_with_default(cont);
 
-		if (opt_border == 2 && !cancel_pressed)
+		if ((opt_border == 2 || opt_border == 4) && !cancel_pressed)
 			_print_horizontal_line(col_count, width_wrap, opt_border,
 								   PRINT_RULE_BOTTOM, format, fout);
 
@@ -1098,7 +1365,7 @@ print_aligned_vertical_line(const printTableContent *cont,
 	unsigned int i;
 	int			reclen = 0;
 
-	if (opt_border == 2)
+	if (opt_border == 2 || opt_border == 4)
 		fprintf(fout, "%s%s", lformat->leftvrule, lformat->hrule);
 	else if (opt_border == 1)
 		fputs(lformat->hrule, fout);
@@ -1136,7 +1403,7 @@ print_aligned_vertical_line(const printTableContent *cont,
 		reclen = 0;
 	for (i = reclen; i < dwidth; i++)
 		fputs(opt_border > 0 ? lformat->hrule : " ", fout);
-	if (opt_border == 2)
+	if (opt_border == 2 || opt_border == 4)
 		fprintf(fout, "%s%s", lformat->hrule, lformat->rightvrule);
 	fputc('\n', fout);
 }
@@ -1250,14 +1517,14 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 		else if (!(*(ptr + 1)))
 			pos = PRINT_RULE_BOTTOM;
 		else
-			pos = PRINT_RULE_MIDDLE;
+			pos = PRINT_RULE_HEADER;
 
 		if (i % cont->ncolumns == 0)
 		{
 			if (!opt_tuples_only)
 				print_aligned_vertical_line(cont, record++, hwidth, dwidth,
 											pos, fout);
-			else if (i != 0 || !cont->opt->start_table || opt_border == 2)
+			else if (i != 0 || !cont->opt->start_table || opt_border == 2 || opt_border == 4)
 				print_aligned_vertical_line(cont, 0, hwidth, dwidth,
 											pos, fout);
 		}
@@ -1274,7 +1541,7 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 		dcomplete = hcomplete = 0;
 		while (!dcomplete || !hcomplete)
 		{
-			if (opt_border == 2)
+			if (opt_border == 2 || opt_border == 4)
 				fprintf(fout, "%s ", dformat->leftvrule);
 			if (!hcomplete)
 			{
@@ -1317,7 +1584,7 @@ print_aligned_vertical(const printTableContent *cont, FILE *fout)
 
 	if (cont->opt->stop_table)
 	{
-		if (opt_border == 2 && !cancel_pressed)
+		if ((opt_border == 2 || opt_border == 4) && !cancel_pressed)
 			print_aligned_vertical_line(cont, 0, hwidth, dwidth,
 										PRINT_RULE_BOTTOM, fout);
 
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index 9cfa3b6..f5c527d 100644
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
@@ -37,8 +37,10 @@ typedef enum printTextRule
 {
 	/* Additional context for selecting line drawing characters */
 	PRINT_RULE_TOP,				/* top horizontal line */
+	PRINT_RULE_HEADER,			/* header-data horizontal line */
 	PRINT_RULE_MIDDLE,			/* intra-data horizontal line */
 	PRINT_RULE_BOTTOM,			/* bottom horizontal line */
+	PRINT_RULE_ATTRNAME,			/* separators between attrnames */
 	PRINT_RULE_DATA				/* data line (hrule is unused here) */
 } printTextRule;
 
@@ -54,7 +56,7 @@ typedef struct printTextFormat
 {
 	/* A complete line style */
 	const char *name;			/* for display purposes */
-	printTextLineFormat lrule[4];		/* indexed by enum printTextRule */
+	printTextLineFormat lrule[6];		/* indexed by enum printTextRule */
 	const char *midvrule_nl;	/* vertical line for continue after newline */
 	const char *midvrule_wrap;	/* vertical line for wrapped data */
 	const char *midvrule_blank; /* vertical line for blank data */
@@ -152,7 +154,15 @@ typedef struct printQueryOpt
 extern const printTextFormat pg_asciiformat;
 extern const printTextFormat pg_asciiformat_old;
 extern const printTextFormat pg_utf8format;
-
+extern const printTextFormat pg_utf8format2;
+
+extern const printTextFormat pg_utf8double1format;
+extern const printTextFormat pg_utf8double2format;
+extern const printTextFormat pg_utf8double3format;
+extern const printTextFormat pg_utf8double4format;
+extern const printTextFormat pg_utf8double5format;
+extern const printTextFormat pg_utf8bold1format;
+extern const printTextFormat pg_utf8bold2format;
 
 extern FILE *PageOutput(int lines, unsigned short int pager);
 extern void ClosePager(FILE *pagerpipe);
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 2a0bb71..5c74c9d 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3355,10 +3355,20 @@ psql_completion(char *text, int start, int end)
 		else if (strcmp(prev_wd, "linestyle") == 0)
 		{
 			static const char *const my_list[] =
-			{"ascii", "old-ascii", "unicode", NULL};
+			{"ascii", "old-ascii", "unicode", "unicode2", "unicode-double1",
+		 "unicode-double2", "unicode-double3", "unicode-double4", "unicode-double5",
+		 "unicode-bold1", "unicode-bold2", NULL};
 
 			COMPLETE_WITH_LIST_CS(my_list);
 		}
+		else if (strcmp(prev_wd, "border") == 0 &&
+				strcmp(prev2_wd, "\\pset") == 0)
+		{
+			static const char *const list_PREPARE[] =
+				{"0", "1", "2", "3", "4", NULL};
+
+			COMPLETE_WITH_LIST(list_PREPARE);
+		}
 	}
 	else if (strcmp(prev_wd, "\\set") == 0)
 	{
#14Merlin Moncure
mmoncure@gmail.com
In reply to: Pavel Stehule (#12)
Re: new unicode table border styles for psql

On Fri, Nov 22, 2013 at 2:23 AM, Pavel Stehule <pavel.stehule@gmail.com> wrote:

Hello

2013/11/21 Merlin Moncure <mmoncure@gmail.com>

On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for
final presentation.

great. hm, maybe we could integrate color? (see:

http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html).

it is next possible enhancing - I would to go forward in small steps, please
:)

minimally (and independent on proposed patch) we can introduce some like
"final regexp filtering" - that can be used for this or other purposes.

Yeah. A per field regexp would do the trick. As you have it, I like
Peter's idea best. Being able to specify the various character codes
makes a lot of sense.

merlin

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#15Pavel Stehule
pavel.stehule@gmail.com
In reply to: Merlin Moncure (#14)
Re: new unicode table border styles for psql

2013/11/22 Merlin Moncure <mmoncure@gmail.com>

On Fri, Nov 22, 2013 at 2:23 AM, Pavel Stehule <pavel.stehule@gmail.com>
wrote:

Hello

2013/11/21 Merlin Moncure <mmoncure@gmail.com>

On Thu, Nov 21, 2013 at 1:09 AM, Pavel Stehule <pavel.stehule@gmail.com

wrote:

Hello

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for
final presentation.

great. hm, maybe we could integrate color? (see:

http://merlinmoncure.blogspot.com/2012/09/psql-now-with-splash-of-color.html
).

it is next possible enhancing - I would to go forward in small steps,

please

:)

minimally (and independent on proposed patch) we can introduce some like
"final regexp filtering" - that can be used for this or other purposes.

Yeah. A per field regexp would do the trick. As you have it, I like
Peter's idea best. Being able to specify the various character codes
makes a lot of sense.

there is other issue - simply parser will be really user unfriendly, and
user friendly parser will not by simply :(

have you some idea about input format?

Regards

Pavel

Show quoted text

merlin

#16Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Pavel Stehule (#11)
Re: new unicode table border styles for psql

Pavel Stehule escribi�:

2013/11/21 Peter Eisentraut <peter_e@gmx.net>

Maybe make the border setting a string containing the various characters
by index. Then everyone can create their own crazy borders.

I seriously though about it, but not sure if it is good way.

How about having a single "unicode" line style, and then have a
different \pset setting to determine exactly what chars to print? This
wouldn't allow for programmability, but it seems better UI to me.
This proliferation of unicode line style names seems odd.

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#17Merlin Moncure
mmoncure@gmail.com
In reply to: Alvaro Herrera (#16)
Re: new unicode table border styles for psql

On Fri, Nov 22, 2013 at 8:45 AM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:

Pavel Stehule escribió:

2013/11/21 Peter Eisentraut <peter_e@gmx.net>

Maybe make the border setting a string containing the various characters
by index. Then everyone can create their own crazy borders.

I seriously though about it, but not sure if it is good way.

How about having a single "unicode" line style, and then have a
different \pset setting to determine exactly what chars to print? This
wouldn't allow for programmability, but it seems better UI to me.
This proliferation of unicode line style names seems odd.

That makes sense to me, especially if you could pass escapes.

merlin

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#18Pavel Stehule
pavel.stehule@gmail.com
In reply to: Alvaro Herrera (#16)
Re: new unicode table border styles for psql

2013/11/22 Alvaro Herrera <alvherre@2ndquadrant.com>

Pavel Stehule escribió:

2013/11/21 Peter Eisentraut <peter_e@gmx.net>

Maybe make the border setting a string containing the various

characters

by index. Then everyone can create their own crazy borders.

I seriously though about it, but not sure if it is good way.

How about having a single "unicode" line style, and then have a
different \pset setting to determine exactly what chars to print? This
wouldn't allow for programmability, but it seems better UI to me.
This proliferation of unicode line style names seems odd.

-1

After thinking I don't see any value for common user. Users like you, me,
Merlin are able to parametrize output or patching source code.

Any parametrization expect some secure store, that will support exchange of
styles. And it expect robust parser of unicode strings, or ascii strings
with unicode escaped chars.

We cannot parse a escaped unicode chars now on client side, and cost of
parser is higher of benefit externally parametrized borders.

Regards

Pavel

Show quoted text

--
Įlvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

#19Vik Fearing
vik.fearing@dalibo.com
In reply to: Peter Eisentraut (#9)
Re: new unicode table border styles for psql

On 11/21/2013 10:39 PM, Peter Eisentraut wrote:

On 11/21/13, 2:09 AM, Pavel Stehule wrote:

I wrote new styles for psql table borders.

http://postgres.cz/wiki/Pretty_borders_in_psql

This patch is simply and I am think so some styles can be interesting
for final presentation.

Do you think so this feature is generally interesting and should be in core?

Maybe make the border setting a string containing the various characters
by index. Then everyone can create their own crazy borders.

I vote for doing it this way.

We would provide a default setting, and the documentation would show
other examples. Perhaps even set up a "repository" on a wiki page or
something.

--
Vik

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#20Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Pavel Stehule (#15)
Re: new unicode table border styles for psql

Pavel Stehule <pavel.stehule@gmail.com> writes:

there is other issue - simply parser will be really user unfriendly, and
user friendly parser will not by simply :(

If simple things are hard to implement, get yourself better tools.

Each time we get on the topic of improving scripting abilities for our
interactive tool, it's always the same problem: having to invent a
scripting language with a whole parser is just too much work.

Maybe it's time we step back a little and consider real scripting
solutions to embed into psql, and pgbench too:

http://ecls.sourceforge.net/ LGPL Common Lisp
http://www.gnu.org/software/guile/ LGPL Scheme, Javascript, Emacs Lisp
http://www.lua.org/ MIT Lua

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#21Merlin Moncure
mmoncure@gmail.com
In reply to: Dimitri Fontaine (#20)
Re: new unicode table border styles for psql

On Mon, Nov 25, 2013 at 3:33 AM, Dimitri Fontaine
<dimitri@2ndquadrant.fr> wrote:

Pavel Stehule <pavel.stehule@gmail.com> writes:

there is other issue - simply parser will be really user unfriendly, and
user friendly parser will not by simply :(

If simple things are hard to implement, get yourself better tools.

Each time we get on the topic of improving scripting abilities for our
interactive tool, it's always the same problem: having to invent a
scripting language with a whole parser is just too much work.

Maybe it's time we step back a little and consider real scripting
solutions to embed into psql, and pgbench too:

I'm thinking (did I miss something?) that Pavel was commenting merely
on the parsing of setting unicode border characters, not the wider
scripting of psql. (psql scripting is a fun topic to discuss though
:-)).

merlin

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#22Andrew Dunstan
andrew@dunslane.net
In reply to: Merlin Moncure (#21)
Re: new unicode table border styles for psql

On 11/25/2013 09:00 AM, Merlin Moncure wrote:

On Mon, Nov 25, 2013 at 3:33 AM, Dimitri Fontaine
<dimitri@2ndquadrant.fr> wrote:

Pavel Stehule <pavel.stehule@gmail.com> writes:

there is other issue - simply parser will be really user unfriendly, and
user friendly parser will not by simply :(

If simple things are hard to implement, get yourself better tools.

Each time we get on the topic of improving scripting abilities for our
interactive tool, it's always the same problem: having to invent a
scripting language with a whole parser is just too much work.

Maybe it's time we step back a little and consider real scripting
solutions to embed into psql, and pgbench too:

I'm thinking (did I miss something?) that Pavel was commenting merely
on the parsing of setting unicode border characters, not the wider
scripting of psql. (psql scripting is a fun topic to discuss though
:-)).

Even if it is it's totally off topic. Please don't hijack email threads.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#23Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Andrew Dunstan (#22)
Re: new unicode table border styles for psql

Andrew Dunstan <andrew@dunslane.net> writes:

Even if it is it's totally off topic. Please don't hijack email threads.

Well, when I read that parsing a user setup is too complex, for me that
calls for a solution that offers more power to the user without us
having to write specialized code each time.

I'm sorry, but I don't understand how off-topic or hijack applies here.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#24Andrew Dunstan
andrew@dunslane.net
In reply to: Dimitri Fontaine (#23)
Re: new unicode table border styles for psql

On 11/25/2013 09:33 AM, Dimitri Fontaine wrote:

Andrew Dunstan <andrew@dunslane.net> writes:

Even if it is it's totally off topic. Please don't hijack email threads.

Well, when I read that parsing a user setup is too complex, for me that
calls for a solution that offers more power to the user without us
having to write specialized code each time.

I'm sorry, but I don't understand how off-topic or hijack applies here.

It just seems to me to be a very big stretch to go from the topic of
psql border styles to the topic of psql scripting support. Your use case
would surely be using a sledgehammer to crack a nut. By all means argue
for better scripting support in psql, but I would suggest your argument
would be better if the use case were something more important and
central to psql's purpose.

cheers

andrew

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#25Dimitri Fontaine
dimitri@2ndQuadrant.fr
In reply to: Andrew Dunstan (#24)
Re: new unicode table border styles for psql

Andrew Dunstan <andrew@dunslane.net> writes:

I'm sorry, but I don't understand how off-topic or hijack applies here.

And I just realize there's another way to read what Pavel said, which is
that *user scripts* parsing the output of psql might become harder to
write as soon as they don't control the default border style in use.

Well in that case, yes I'm vastly off-topic.

I was answering to how to parse the user setting itself, so writing C
code inside the psql source tree itself, and how to expose a fine
grained solution to that problem without having to write a whole new
configuration parser.

It just seems to me to be a very big stretch to go from the topic of psql
border styles to the topic of psql scripting support. Your use case would
surely be using a sledgehammer to crack a nut. By all means argue for better
scripting support in psql, but I would suggest your argument would be better
if the use case were something more important and central to psql's purpose.

I think I just understood something entirely different that what you
were talking about.

--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#26Pavel Stehule
pavel.stehule@gmail.com
In reply to: Dimitri Fontaine (#23)
Re: new unicode table border styles for psql

sorry for offtopic

2013/11/25 Dimitri Fontaine <dimitri@2ndquadrant.fr>

Andrew Dunstan <andrew@dunslane.net> writes:

Even if it is it's totally off topic. Please don't hijack email threads.

Well, when I read that parsing a user setup is too complex, for me that
calls for a solution that offers more power to the user without us
having to write specialized code each time.

I have a idea about sql shell with lua support - but probably as separate
application and partially written in Lua. I have no plan to push scripting
possibilities to psql.

Regards

Pavel

Show quoted text

I'm sorry, but I don't understand how off-topic or hijack applies here.

Regards,
--
Dimitri Fontaine
http://2ndQuadrant.fr PostgreSQL : Expertise, Formation et Support

#27Peter Eisentraut
peter_e@gmx.net
In reply to: Pavel Stehule (#13)
Re: new unicode table border styles for psql

On 11/22/13, 3:26 AM, Pavel Stehule wrote:

website is related to patch for 9.3 (I add note there)

patch for 9.4 is fixed - and now with small doc

I think it would help if we considered the new border styles and the new
line styles separately.

I don't find the new border styles to be particularly useful. They just
use up vertical screen space, which is usually more precious than
vertical space. Is there a situation where you would find these styles
to be more useful than the existing ones? Keep in mind that pset is
usually set permanently, so it wouldn't be practical to use a different
border style depending on how the query results shape up (like \x auto).

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#28Pavel Stehule
pavel.stehule@gmail.com
In reply to: Peter Eisentraut (#27)
Re: new unicode table border styles for psql

2013/11/26 Peter Eisentraut <peter_e@gmx.net>

On 11/22/13, 3:26 AM, Pavel Stehule wrote:

website is related to patch for 9.3 (I add note there)

patch for 9.4 is fixed - and now with small doc

I think it would help if we considered the new border styles and the new
line styles separately.

I don't find the new border styles to be particularly useful. They just
use up vertical screen space, which is usually more precious than
vertical space. Is there a situation where you would find these styles
to be more useful than the existing ones? Keep in mind that pset is
usually set permanently, so it wouldn't be practical to use a different
border style depending on how the query results shape up (like \x auto).

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

+1

Pavel

#29Pavel Stehule
pavel.stehule@gmail.com
In reply to: Pavel Stehule (#28)
1 attachment(s)
Re: new unicode table border styles for psql

2013/11/26 Pavel Stehule <pavel.stehule@gmail.com>

2013/11/26 Peter Eisentraut <peter_e@gmx.net>

On 11/22/13, 3:26 AM, Pavel Stehule wrote:

website is related to patch for 9.3 (I add note there)

patch for 9.4 is fixed - and now with small doc

I think it would help if we considered the new border styles and the new
line styles separately.

I don't find the new border styles to be particularly useful. They just
use up vertical screen space, which is usually more precious than
vertical space. Is there a situation where you would find these styles
to be more useful than the existing ones? Keep in mind that pset is
usually set permanently, so it wouldn't be practical to use a different
border style depending on how the query results shape up (like \x auto).

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I am sending reduced patch

I add a double1, double4 and double5 - renamed to double1,double2, double3

support for border 3 and 4 removed

postgres=# \pset linestyle double1 \pset border 2 \l
Line style (linestyle) is double1.
Border style (border) is 2.
List of databases
┌───────────┬──────────┬──────────┬─────────────┬─────────────┬───────────────────────┐
│ Name │ Owner │ Encoding │ Collate │ Ctype │ Access
privileges │
╞═══════════╪══════════╪══════════╪═════════════╪═════════════╪═══════════════════════╡
│ postgres │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8
│ │
│ template0 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
=c/postgres │
│ │ │ │ │ │
postgres=CTc/postgres │
│ template1 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
=c/postgres │
│ │ │ │ │ │
postgres=CTc/postgres │
└───────────┴──────────┴──────────┴─────────────┴─────────────┴───────────────────────┘
(3 rows)

postgres=# \pset linestyle double2 \pset border 2 \l
Line style (linestyle) is double2.
Border style (border) is 2.
List of databases
╔═══════════╤══════════╤══════════╤═════════════╤═════════════╤═══════════════════════╗
║ Name │ Owner │ Encoding │ Collate │ Ctype │ Access
privileges ║
╟───────────┼──────────┼──────────┼─────────────┼─────────────┼───────────────────────╢
║ postgres │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8
│ ║
║ template0 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
=c/postgres ║
║ │ │ │ │ │
postgres=CTc/postgres ║
║ template1 │ postgres │ UTF8 │ en_US.UTF-8 │ en_US.UTF-8 │
=c/postgres ║
║ │ │ │ │ │
postgres=CTc/postgres ║
╚═══════════╧══════════╧══════════╧═════════════╧═════════════╧═══════════════════════╝
(3 rows)

postgres=# \pset linestyle double3 \pset border 2 \l
Line style (linestyle) is double3.
Border style (border) is 2.
List of databases
╔═══════════╦══════════╦══════════╦═════════════╦═════════════╦═══════════════════════╗
║ Name ║ Owner ║ Encoding ║ Collate ║ Ctype ║ Access
privileges ║
╠═══════════╬══════════╬══════════╬═════════════╬═════════════╬═══════════════════════╣
║ postgres ║ postgres ║ UTF8 ║ en_US.UTF-8 ║ en_US.UTF-8
║ ║
║ template0 ║ postgres ║ UTF8 ║ en_US.UTF-8 ║ en_US.UTF-8 ║
=c/postgres ║
║ ║ ║ ║ ║ ║
postgres=CTc/postgres ║
║ template1 ║ postgres ║ UTF8 ║ en_US.UTF-8 ║ en_US.UTF-8 ║
=c/postgres ║
║ ║ ║ ║ ║ ║
postgres=CTc/postgres ║
╚═══════════╩══════════╩══════════╩═════════════╩═════════════╩═══════════════════════╝
(3 rows)

Pavel

Show quoted text

Attachments:

linestyle-double.patchtext/x-patch; charset=UTF-8; name=linestyle-double.patchDownload
commit 47b3258db6e3e82399417f57ad551ad740348635
Author: Pavel Stehule <pavel.stehule@gooddata.com>
Date:   Wed Nov 27 15:09:01 2013 +0100

    initial

diff --git a/doc/src/sgml/ref/psql-ref.sgml b/doc/src/sgml/ref/psql-ref.sgml
index 264cfe6..6e74690 100644
--- a/doc/src/sgml/ref/psql-ref.sgml
+++ b/doc/src/sgml/ref/psql-ref.sgml
@@ -2088,9 +2088,10 @@ lo_import 152801
           <para>
           Sets the border line drawing style to one
           of <literal>ascii</literal>, <literal>old-ascii</literal>
-          or <literal>unicode</literal>.
-          Unique abbreviations are allowed.  (That would mean one
-          letter is enough.)
+          or <literal>unicode</literal>, <literal>double1</literal>,
+          <literal>double2</literal> or <literal>double3</literal>
+          (unicode styles). 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.
diff --git a/src/bin/psql/command.c b/src/bin/psql/command.c
index 638d8cb..91bb838 100644
--- a/src/bin/psql/command.c
+++ b/src/bin/psql/command.c
@@ -2285,9 +2285,16 @@ do_pset(const char *param, const char *value, printQueryOpt *popt, bool quiet)
 			popt->topt.line_style = &pg_asciiformat_old;
 		else if (pg_strncasecmp("unicode", value, vallen) == 0)
 			popt->topt.line_style = &pg_utf8format;
+		else if (pg_strncasecmp("double1", value, vallen) == 0)
+			popt->topt.line_style = &pg_double1format;
+		else if (pg_strncasecmp("double2", value, vallen) == 0)
+			popt->topt.line_style = &pg_double2format;
+		else if (pg_strncasecmp("double3", value, vallen) == 0)
+			popt->topt.line_style = &pg_double3format;
 		else
 		{
-			psql_error("\\pset: allowed line styles are ascii, old-ascii, unicode\n");
+			psql_error("\\pset: allowed line styles are ascii, old-ascii, unicode, "
+				   "double1, double2, double3\n");
 			return false;
 		}
 
diff --git a/src/bin/psql/print.c b/src/bin/psql/print.c
index 736225c..afe9f13 100644
--- a/src/bin/psql/print.c
+++ b/src/bin/psql/print.c
@@ -121,6 +121,83 @@ const printTextFormat pg_utf8format =
 	true
 };
 
+const printTextFormat pg_double1format = {
+	"double1",
+	{
+		/* ─, ┌, ┬, ┐ */
+		{"\342\224\200", "\342\224\214", "\342\224\254", "\342\224\220"},
+		/* ═, ╞, ╪, ╡ */
+		{"\342\225\220", "\342\225\236", "\342\225\252", "\342\225\241"},
+		/* ─, └, ┴, ┘ */
+		{"\342\224\200", "\342\224\224", "\342\224\264", "\342\224\230"},
+		/* N/A, │, │, │ */
+		{"", "\342\224\202", "\342\224\202", "\342\224\202"},
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_double2format = {
+	"double2",
+	{
+		/* ═, ╔, ╤, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\244", "\342\225\227"},
+		/* ─, ╟, ┼, ╢ */
+		{"\342\224\200", "\342\225\237", "\342\224\274", "\342\225\242"},
+		/* ═, ╚, ╧, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\247", "\342\225\235"},
+		/* N/A, ║, │, ║ */
+		{"", "\342\225\221", "\342\224\202", "\342\225\221"},
+	},
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	/* │ */
+	"\342\224\202",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
+
+const printTextFormat pg_double3format = {
+	"double3",
+	{
+		/* ═, ╔, ╦, ╗ */
+		{"\342\225\220", "\342\225\224", "\342\225\246", "\342\225\227"},
+		/* ═, ╠, ╬, ╣ */
+		{"\342\225\220", "\342\225\240", "\342\225\254", "\342\225\243"},
+		/* ═, ╚, ╩, ╝ */
+		{"\342\225\220", "\342\225\232", "\342\225\251", "\342\225\235"},
+		/* N/A, ║, ║, ║ */
+		{"", "\342\225\221", "\342\225\221", "\342\225\221"},
+	},
+	/* ║ */
+	"\342\225\221",
+	/* ║ */
+	"\342\225\221",
+	/* ║ */
+	"\342\225\221",
+	" ",
+	" ",
+	" ",
+	" ",
+	" ",
+	false
+};
 
 /* Local functions */
 static int	strlen_max_width(unsigned char *str, int *target_width, int encoding);
diff --git a/src/bin/psql/print.h b/src/bin/psql/print.h
index 9cfa3b6..d72e364 100644
--- a/src/bin/psql/print.h
+++ b/src/bin/psql/print.h
@@ -152,6 +152,9 @@ typedef struct printQueryOpt
 extern const printTextFormat pg_asciiformat;
 extern const printTextFormat pg_asciiformat_old;
 extern const printTextFormat pg_utf8format;
+extern const printTextFormat pg_double1format;
+extern const printTextFormat pg_double2format;
+extern const printTextFormat pg_double3format;
 
 
 extern FILE *PageOutput(int lines, unsigned short int pager);
diff --git a/src/bin/psql/tab-complete.c b/src/bin/psql/tab-complete.c
index 2a0bb71..e4159c3 100644
--- a/src/bin/psql/tab-complete.c
+++ b/src/bin/psql/tab-complete.c
@@ -3355,7 +3355,8 @@ psql_completion(char *text, int start, int end)
 		else if (strcmp(prev_wd, "linestyle") == 0)
 		{
 			static const char *const my_list[] =
-			{"ascii", "old-ascii", "unicode", NULL};
+			{"ascii", "old-ascii", "unicode",
+			 "double1", "double2", "double3",  NULL};
 
 			COMPLETE_WITH_LIST_CS(my_list);
 		}
#30Robert Haas
robertmhaas@gmail.com
In reply to: Peter Eisentraut (#27)
Re: new unicode table border styles for psql

On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I'm confused why we need ANY of these. What problem are we solving
that the existing unicode style doesn't already solve? We could
doubtless invent an infinite or at least very large number of
plausible ways to border psql output, but I don't see that as
something that has value.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#31Alvaro Herrera
alvherre@2ndquadrant.com
In reply to: Robert Haas (#30)
Re: new unicode table border styles for psql

Robert Haas escribi�:

On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I'm confused why we need ANY of these. What problem are we solving
that the existing unicode style doesn't already solve? We could
doubtless invent an infinite or at least very large number of
plausible ways to border psql output, but I don't see that as
something that has value.

You know what I think would have some value? An output style that emits
DocBook markup for tables, something which we could paste on the docs.
(I already use the LaTeX mode to paste in presentation slides.)

--
�lvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#32Robert Haas
robertmhaas@gmail.com
In reply to: Alvaro Herrera (#31)
Re: new unicode table border styles for psql

On Thu, Nov 28, 2013 at 4:48 PM, Alvaro Herrera
<alvherre@2ndquadrant.com> wrote:

Robert Haas escribió:

On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I'm confused why we need ANY of these. What problem are we solving
that the existing unicode style doesn't already solve? We could
doubtless invent an infinite or at least very large number of
plausible ways to border psql output, but I don't see that as
something that has value.

You know what I think would have some value? An output style that emits
DocBook markup for tables, something which we could paste on the docs.
(I already use the LaTeX mode to paste in presentation slides.)

Sure. I have never personally wanted that, but I see the value of it:
it makes something that's probably annoying to do right now simple.
That's a functional enhancement; this is not.

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#33Peter Eisentraut
peter_e@gmx.net
In reply to: Robert Haas (#30)
Re: new unicode table border styles for psql

On Thu, 2013-11-28 at 16:23 -0500, Robert Haas wrote:

On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net>
wrote:

Now for the linestyles. I can see how some of them are attractive,

but

several of them have poor aesthetics, I think. I don't see a reason

to

accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I'm confused why we need ANY of these.

I'm not actually in favor of adding any of these. I was just trying to
say that any but the ones I mentioned I don't consider acceptable at
all.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#34Peter Eisentraut
peter_e@gmx.net
In reply to: Alvaro Herrera (#31)
Re: new unicode table border styles for psql

On Thu, 2013-11-28 at 18:48 -0300, Alvaro Herrera wrote:

An output style that emits
DocBook markup for tables, something which we could paste on the docs.

DocBook supports HTML tables from version 4.3 on. We currently use
version 4.2, but we could presumably raise that if needed.

--
Sent via pgsql-hackers mailing list (pgsql-hackers@postgresql.org)
To make changes to your subscription:
http://www.postgresql.org/mailpref/pgsql-hackers

#35Pavel Stehule
pavel.stehule@gmail.com
In reply to: Robert Haas (#30)
Re: new unicode table border styles for psql

2013/11/28 Robert Haas <robertmhaas@gmail.com>

On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net> wrote:

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I'm confused why we need ANY of these. What problem are we solving
that the existing unicode style doesn't already solve? We could
doubtless invent an infinite or at least very large number of
plausible ways to border psql output, but I don't see that as
something that has value.

It has primary aesthetic value - not much more (similar value has original
unicode border)

With this patch you can prepare a little bit nicer (plain text) reports
without using special software. And a implementation is really simply - so
it offer sympathetic benefit without any cost.

Regards

Pavel

Show quoted text

--
Robert Haas
EnterpriseDB: http://www.enterprisedb.com
The Enterprise PostgreSQL Company

#36Pavel Stehule
pavel.stehule@gmail.com
In reply to: Alvaro Herrera (#31)
Re: new unicode table border styles for psql

2013/11/28 Alvaro Herrera <alvherre@2ndquadrant.com>

Robert Haas escribió:

On Tue, Nov 26, 2013 at 2:08 PM, Peter Eisentraut <peter_e@gmx.net>

wrote:

Now for the linestyles. I can see how some of them are attractive, but
several of them have poor aesthetics, I think. I don't see a reason to
accept 7 new styles just for fun. If I had to choose, I'd consider
-double1 and -double4 to be acceptable.

I'm confused why we need ANY of these. What problem are we solving
that the existing unicode style doesn't already solve? We could
doubtless invent an infinite or at least very large number of
plausible ways to border psql output, but I don't see that as
something that has value.

You know what I think would have some value? An output style that emits
DocBook markup for tables, something which we could paste on the docs.
(I already use the LaTeX mode to paste in presentation slides.)

Although it sounds crazy - some unicode-doubleX looks well (although it is
subjective) and I use it in presentation (and wiki) too - just copy/paste.

Nothing against DocBook support (or any modern markdown (mediawiki, ..)
formats).

Pavel

Show quoted text

--
Álvaro Herrera http://www.2ndQuadrant.com/
PostgreSQL Development, 24x7 Support, Training & Services