Re: PostgreSQL reference coffee mug

From: Rory Campbell-Lange <rory(at)campbell-lange(dot)net>
To: Matthias Apitz <guru(at)unixarea(dot)de>
Cc: pgsql-general(at)lists(dot)postgresql(dot)org
Subject: Re: PostgreSQL reference coffee mug
Date: 2021-07-29 19:12:49
Message-ID: 20210729191249.GA20309@campbell-lange.net
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgsql-general

On 29/07/21, Matthias Apitz (guru(at)unixarea(dot)de) wrote:
> El día miércoles, julio 28, 2021 a las 07:30:24p. m. +0200, Matthias Apitz escribió:

> Resulted, that the size can be 20.12cm X 7.5cm. Attached is an updated
> version as PDF. Hints/bugs are welcome.

I personally find that, after \l (list databases), connecting to a different
one with \c is pretty useful.

\? : to list help subjects
\? options
\? variables
\h

\watch [SEC] : is helpful, for example for keeping an eye on connections via pg_stat_activity

\e | \ef | \ev : is incredibly helpful if you are working on a query, function or view which you immediately want to load into the database via the query buffer (setting the EDITOR env will help). Best done in production, of course.

\set ON_ERROR_STOP on : to abort on first error

\timing on : very helpful to see how fast or slowly your function or query runs

Perhaps some example pg_stat_activity calls might be worth list, eg:

SELECT pid, age(clock_timestamp(), query_start), usename, query
FROM pg_stat_activity
WHERE query != '<IDLE>' AND query NOT ILIKE '%pg_stat_activity%'
ORDER BY query_start desc;
# https://gist.github.com/rgreenjr/3637525

Rory

In response to

Responses

Browse pgsql-general by date

  From Date Subject
Next Message Bhavesh Mistry 2021-07-29 19:44:30 Re: Issue with PSQL JDBC Driver Null Pointer
Previous Message Matthias Apitz 2021-07-29 17:30:00 Re: PostgreSQL reference coffee mug