psql output in Debian is messed up

The name of the pictureThe name of the pictureThe name of the pictureClash Royale CLAN TAG#URR8PPP











up vote
2
down vote

favorite












Width of the terminal window is 280 columns, and Debian prints text just fine.



However, psql output is totally messed up. When I type a command, it's not wrapped: if I exceed 80 symbols in a line, the rest is printed from the beginning of the line overlapping the first part (i. e. caret is returned).enter image description here Same goes for printing query results: it tries to fits everything into 80 symbols per line, but at least doesn't overlap the text.



I've tried this command: pset columns 280, but it didn't help.



echo "$PS1" yields $debian_chroot:+($debian_chroot)u@h:w$










share|improve this question























  • A strong suspect here is your prompt string contains non-printing characters that confuse the shell's understanding of the current cursor; can you provide the output of echo "$PS1"?
    – Jeff Schaller
    4 hours ago










  • @JeffSchaller Added this info. Also, I've messed up a bit: it's not Ubuntu, it's Debian.
    – efpies
    4 hours ago














up vote
2
down vote

favorite












Width of the terminal window is 280 columns, and Debian prints text just fine.



However, psql output is totally messed up. When I type a command, it's not wrapped: if I exceed 80 symbols in a line, the rest is printed from the beginning of the line overlapping the first part (i. e. caret is returned).enter image description here Same goes for printing query results: it tries to fits everything into 80 symbols per line, but at least doesn't overlap the text.



I've tried this command: pset columns 280, but it didn't help.



echo "$PS1" yields $debian_chroot:+($debian_chroot)u@h:w$










share|improve this question























  • A strong suspect here is your prompt string contains non-printing characters that confuse the shell's understanding of the current cursor; can you provide the output of echo "$PS1"?
    – Jeff Schaller
    4 hours ago










  • @JeffSchaller Added this info. Also, I've messed up a bit: it's not Ubuntu, it's Debian.
    – efpies
    4 hours ago












up vote
2
down vote

favorite









up vote
2
down vote

favorite











Width of the terminal window is 280 columns, and Debian prints text just fine.



However, psql output is totally messed up. When I type a command, it's not wrapped: if I exceed 80 symbols in a line, the rest is printed from the beginning of the line overlapping the first part (i. e. caret is returned).enter image description here Same goes for printing query results: it tries to fits everything into 80 symbols per line, but at least doesn't overlap the text.



I've tried this command: pset columns 280, but it didn't help.



echo "$PS1" yields $debian_chroot:+($debian_chroot)u@h:w$










share|improve this question















Width of the terminal window is 280 columns, and Debian prints text just fine.



However, psql output is totally messed up. When I type a command, it's not wrapped: if I exceed 80 symbols in a line, the rest is printed from the beginning of the line overlapping the first part (i. e. caret is returned).enter image description here Same goes for printing query results: it tries to fits everything into 80 symbols per line, but at least doesn't overlap the text.



I've tried this command: pset columns 280, but it didn't help.



echo "$PS1" yields $debian_chroot:+($debian_chroot)u@h:w$







debian terminal






share|improve this question















share|improve this question













share|improve this question




share|improve this question








edited 4 hours ago

























asked 4 hours ago









efpies

1185




1185











  • A strong suspect here is your prompt string contains non-printing characters that confuse the shell's understanding of the current cursor; can you provide the output of echo "$PS1"?
    – Jeff Schaller
    4 hours ago










  • @JeffSchaller Added this info. Also, I've messed up a bit: it's not Ubuntu, it's Debian.
    – efpies
    4 hours ago
















  • A strong suspect here is your prompt string contains non-printing characters that confuse the shell's understanding of the current cursor; can you provide the output of echo "$PS1"?
    – Jeff Schaller
    4 hours ago










  • @JeffSchaller Added this info. Also, I've messed up a bit: it's not Ubuntu, it's Debian.
    – efpies
    4 hours ago















A strong suspect here is your prompt string contains non-printing characters that confuse the shell's understanding of the current cursor; can you provide the output of echo "$PS1"?
– Jeff Schaller
4 hours ago




A strong suspect here is your prompt string contains non-printing characters that confuse the shell's understanding of the current cursor; can you provide the output of echo "$PS1"?
– Jeff Schaller
4 hours ago












@JeffSchaller Added this info. Also, I've messed up a bit: it's not Ubuntu, it's Debian.
– efpies
4 hours ago




@JeffSchaller Added this info. Also, I've messed up a bit: it's not Ubuntu, it's Debian.
– efpies
4 hours ago










1 Answer
1






active

oldest

votes

















up vote
3
down vote



accepted










The solution is to completely reset a PSQL installation, so it is in the same state as when It was installed. Debian splits the database configuration from the database files, opposed to generic PSQL installation that puts everything under same directory. Debian allows multiple clusters and even different versions of PSQL to coexist in same host.



Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]


Debian PSQL installation automatically calls the initdb i.e. it initializes the cluster with default encoding and locale. Encoding can be changed later but the locale cannot. To change the locale (possibly other options in initdb), delete the existing default cluster and create a new one:



-Take root privileges.



-Run the following command:



pg_dropcluster --stop <version> main

For example:
pg_dropcluster --stop 8.3 main


-Run the initdb with your options. For example:



pg_createcluster --locale de_DE.UTF-8 --start 8.3 main





share|improve this answer


















  • 1




    Thanks. That helped. I've only had C.UTF-8 locale (it's a VM, not a machine for work), but it was enough.
    – efpies
    3 hours ago










Your Answer







StackExchange.ready(function()
var channelOptions =
tags: "".split(" "),
id: "106"
;
initTagRenderer("".split(" "), "".split(" "), channelOptions);

StackExchange.using("externalEditor", function()
// Have to fire editor after snippets, if snippets enabled
if (StackExchange.settings.snippets.snippetsEnabled)
StackExchange.using("snippets", function()
createEditor();
);

else
createEditor();

);

function createEditor()
StackExchange.prepareEditor(
heartbeatType: 'answer',
convertImagesToLinks: false,
noModals: false,
showLowRepImageUploadWarning: true,
reputationToPostImages: null,
bindNavPrevention: true,
postfix: "",
onDemand: true,
discardSelector: ".discard-answer"
,immediatelyShowMarkdownHelp:true
);



);













 

draft saved


draft discarded


















StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470935%2fpsql-output-in-debian-is-messed-up%23new-answer', 'question_page');

);

Post as a guest






























1 Answer
1






active

oldest

votes








1 Answer
1






active

oldest

votes









active

oldest

votes






active

oldest

votes








up vote
3
down vote



accepted










The solution is to completely reset a PSQL installation, so it is in the same state as when It was installed. Debian splits the database configuration from the database files, opposed to generic PSQL installation that puts everything under same directory. Debian allows multiple clusters and even different versions of PSQL to coexist in same host.



Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]


Debian PSQL installation automatically calls the initdb i.e. it initializes the cluster with default encoding and locale. Encoding can be changed later but the locale cannot. To change the locale (possibly other options in initdb), delete the existing default cluster and create a new one:



-Take root privileges.



-Run the following command:



pg_dropcluster --stop <version> main

For example:
pg_dropcluster --stop 8.3 main


-Run the initdb with your options. For example:



pg_createcluster --locale de_DE.UTF-8 --start 8.3 main





share|improve this answer


















  • 1




    Thanks. That helped. I've only had C.UTF-8 locale (it's a VM, not a machine for work), but it was enough.
    – efpies
    3 hours ago














up vote
3
down vote



accepted










The solution is to completely reset a PSQL installation, so it is in the same state as when It was installed. Debian splits the database configuration from the database files, opposed to generic PSQL installation that puts everything under same directory. Debian allows multiple clusters and even different versions of PSQL to coexist in same host.



Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]


Debian PSQL installation automatically calls the initdb i.e. it initializes the cluster with default encoding and locale. Encoding can be changed later but the locale cannot. To change the locale (possibly other options in initdb), delete the existing default cluster and create a new one:



-Take root privileges.



-Run the following command:



pg_dropcluster --stop <version> main

For example:
pg_dropcluster --stop 8.3 main


-Run the initdb with your options. For example:



pg_createcluster --locale de_DE.UTF-8 --start 8.3 main





share|improve this answer


















  • 1




    Thanks. That helped. I've only had C.UTF-8 locale (it's a VM, not a machine for work), but it was enough.
    – efpies
    3 hours ago












up vote
3
down vote



accepted







up vote
3
down vote



accepted






The solution is to completely reset a PSQL installation, so it is in the same state as when It was installed. Debian splits the database configuration from the database files, opposed to generic PSQL installation that puts everything under same directory. Debian allows multiple clusters and even different versions of PSQL to coexist in same host.



Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]


Debian PSQL installation automatically calls the initdb i.e. it initializes the cluster with default encoding and locale. Encoding can be changed later but the locale cannot. To change the locale (possibly other options in initdb), delete the existing default cluster and create a new one:



-Take root privileges.



-Run the following command:



pg_dropcluster --stop <version> main

For example:
pg_dropcluster --stop 8.3 main


-Run the initdb with your options. For example:



pg_createcluster --locale de_DE.UTF-8 --start 8.3 main





share|improve this answer














The solution is to completely reset a PSQL installation, so it is in the same state as when It was installed. Debian splits the database configuration from the database files, opposed to generic PSQL installation that puts everything under same directory. Debian allows multiple clusters and even different versions of PSQL to coexist in same host.



Configuration files: /etc/postgresql/[version]/[cluster]/
Binaries: /usr/lib/postgresql/[version]
Data files: /var/lib/postgresql/[version]/[cluster]


Debian PSQL installation automatically calls the initdb i.e. it initializes the cluster with default encoding and locale. Encoding can be changed later but the locale cannot. To change the locale (possibly other options in initdb), delete the existing default cluster and create a new one:



-Take root privileges.



-Run the following command:



pg_dropcluster --stop <version> main

For example:
pg_dropcluster --stop 8.3 main


-Run the initdb with your options. For example:



pg_createcluster --locale de_DE.UTF-8 --start 8.3 main






share|improve this answer














share|improve this answer



share|improve this answer








edited 3 hours ago

























answered 4 hours ago









Goro

4,07752254




4,07752254







  • 1




    Thanks. That helped. I've only had C.UTF-8 locale (it's a VM, not a machine for work), but it was enough.
    – efpies
    3 hours ago












  • 1




    Thanks. That helped. I've only had C.UTF-8 locale (it's a VM, not a machine for work), but it was enough.
    – efpies
    3 hours ago







1




1




Thanks. That helped. I've only had C.UTF-8 locale (it's a VM, not a machine for work), but it was enough.
– efpies
3 hours ago




Thanks. That helped. I've only had C.UTF-8 locale (it's a VM, not a machine for work), but it was enough.
– efpies
3 hours ago

















 

draft saved


draft discarded















































 


draft saved


draft discarded














StackExchange.ready(
function ()
StackExchange.openid.initPostLogin('.new-post-login', 'https%3a%2f%2funix.stackexchange.com%2fquestions%2f470935%2fpsql-output-in-debian-is-messed-up%23new-answer', 'question_page');

);

Post as a guest













































































Comments

Popular posts from this blog

Long meetings (6-7 hours a day): Being “babysat” by supervisor

What does second last employer means? [closed]

One-line joke