You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The \fBpspg\fR can be simply installed from Debian (Ubuntu) repositories\. RedHat (Fedora) repositories contains \fBpspg\fR too:
41
+
.IP""4
42
+
.nf
43
+
# Debian (Ubuntu)
44
+
sudo apt\-get install pspg
45
+
46
+
# RedHat (Fedora)
47
+
sudo dnf install pspg
48
+
.fi
49
+
.IP""0
50
+
.P
51
+
Basic configuration is very simple \- just set system environment variable \fBPSQL_PAGER\fR:
52
+
.IP""4
53
+
.nf
54
+
export PSQL_PAGER=\'pspg \-X \-b\'
55
+
.fi
56
+
.IP""0
57
+
.P
58
+
Native installation on MS Windows is not supported, but \fBpspg\fR works well inside \fBwsl2\fR\. Inside wsl2 environment, the installation is same like on used Linux system\.
59
+
.P
60
+
Installation on macOS/homebrew is simple by \fBbrewinstallpspg\fR\.
Some keys can be marked by symobol\fB*\fR\. Marked keys are used for odd records\.
243
+
Some keys can be marked by symbol\fB*\fR\. Marked keys are used for odd records\.
220
244
.IP""4
221
245
.nf
222
246
data* = black, lightgray
@@ -350,15 +374,15 @@ Command Description
350
374
\fB\ethemeN\fR set theme number
351
375
\fB\ecopy[all\e|selected][nullstr"str"][csv\e|tsv\e|insert\e|text\e|pipesep\e|sqlvalues]\fR copy data to clipboard
352
376
\fB\esave[all\e|selected][nullstr"str"][csv\e|tsv\e|insert\e|text\e|pipesep\e|sqlvalues]\fR copy data to clipboard
353
-
\fB\eorder[N\e|columname]\fR sort by colum
354
-
\fB\eorderd[N\e|columname]\fR desc sort by column
355
-
\fB\esort[N\e|columname]\fR sort by colum
356
-
\fB\esortd[N\e|columname]\fR desc sort by column
357
-
\fB\edsort[N\e|columname]\fR desc sort by column (alias)
358
-
\fB\ersort[N\e|columname]\fR desc sort by column (alias)
359
-
\fB\easc[N\e|columname]\fR sort by colum (alias)
360
-
\fB\edesc[N\e|columname]\fR desc sort by colum (alias)
361
-
\fB\esearch[back][selected][columname][string\e|"string"]\fR search string in data
377
+
\fB\eorder[N\e|columnname]\fR sort by column
378
+
\fB\eorderd[N\e|columnname]\fR desc sort by column
379
+
\fB\esort[N\e|columnname]\fR sort by column
380
+
\fB\esortd[N\e|columnname]\fR desc sort by column
381
+
\fB\edsort[N\e|columnname]\fR desc sort by column (alias)
382
+
\fB\ersort[N\e|columnname]\fR desc sort by column (alias)
383
+
\fB\easc[N\e|columnname]\fR sort by column (alias)
384
+
\fB\edesc[N\e|columnname]\fR desc sort by column (alias)
385
+
\fB\esearch[back][selected][columnname][string\e|"string"]\fR search string in data
362
386
.TE
363
387
.P
364
388
The output can be redirected to any command when the name starts with pipe symbol:
@@ -370,18 +394,18 @@ The output can be redirected to any command when the name starts with pipe symbo
370
394
.SH "Ending"
371
395
The pager can be ended by pressing keys \fBq\fR or \fBF10\fR or \fBEsc\fR\fB0\fR\. With option \fB\-\-on\-sigint\-exit\fR then the pager is closed by pressing keys \fBCtrl\fR+\fBc\fR or \fBEsc\fR\fBEsc\fR\.
pspg supports a possibility to use a sequence of keys \fBEsc\fR, \fBkey\fR instead an combination of \fBAlt\fR+\fBkey\fR\. The interval between pressing \fBEsc\fR and \fBkey\fR is limmited by interval specified by option \fBesc\-delay\fR or by configuration\'s option \fBesc_delay\fR\. This is max delay time in ms\. After this interval, the single pressing \fBEsc\fR is interpreted as \fBEscape\fR\.\-1 meas unlimited, 0 disables this feature\.
397
+
pspg supports a possibility to use a sequence of keys \fBEsc\fR, \fBkey\fR instead an combination of \fBAlt\fR+\fBkey\fR\. The interval between pressing \fBEsc\fR and \fBkey\fR is limited by interval specified by option \fBesc\-delay\fR or by configuration\'s option \fBesc_delay\fR\. This is max delay time in ms\. After this interval, the single pressing \fBEsc\fR is interpreted as \fBEscape\fR\.\-1 meas unlimited, 0 disables this feature\.
374
398
.SH "Column search"
375
399
Column search is case insensitive every time\. Searched column is marked by vertical cursor\. Last non empty string searching pattern is used when current searching pattern is empty string\. Searching is starting after visible vertical column or on first visible not freezed columns (after some horizontal scrolling) or on first column\. After last column searching starts from first again\.
376
400
.SH "Export & Clipboard"
377
401
For clipboard support the clipboard application should be installed: 1\. wl\-clipboard (Wayland), 2\. xclip (xwindows) or 3\. pbcopy (MacOS)\.
378
402
.P
379
403
\fBpspg\fR try to translate unicode symbol \'∅\' to NULL every time\. If you don\'t use special setting by \fB\epsetnull\|\.\|\.\|\.\fR, then \fBpsql\fR displays empty string instead NULL\.\fBpspg\fR hasn\'t any special detection (in export routines) for this case\. You should to check and enable or disable menu item \fBEmptystringisNULL\fR\.
380
404
.P
381
-
\fBpspg\fR has automatic detection of clipboard application\.Unfortunatelly, this detection should not to work for same cases\. You can specify the application by specify number (1,2,3) to \fB\-\-clipboard\-app\fR option\.
405
+
\fBpspg\fR has automatic detection of clipboard application\.Unfortunately, this detection should not to work for same cases\. You can specify the application by specify number (1,2,3) to \fB\-\-clipboard\-app\fR option\.
@@ -432,6 +456,19 @@ The result of query can be refreshed every n seconds\. \fBpspg\fR remembers curs
432
456
\fBpspg\fR can read a continuous stream of tabular data from pipe, named pipe or from file (with an option \fB\-\-stream\fR or it can read a stream of queries from pipe or from file (with an option \fB\-\-querystream\fR)\. In stream mode, only data in table format can be processed, because \fBpspg\fR uses empty line as separator between tables\.
433
457
.P
434
458
The query stream mode is an sequence of SQL statements separated by char GS (Group separator \- 0x1D on separated line\.
459
+
.IP""4
460
+
.nf
461
+
pavel@localhost ~]$ cat < /dev/pts/3 > ~/pipe
462
+
select 10
463
+
^]
464
+
select 20
465
+
^]
466
+
select *
467
+
from
468
+
pg_class
469
+
^]
470
+
.fi
471
+
.IP""0
435
472
.SH "Recommended psql configuration"
436
473
you should to add to your profile:
437
474
.IP""4
@@ -534,7 +571,7 @@ Note: \fBfooter_mode\fR should be disabled
534
571
.SH "Note \- mouse"
535
572
pspg try to use xterm mouse mode 1002, when terminal and ncurses are not too antique\. If there are problems with usage \- unwanted visual artefacts when you move with mouse when some mouse button is pressed, then 1\. please, report issue (please, attach log file), 2\. use an option \fB\-\-no\-xterm\-mouse\-mode\fR and \fBpspg\fR will not try to activate this mode\.
536
573
.SH "Note \- true color themes on KDE konsole terminal"
537
-
On my Fedora this terminal doesn\'t correctly display true color themes\. The basic problem is in default \fBTERM\fR setting, that is \fBxterm\-256color\fR\. Unfortunately, the \fBkonsole\fR terminal is not fully compatible with \fBxterm\fR, and doesn\'t allow color changing\. You can force direct colors by using the option \fB\-\-direct\-color\fR or by setting \fBTERM=xterm\-direct\fR\. Second option is more corect setting of \fBTERM\fR variable to \fBkonsole\-256color\fR\. In this case the \fBpspg\fR will map the true rgb colors to supported 256 colors\.
574
+
On my Fedora this terminal doesn\'t correctly display true color themes\. The basic problem is in default \fBTERM\fR setting, that is \fBxterm\-256color\fR\. Unfortunately, the \fBkonsole\fR terminal is not fully compatible with \fBxterm\fR, and doesn\'t allow color changing\. You can force direct colors by using the option \fB\-\-direct\-color\fR or by setting \fBTERM=xterm\-direct\fR\. Second option is more correct setting of \fBTERM\fR variable to \fBkonsole\-256color\fR\. In this case the \fBpspg\fR will map the true rgb colors to supported 256 colors\.
If you want to use \fBpspg\fR as Postgres client, then you need run \fBconfigure\-\-with\-postgresql=yes\fR\. On Fedora with own Postgres build I had to install \fBopenssl\-devel\fR package and I had to set \fBexportPKG_CONFIG_PATH="/usr/local/pgsql/master/lib/pkgconfig/"\fR\.
550
587
.P
551
588
On FreeBsd you should to use \fBgmake\fR instead \fBmake\fR\.
552
-
.SH "Note \- Installation"
589
+
.SH "Note \- Installation details"
553
590
When you compile code from source, run \./configure first\. Sometimes \./autogen\.sh first
554
591
.P
555
592
If you would to display UTF\-8 characters, then \fBpspg\fR should be linked with \fBncursesw\fR library\. UTF\-8 characters are displayed badly when library \fBncursesw\fR is used\. You can see broken characters with incorrect locale setting too\.
556
593
.P
557
-
You can check wide chars support by \fBpspg\-\-version\fR\. Row \fBncurseswithwidecharsupport\fR is expected\. Re\-run \fBconfigure\fR with \fB\-\-with\-ncursesw\fR option\. When this command fails check if development package for ncuresesw library is installed\.
558
-
.SH "Homebrew (for Linux & MacOS)"
594
+
You can check wide chars support by \fBpspg\-\-version\fR\. Row \fBncurseswithwidecharsupport\fR is expected\. Re\-run \fBconfigure\fR with \fB\-\-with\-ncursesw\fR option\. When this command fails check if development package for ncursesw library is installed\.
595
+
.SS "Homebrew (for Linux & MacOS)"
559
596
.nf
560
597
# brew install pspg
561
598
.fi
562
-
.SH "Debian"
599
+
.P
600
+
You can compile easily \fBpspg\fR without \fBbrew\fR, but you need \fBgnureadline\fR library\. MacOS uses by default readline emulated over libedit, but \fBpspg\fR requires full gnu readline library\.
there is not any difference from installation and work on Ubuntu (Debian)
660
+
.P
661
+
\fBpspg\fR is not ported to MS Windows yet\. There is the dependency on ncurses and correctly (fully) implemented function \fBnewterm\fR (\fBpdcurses\fR does this only on Unix platforms)\. It can work with WSL2 maybe (I didn\'t test it)\. An alternative can be using \fBless\fR pager, that is ported to some MS Win enviroments\.\fBless\fR depends on \fBtermcap\fR, and it is little bit more portable than \fBpspg\fR (\fBtermcal\fR is low layer of ncurses)\.\fBless\fR supports fixed rows and with \fB\-\-chop\-long\-lines\fR option or just \fB\-S\fR can be used as pager for \fBpspg\fR\.
There are few issues requires manual code changes for successful compilation \- we successfully tested \fBpspg\fR, but although \fBpspg\fR was linked with ncursesw libraries, the utf8 encoding support didn\'t work fully correctly \- probably due some issues in \fBlibc\fR library\. There are problems with chars encoded to 3bytes \- unicode borders, \.\. Two bytes unicode chars should be displayed well\.
606
669
.P
607
-
You can use \fBpspg\fR with usual accented chars, but unicode bordes should not be used\. Replacement ascii borders by special borders chars (by ncurses technology) works well \- looks on \fBOptions|Forceunicodeborders\fR option\.
670
+
You can use \fBpspg\fR with usual accented chars, but unicode borders should not be used\. Replacement ascii borders by special borders chars (by ncurses technology) works well \- looks on \fBOptions|Forceunicodeborders\fR option\.
608
671
.IP"\[ci]"4
609
672
Solaris \fBmake\fR doesn\'t support conditional statements \- should be removed So, remove unsupported functionality from \fBMakefile\fR (\fBifdef\fR,\fBendif\fR), replace \fB\-include\fR by \fBinclude\fR first\.
610
673
.IP"\[ci]"4
611
-
After running \fBconfigure\fR remove link on \fBtermcap\fR library from \fBconfig\.make\fR\. It is garabage produced by \fBreadline\fR automake script\. Combination with \fBncurses\fR libraries makes some linking issues\.
674
+
After running \fBconfigure\fR remove link on \fBtermcap\fR library from \fBconfig\.make\fR\. It is garbage produced by \fBreadline\fR automake script\. Combination with \fBncurses\fR libraries makes some linking issues\.
Store data in some column format (now data are stored like array of rows)\. With this change can be possible to operate over columns \- hide columns, change width, cyclic iteration over columns, change order of columns, mark columns and export only selected columns (selected rows)\.
629
694
.IP"\[ci]"4
630
-
Replace printing document directly to ncurses window by some smarter structure\. Internally there are lot of checks and fixs to support complex dynamic layout\. The possibly views should to remember first row, last row, current row\. Now, these data are in global variables or in DataDesc and ScrDesc structures\.
695
+
Replace printing document directly to ncurses window by some smarter structure\. Internally there are lot of checks and fixes to support complex dynamic layout\. The possibly views should to remember first row, last row, current row\. Now, these data are in global variables or in DataDesc and ScrDesc structures\.
631
696
.IP""0
632
697
.SH "st_menu"
633
698
This project uses st_menu library \- implementation of CUA menubar and pulldown menu for ncurses https://github\.com/okbob/ncurses\-st\-menu
0 commit comments