pg.ddx.io  pgsql-general@postgresql.org mailing list archive  
help / color / mirror / Atom feed
From: Rory Campbell-Lange <rory@campbell-lange.net>
To: Matthias Apitz <guru@unixarea.de>
Cc: pgsql-general@lists.postgresql.org
Subject: Re: PostgreSQL reference coffee mug
Date: Thu, 29 Jul 2021 20:12:49 +0100
Message-ID: <20210729191249.GA20309@campbell-lange.net> (raw)
In-Reply-To: <YQLlmOkQ1+bF7id2@c720-r368166>
References: <3498bffa-c58e-118e-c7ca-dd16266af267@aklaver.com>
	<202107281538.ajjn6l4d5gqf@alvherre.pgsql>
	<YQGMoEvJY+nsrVLO@c720-r368166>
	<YQGUMLPXj55x3gTy@c720-r368166>
	<YQLlmOkQ1+bF7id2@c720-r368166>

On 29/07/21, Matthias Apitz (guru@unixarea.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






view thread (22+ messages)  latest in thread

Message-ID: <20210729191249.GA20309@campbell-lange.net>
Permalink:  ../20210729191249.GA20309@campbell-lange.net/
Also on:    postgresql.org/message-id/20210729191249.GA20309@campbell-lange.net

 · 

reply

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Reply to all the recipients using the --to and --cc options:
  reply via email

  To: pgsql-general@postgresql.org
  Cc: rory@campbell-lange.net, guru@unixarea.de, pgsql-general@lists.postgresql.org
  Subject: Re: PostgreSQL reference coffee mug
  In-Reply-To: <20210729191249.GA20309@campbell-lange.net>

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

This inbox is served by DDX for PostgreSQL; see mirroring instructions
for how to clone and mirror all data and code used for this inbox