# How I work with Postgres - psql, My PostgreSQL Admin

DevFeed: [How I work with Postgres - psql, My PostgreSQL Admin](<https://devfeed.tech/articles/how-i-work-with-postgres-psql-my-postgresql-admin-41126.md>)

Original publisher: [Read original article](<https://www.craigkerstiens.com/2013/02/13/How-I-Work-With-Postgres/>)

Author: Map

Published: 2013-02-13T20:55:56Z

Content type: tutorial

Language: en

Sources: [Craig Kerstiens](<https://devfeed.tech/sources/craig-kerstiens.md>)

Topics: [PostgreSQL](<https://devfeed.tech/topics/postgresql.md>), [Databases](<https://devfeed.tech/topics/databases.md>), [SQL](<https://devfeed.tech/topics/sql.md>)

Tags: [database](<https://devfeed.tech/tags/database.md>), [editor](<https://devfeed.tech/tags/editor.md>), [postgres](<https://devfeed.tech/tags/postgres.md>), [postgresql](<https://devfeed.tech/tags/postgresql.md>), [psql](<https://devfeed.tech/tags/psql.md>), [sql](<https://devfeed.tech/tags/sql.md>)

## AI overview

A practical guide to using PostgreSQL's psql as a database interface. It covers setting an editor, using \e, enabling \x auto, keeping unlimited history, and exploring database objects with \d.

## Source excerpt

On at least a weekly basis and not uncommonly multiple times in a single week I get this question: @neilmiddleton I've been hunting for a nice PG interface that works within other things. PGAdmin kinda works, except the SQL editor is a piece of shit Sometimes it leans more to, what is the Sequel Pro equivilant for Postgres. My default answer is I just use psql, though I do have to then go on to explain how I use it. For those just interested you can read more below or just get the highlights here: Set your default EDITOR then use \e On postgres 9.2 and up \x auto is your friend Set history to unlimited \d all the things Before going into detail on why psql works perfectly fine as an interface I want to rant for a minute about what the problems with current editors are and where I expect them to go in the future. First this is not a knock on the work thats been done on previous ones, for their time PgAdmin, phpPgAdmin, and others were valuable tools, but we're coming to a point where theres a broader set of users of databases than ever before and empowering them is becoming ever more important. Empowering developers, DBA's, product people, marketers and others to be comfortable with their database will lead to more people taking advantage of whats in their data. pg_stat_statements was a great start to this laying a great foundation for valuable information being captured. Even with all of the powerful stats being captured in the statistics of PostgreSQL so many are still terrified when they see something like: QUERY PLAN ---------------------------------------------------------------------------------------------------------------- Hash Join (cost=4.25..8.62 rows=100 width=107) (actual time=0.126..0.230 rows=100 loops=1) Hash Cond: (purchases.user_id = users.id) -> Seq Scan on purchases (cost=0.00..3.00 rows=100 width=84) (actual time=0.012..0.035 rows=100 loops=1) -> Hash (cost=3.00..3.00 rows=100 width=27) (actual time=0.097..0.097 rows=100 loops=1) Buckets: 1024 B