M
M
mi1ord2018-07-20 16:15:15
PostgreSQL
mi1ord, 2018-07-20 16:15:15

How to fix crooked column display in Postrgresql?

Started reading Ben Fort's SQL book. The book provides data for filling the database.
And for several tables, for example, for such

CREATE TABLE Vendors
(
  vend_id      char(10) NOT NULL ,
  vend_name    char(50) NOT NULL ,
  vend_address char(50) NULL ,
  vend_city    char(50) NULL ,
  vend_state   char(5)  NULL ,
  vend_zip     char(10) NULL ,
  vend_country char(50) NULL 
);

after creation and filling with data, an extremely crooked display is obtained:
5b51df4b07800173764693.jpeg
Is it possible to fix this somehow?
(system - Ubuntu)

Answer the question

In order to leave comments, you need to log in

1 answer(s)
M
Melkij, 2018-07-20
@mi1ord

You just have a narrow terminal for your selection.
Wide results are often more convenient to read in wide form, which is toggled using the \x command in psql:

melkij=> select generate_series(1,3);
 generate_series 
-----------------
               1
               2
               3
(3 строки)

melkij=> \x
Расширенный вывод включён.
melkij=> select generate_series(1,3);
-[ RECORD 1 ]---+--
generate_series | 1
-[ RECORD 2 ]---+--
generate_series | 2
-[ RECORD 3 ]---+--
generate_series | 3

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question