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 1jquKK-0007Zk-Va for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2020 08:12:12 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.92) (envelope-from ) id 1jquKJ-0008HR-Pc for pgsql-hackers@arkaria.postgresql.org; Thu, 02 Jul 2020 08:12:11 +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 1jquKJ-0008HK-Ik for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2020 08:12:11 +0000 Received: from mail-ed1-x52f.google.com ([2a00:1450:4864:20::52f]) by makus.postgresql.org with esmtps (TLS1.3:ECDHE_RSA_AES_128_GCM_SHA256:128) (Exim 4.92) (envelope-from ) id 1jquKD-0003xw-Bx for pgsql-hackers@lists.postgresql.org; Thu, 02 Jul 2020 08:12:10 +0000 Received: by mail-ed1-x52f.google.com with SMTP id dm19so16398707edb.13 for ; Thu, 02 Jul 2020 01:12:05 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=subject:to:cc:references:from:message-id:date:user-agent :mime-version:in-reply-to:content-language:content-transfer-encoding; bh=ytS7cquUXcw+LfGl1ciprkWKejjDBTJy/JolaHW80qI=; b=WgUEShOR/TOifawXQskKLI9N5v+ZButRgMNoEmMULhlkd/Jrb6o2atnL5SNe9HpZqU vWB0GF3f+TFGkh2JMqKd1mxdVkpB9sEl0rsH7MN1+lLoZPWeVOZ2iiGTLNaGiIfKQpwg z2GDnUtIbCR3GfwhKmiFM25zV40selAp/gzHgUBya4sFNK0gNkFry4srz8iW6VTGp4+V g4dngp82hP/Byj4VoHwEA0kKaIH9MY7Eu/FrUjMJbZpyUhYDrUNg+dPqBwY8rMuf2WkJ 2ZlCRP6KlhbebsyL84eQULU0muCNAi2FDqiTAKejd6vDb4KrzzpiRJysFSf6KANv5aSC MbrQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:subject:to:cc:references:from:message-id:date :user-agent:mime-version:in-reply-to:content-language :content-transfer-encoding; bh=ytS7cquUXcw+LfGl1ciprkWKejjDBTJy/JolaHW80qI=; b=pzkanmnJu29gwHfoJJIJVaPlAzU1vSv4bYl+A3aX3OWCHbHhGdvUO+SQlZu/IdU4fp wytM/81CG63L+dIH16oZt0dNiq2EyN2izmOVJIsR6iotjEu61+KRtUg3WMAiReCbv1T3 2phBBrynygDnQZ9capfKBRTld2i4PmQXVo6rM80WW63KYGh7S42XNwBUkiC80/8WBs9X m1qo2KT/dxht5lsRtqVBJrxjJUy/7bbokl0nMSs5i8qFM/NI6dDlSX94IsZIokFoT2eS LQdv/8aBzICJujrpYPLPwYxE2ftO2njcENNp8K0BRatuGqtW0H5R/nu6RsQ9Z4MiD2i1 EAvA== X-Gm-Message-State: AOAM532gotGDFaikEiCmRuk+OuDWcBt00w20kphf0YMKH8inv4QC6tr3 o0AWy2V/9BabUToQG/yEtAEagA== X-Google-Smtp-Source: ABdhPJxHPY7iKppFIqMfQaw9NHy4la+vrO8fmTnJslFVXuEQlPdjWkeWUGTnpWVoheNiVrMKpk7KIA== X-Received: by 2002:aa7:ca05:: with SMTP id y5mr6225992eds.204.1593677523965; Thu, 02 Jul 2020 01:12:03 -0700 (PDT) Received: from ?IPv6:2a02:8308:13b:9400:c4bc:d2a3:915a:f059? ([2a02:8308:13b:9400:c4bc:d2a3:915a:f059]) by smtp.gmail.com with ESMTPSA id j89sm8933975edb.20.2020.07.02.01.12.02 (version=TLS1_3 cipher=TLS_AES_128_GCM_SHA256 bits=128/128); Thu, 02 Jul 2020 01:12:03 -0700 (PDT) Subject: Re: A patch for get origin from commit_ts. To: michael@paquier.xyz, Simon Riggs Cc: Madan Kumar , "movead.li@highgo.ca" , pgsql-hackers , Craig Ringer , =?UTF-8?Q?=c3=81lvaro_Herrera?= , Andres Freund , soumyadeep2007@gmail.com References: <2020051116430836450630@highgo.ca> <20200512014537.GF88791@paquier.xyz> <2020051316291300911447@highgo.ca> <20200702015852.GE10408@paquier.xyz> From: Petr Jelinek Message-ID: <4ee522fa-b549-4a8d-9d9e-cb27be774627@2ndquadrant.com> Date: Thu, 2 Jul 2020 10:12:02 +0200 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:68.0) Gecko/20100101 Thunderbird/68.8.0 MIME-Version: 1.0 In-Reply-To: <20200702015852.GE10408@paquier.xyz> Content-Type: text/plain; charset=windows-1252; format=flowed Content-Language: en-US Content-Transfer-Encoding: 8bit List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 02/07/2020 03:58, michael@paquier.xyz wrote: > On Tue, Jun 30, 2020 at 01:58:17PM +0100, Simon Riggs wrote: >> On Tue, 30 Jun 2020 at 02:17, Madan Kumar wrote: >>> It may be better to have one single function returning both >>> timestamp and origin for a given transaction ID. >> >> No need to change existing APIs. > > Adding a new function able to return both fields at the same time does > not imply that we'd remove the original one, it just implies that we > would be able to retrieve both fields with a single call of > TransactionIdGetCommitTsData(), saving from an extra CommitTsSLRULock > taken, etc. That's actually what pglogical does with > its pglogical_xact_commit_timestamp_origin() in > pglogical_functions.c. So adding one function able to return one > tuple with the two fields, without removing the existing > pg_xact_commit_timestamp() makes the most sense, no? Agreed, sounds reasonable. I also (I suspect like Álvaro) parsed your original message as wanting to remove origin from the record completely. -- Petr Jelinek 2ndQuadrant - PostgreSQL Solutions for the Enterprise https://www.2ndQuadrant.com/