Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9BSj-00013C-DN for pgsql-general@arkaria.postgresql.org; Thu, 29 Jul 2021 19:12:57 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1m9BSi-0000iP-Bz for pgsql-general@arkaria.postgresql.org; Thu, 29 Jul 2021 19:12:56 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9BSh-0000iH-QA for pgsql-general@lists.postgresql.org; Thu, 29 Jul 2021 19:12:56 +0000 Received: from campbell-lange.net ([178.79.140.51]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9BSe-0003so-J5 for pgsql-general@lists.postgresql.org; Thu, 29 Jul 2021 19:12:54 +0000 DKIM-Signature: v=1; a=rsa-sha256; q=dns/txt; c=relaxed/relaxed; d=campbell-lange.net; s=it; h=In-Reply-To:Content-Transfer-Encoding: Content-Type:MIME-Version:References:Message-ID:Subject:Cc:To:From:Date: Sender:Reply-To:Content-ID:Content-Description:Resent-Date:Resent-From: Resent-Sender:Resent-To:Resent-Cc:Resent-Message-ID:List-Id:List-Help: List-Unsubscribe:List-Subscribe:List-Post:List-Owner:List-Archive; bh=TK5TBsdxY2Lkqkawkl3oWLrngSsVu+H5g5WADYW+QqQ=; b=L2Ye9hse9gzre1dhNiCzHMpAux LIOOLmndtxdhIrcpoacVp+RlPFC4lHs7M4cfFW+SlCimNbMXCiJqP6U2R4pGmLTWOoMI+0tvt4g7a tmAkZ+qqVuDjm6tBrLG5pGOqu4rt5DWNaA9qeC4vTlloSLP41lanjtikVzOlVSIWGKRA=; Received: from 188.31.113.218.threembb.co.uk ([188.31.113.218] helo=rory-t470s) by campbell-lange.net with esmtpsa (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1m9BSc-0001Bm-C3; Thu, 29 Jul 2021 19:12:50 +0000 Received: from rory by rory-t470s with local (Exim 4.92) (envelope-from ) id 1m9BSb-0005YU-IV; Thu, 29 Jul 2021 20:12:49 +0100 Date: Thu, 29 Jul 2021 20:12:49 +0100 From: Rory Campbell-Lange To: Matthias Apitz Cc: pgsql-general@lists.postgresql.org Subject: Re: PostgreSQL reference coffee mug Message-ID: <20210729191249.GA20309@campbell-lange.net> References: <3498bffa-c58e-118e-c7ca-dd16266af267@aklaver.com> <202107281538.ajjn6l4d5gqf@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: User-Agent: Mutt/1.10.1 (2018-07-13) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk 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 != '' AND query NOT ILIKE '%pg_stat_activity%' ORDER BY query_start desc; # https://gist.github.com/rgreenjr/3637525 Rory