Skip to content

Instantly share code, notes, and snippets.

@dwilkins
Last active December 20, 2015 12:49
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save dwilkins/6134499 to your computer and use it in GitHub Desktop.
Save dwilkins/6134499 to your computer and use it in GitHub Desktop.
Expanded output for MySQL and Postgres

Without \x

Normal Postgres Output - off the right hand side of the page or wrapped and unreadable

db_development=# select * from users;
 id |        email         |                      encrypted_password                      | reset_password_token | reset_password_sent_at | remember_created_at | sign_in_count |     current_sign_in_at     |      last_sign_in_at       | current_sign_in_ip | last_sign_in_ip |         created_at         |         updated_at         | admin 
----+----------------------+--------------------------------------------------------------+----------------------+------------------------+---------------------+---------------+----------------------------+----------------------------+--------------------+-----------------+----------------------------+----------------------------+-------
  1 | dwilkins@example.com | $2a$10$hHZ4XhiTgXY62slgpsXd3u2Nd0pC3Ejl0IbsNZK1t2r5aPlxyl3QO |                      |                        |                     |             1 | 2013-08-01 16:23:40.594673 | 2013-08-01 16:23:40.594673 | 127.0.0.1          | 127.0.0.1       | 2013-08-01 16:21:59.889625 | 2013-08-01 16:23:40.595853 | t
(1 row)

With \x

Now - use the \x for expanded Display - much easier to read

db_development=# \x
Expanded display is on.
db_development=# select * from users;
-[ RECORD 1 ]----------+-------------------------------------------------------------
id                     | 1
email                  | dwilkins@example.com
encrypted_password     | $2a$10$hHZ4XhiTgXY62slgpsXd3u2Nd0pC3Ejl0IbsNZK1t2r5aPlxyl3QO
reset_password_token   | 
reset_password_sent_at | 
remember_created_at    | 
sign_in_count          | 1
current_sign_in_at     | 2013-08-01 16:23:40.594673
last_sign_in_at        | 2013-08-01 16:23:40.594673
current_sign_in_ip     | 127.0.0.1
last_sign_in_ip        | 127.0.0.1
created_at             | 2013-08-01 16:21:59.889625
updated_at             | 2013-08-01 16:23:40.595853
admin                  | t

db_development=# 
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment