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 1iDsVh-00079R-Ly for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 15:50:21 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.89) (envelope-from ) id 1iDsVg-00057h-Eo for pgsql-hackers@arkaria.postgresql.org; Fri, 27 Sep 2019 15:50:20 +0000 Received: from magus.postgresql.org ([2a02:c0:301:0:ffff::29]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDsVg-00057Z-1U for pgsql-hackers@lists.postgresql.org; Fri, 27 Sep 2019 15:50:20 +0000 Received: from mail-qt1-x844.google.com ([2607:f8b0:4864:20::844]) by magus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1iDsVc-0004Zv-VO for pgsql-hackers@postgresql.org; Fri, 27 Sep 2019 15:50:19 +0000 Received: by mail-qt1-x844.google.com with SMTP id l3so7869901qtr.4 for ; Fri, 27 Sep 2019 08:50:16 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=2ndquadrant-com.20150623.gappssmtp.com; s=20150623; h=date:from:to:cc:subject:message-id:mime-version:content-disposition :content-transfer-encoding:in-reply-to:user-agent; bh=77a0l4k98cGF5y8H/qMcsO5W9cPqGAtbcceoDh2lL2Y=; b=w3eCeWZFiRWnvI0DAp8yNkPjWTGm0/RnGLUw+PgRjHkZH1AuAZkI9Ga1SBT0CWmqDH bmgae3OetxpkZl52B5SjgFe4PpMf1S6v8NkJPGN47CGjE0l8CXgq8tkirRrymSEaxkRp gWuwrxzFyn4M6/fiyqTC0Wd/u95xS+mmPkfb/SlI1F60V0T5JfK29oMXyiPsuauUMX9X YcL6ZtAMTt4XL4oVuRoFZDyhAM3dJCuelUfzgKvvqmA/Tm1sa2Go2xeDqnsuXRtfE6pd 8Vq3L7Qf2lk/W0VmnIImRbKiht/Iti4qv2Y45tXS31J+iFPPox/4njao+dNwsE/hyfPQ rksA== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:date:from:to:cc:subject:message-id:mime-version :content-disposition:content-transfer-encoding:in-reply-to :user-agent; bh=77a0l4k98cGF5y8H/qMcsO5W9cPqGAtbcceoDh2lL2Y=; b=o+1rYK/aLoniGZUoOT27C+wwYo+ilnDWyDVdMvpy3RhufMM87f+e/CQLsN9uT7eqv9 69TnUyqRnM6fcQ6EIY8YWbD1pi7DiaMUlv3jgkHuDBiwOVLFHra04f69MyXOJeN7atjf v9ROIBAkjMTKwfDO8E8WwjWgSMqMQooCrz0x7NLl3OtsthRksnuwHYbO7OV0f6pbtUV6 149W/C6I8o4+STQVv0wyp+6152i4fLKhQT8RoX3ZBIi1bUUHb9XXz+eeD3p45xHJ7mwD ymtXo9ZzOG7YUvHemooI9duzvFbDl+Yk1C+XU/YJjuW8MsgupXOmum+wKyHsaAI7jU6T KKNQ== X-Gm-Message-State: APjAAAVP6gzkTHaZZxFeethBoTAwQLk6H8OCvOwaL1G/U6M8gJcETz/5 CRPOld5yzucTHSMli2Dcn4MByQ== X-Google-Smtp-Source: APXvYqzQ3RnLKpBNbUNFs1YrYWyWCVMnwlfD6LJiB4jVDbCwI8mC7f4YEseO+l+BIwRT2Vd0/JMqOw== X-Received: by 2002:ac8:595:: with SMTP id a21mr10448265qth.337.1569599415451; Fri, 27 Sep 2019 08:50:15 -0700 (PDT) Received: from nimloth.alvh.no-ip.org ([191.125.227.87]) by smtp.gmail.com with ESMTPSA id d55sm3276616qta.41.2019.09.27.08.50.13 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Fri, 27 Sep 2019 08:50:14 -0700 (PDT) Received: by nimloth.alvh.no-ip.org (Postfix, from userid 1000) id 19037120AFC; Fri, 27 Sep 2019 12:50:01 -0300 (-03) Date: Fri, 27 Sep 2019 12:50:01 -0300 From: Alvaro Herrera To: Peter Eisentraut Cc: pgsql-hackers , Dmitry Dolgov <9erthalion6@gmail.com>, Thomas Munro Subject: Re: errbacktrace Message-ID: <20190927155001.GA24199@alvherre.pgsql> MIME-Version: 1.0 Content-Type: text/plain; charset=iso-8859-1 Content-Disposition: inline Content-Transfer-Encoding: 8bit In-Reply-To: <20190913155432.GA1200@alvherre.pgsql> User-Agent: Mutt/1.9.4 (2018-02-28) List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk On 2019-Sep-13, Alvaro Herrera wrote: > On 2019-Aug-20, Peter Eisentraut wrote: > > > The memory management of that seems too complicated. The "extra" > > mechanism of the check/assign hooks only supports one level of malloc. > > Using a List seems impossible. I don't know if you can safely do a > > malloc-ed array of malloc-ed strings either. > > Here's an idea -- have the check/assign hooks create a different > representation, which is a single guc_malloc'ed chunk that is made up of > every function name listed in the GUC, separated by \0. That can be > scanned at error time comparing the function name with each piece. Peter, would you like me to clean this up for commit, or do you prefer to keep authorship and get it done yourself? -- Álvaro Herrera https://www.2ndQuadrant.com/ PostgreSQL Development, 24x7 Support, Remote DBA, Training & Services