Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWAjQ-0003em-EU for pgsql-general@arkaria.postgresql.org; Mon, 10 Dec 2018 01:51:36 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1gWAjP-0006CI-5O for pgsql-general@arkaria.postgresql.org; Mon, 10 Dec 2018 01:51:35 +0000 Received: from makus.postgresql.org ([2001:4800:3e1:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWAjO-0006CA-Lh for pgsql-general@lists.postgresql.org; Mon, 10 Dec 2018 01:51:34 +0000 Received: from mail-pl1-x644.google.com ([2607:f8b0:4864:20::644]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1gWAjL-0003TH-NW for pgsql-general@lists.postgresql.org; Mon, 10 Dec 2018 01:51:33 +0000 Received: by mail-pl1-x644.google.com with SMTP id gn14so4439376plb.10 for ; Sun, 09 Dec 2018 17:51:31 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:references:from:message-id:date:user-agent:mime-version :in-reply-to:content-language:content-transfer-encoding; bh=Y7rD2giAOLg/A3IThg+my/JXN9isbvbn/WjUOWItRQs=; b=Pw9kAmxty0pevnuVnl65yahdcac8gB6X32NFfjSubYa1D0XgX7S3ojZY2fNg269agD tbtefbrIl4mQRrCVBUDxhyUFJgj2CXzhKJCprXZuGK3Awo8+aQ4oQUnwka+rPLj6yJcL hz9fVAl/kutmU3q2USWCUrg6euZ9KsQF4lcX8dUzyqjBW1PuDoQDIG8BBpzbTkWohdU8 aFxOOli3FuWPhNsi5L3PgGrAxOUbTQVtk2TvecaEr/NXoqcCFEg3FCWunutRKTICCQ0D RkQ3abgX67E5eR6T4UK7qd/FOnJeWat/NTxDKbYXbRR9/EjrawxaGE6xZtDVkIsB/GYh lT9w== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=Y7rD2giAOLg/A3IThg+my/JXN9isbvbn/WjUOWItRQs=; b=YQSS/n+A3xr8DLgOfMMCGzYo8/zbLmxuKOF/MLqF5xPHZP8f+aIsiVSnpBzT54fugV rki+cZ/hDHXSEy23xVbVl7wdOJh1ryNh4EQwGlCxXwvOWDNF+9+3QP10pKpEsFmdmifz g3mLG3W4TkK6kBLlYRt+YmDK4io+egeuzBzZvEYQFGDDGd3mUqOyXBwrjDZdJ0G1syYl Q9mF8hbmzoYHDyBRQEN4fmWjRAFbtplmDLibqrjeMB6a3Ch1FcKZdTvQKVcJn0qDCKf4 ZHwePj+vTH+QWLOlm5NfSFIrtVOw7DYFnkhKyqmXVw5ggpxfx4YHjC7JJyYujekNuGKg cUwg== X-Gm-Message-State: AA+aEWaG3Stkqd18+HkUMAivLn+avECdap5Z9jMOpfYlUa4tYYgJmmtX 6sVT74wxdm0JNzIgZ7MggMLAX6SK6aZD+LgIAqrZu1iqmobwoKn7H6XcPJQTKwyVmXaRM2n+UjK AYTkgLb/fTan1KTT4hFveJMam9Sy1WZgdic6JhUwtE1SOVL1vMNKZ43ghByEN+xqRCAbRAO/sQ/ S6emtXRxt9LekmbonFpYYM X-Google-Smtp-Source: AFSGD/XKE5pE2qUuBUJfY8DxMlTFzug7/ngSLQoYRVu7shkuYmrtVlZXAw9J2k9twzVB2Je6sh7DJw== X-Received: by 2002:a17:902:4222:: with SMTP id g31mr10314819pld.240.1544406689636; Sun, 09 Dec 2018 17:51:29 -0800 (PST) Received: from osaka.octopusnet (p4645173-ipngn26201marunouchi.tokyo.ocn.ne.jp. [122.29.161.173]) by smtp.gmail.com with ESMTPSA id j70sm13043543pfc.43.2018.12.09.17.51.27 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Sun, 09 Dec 2018 17:51:28 -0800 (PST) Subject: Re: Tables(s) that feed pg_controldata To: Ron , pgsql-general@lists.postgresql.org References: <62c43250-70ad-479b-d3ef-9860114eba43@gmail.com> From: Ian Barwick Message-ID: Date: Mon, 10 Dec 2018 10:51:26 +0900 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:52.0) Gecko/20100101 Thunderbird/52.9.1 MIME-Version: 1.0 In-Reply-To: <62c43250-70ad-479b-d3ef-9860114eba43@gmail.com> Content-Type: text/plain; charset=utf-8; format=flowed Content-Language: en-US Content-Transfer-Encoding: 7bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 12/09/2018 01:25 AM, Ron wrote: > > In v9.2 (yes, I know it's EOL; there's nothing I can do about it), what tables > do I query to get these values, and can I also get them from the streamed > replication host? > > - Database cluster state > - Latest checkpoint location > - Time of latest checkpoint The pg_control file is written directly by PostgreSQL, it does not derive from any tables. From 9.6 there are a bunch of functions which will report values contained in pg_controldata: https://www.postgresql.org/docs/current/functions-info.html#FUNCTIONS-CONTROLDATA but you're out of luck for 9.2. The only option to query the desired values via SQL would be to write an extension which reads pg_controldata (possibly as a backport of the above-mentioned functions). Regards Ian Barwick -- Ian Barwick http://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Training & Services