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 1lywi9-0008PX-Gj for pgsql-general@arkaria.postgresql.org; Thu, 01 Jul 2021 13:26:33 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1lywi8-000121-62 for pgsql-general@arkaria.postgresql.org; Thu, 01 Jul 2021 13:26:32 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_256_GCM_SHA384:256) (Exim 4.92) (envelope-from ) id 1lywi7-00011t-Rn for pgsql-general@lists.postgresql.org; Thu, 01 Jul 2021 13:26:31 +0000 Received: from mail-ot1-x332.google.com ([2607:f8b0:4864:20::332]) by magus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1lywi5-0007wV-PO for pgsql-general@lists.postgresql.org; Thu, 01 Jul 2021 13:26:31 +0000 Received: by mail-ot1-x332.google.com with SMTP id 110-20020a9d0a770000b0290466fa79d098so6486400otg.9 for ; Thu, 01 Jul 2021 06:26:29 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=to:from:subject:message-id:date:user-agent:mime-version :content-transfer-encoding:content-language; bh=xCkS8D+rfxjfJ8mutz5GIjwI9/Id5ocsWocaaXGLbtM=; b=ty+NnUS6/P7GeyOfy+lFsuoWh+6KbitlEWtU2KiGYoPvO9fRYUPPov0wEFKoCAsKnl uScMYzd15ivEShEKCQ+Wl08dvl9Y5nhkR/yTkMlzolR7kdSoa4zb4YFUvLV2FHmnzGtg 0DopbIsHc8JaEWV5+skMK33382X7HLO01L12DlKoAyANBdjzqxTHXGKIToCkF0C64peR x0pMmP8OwuP7j7BNNS14Ps6C7WuQ1v+jop08lx4zGe/HU+EpXnJywp8LzwzrEgt71l6m S0WqCIE15h7ei8P/I8/0+PvjHVOeVWUOPErkmJmMSUJRZI8nOohPdtYSfyVZSNloNOAF URCg== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:to:from:subject:message-id:date:user-agent :mime-version:content-transfer-encoding:content-language; bh=xCkS8D+rfxjfJ8mutz5GIjwI9/Id5ocsWocaaXGLbtM=; b=iGR5EIfzqUa8SNvaOI/MosEWbnpMAwpVyrgogl+VHUwuoIAG0loQdkxJeeEkRyvjId UQiOb0UmKsEnWmk4idKmKLsNJXRNVHL783moJAVr7/7K8QkmoB5or8NYqhTQzzWB9wnC 8H+0WUuzGqEqqTJRbecTDk+UaVRaaiZtiqCDZBzjTgYcaayiwR41uacSr3QqTc8PTr3w kT6qwSq+TK0SaLV6AWNaXR+JVYxAUq7jfW9Pri18BMN+22Mrmx0YlzZaWBBaEoc/v64e mrN65bgE7OdMjtIFjC9xLLTOV2HlgA0If6Dx3x3fvV6jMpEbwvWhCmKQIlVOiNhILtVh jmrg== X-Gm-Message-State: AOAM5321hytQwV2FYovK2aFoPJuYFhP3VjEhpNqlzCeZsTjcQ4vt+Bta ELtXec05QnOaav9LHq3Ldref3tJzh5pNyA== X-Google-Smtp-Source: ABdhPJxdJKNy8qGiAO0Hlo2KJJis332uM354oUYnpTmdS1WAbyLrvHa/HcTqpvcbOxxOwyLR3CB3Tg== X-Received: by 2002:a9d:a6c:: with SMTP id 99mr3819921otg.21.1625145987618; Thu, 01 Jul 2021 06:26:27 -0700 (PDT) Received: from [192.168.88.10] (ip174-67-141-204.no.no.cox.net. [174.67.141.204]) by smtp.googlemail.com with ESMTPSA id q203sm3646073oig.1.2021.07.01.06.26.26 for (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 01 Jul 2021 06:26:27 -0700 (PDT) To: pgsql-general@lists.postgresql.org From: Ron Subject: Greatest of a list of columns? Message-ID: <76af441a-c989-55d7-5e42-ed029ae256c8@gmail.com> Date: Thu, 1 Jul 2021 08:26:25 -0500 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.10.0 MIME-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Content-Language: en-US List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Archived-At: Precedence: bulk Postgresql 12.5 What's the canonical Postgresql method for doing, for example, this? SELECT relname, MAXOF(last_vacuum, last_autovacuum) FROM pg_stat_user_tables; Seeing both last_vacuum and last_autovacuum is useful, of course, but sometimes I only want to see the "really" last time it was vacuumed. I can hard code a case statement, but a generic multi-column solution is preferred. Thanks -- Angular momentum makes the world go 'round.