Received: from malur.postgresql.org ([217.196.149.56]) by arkaria.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZWft-0006iz-9Z for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jan 2018 06:49:17 +0000 Received: from localhost ([127.0.0.1] helo=malur.postgresql.org) by malur.postgresql.org with esmtp (Exim 4.84_2) (envelope-from ) id 1eZWfr-00027I-Oo for pgsql-hackers@arkaria.postgresql.org; Thu, 11 Jan 2018 06:49:15 +0000 Received: from makus.postgresql.org ([2001:4800:1501:1::229]) by malur.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA384:256) (Exim 4.84_2) (envelope-from ) id 1eZWfr-000272-9X for pgsql-hackers@lists.postgresql.org; Thu, 11 Jan 2018 06:49:15 +0000 Received: from mail-it0-x242.google.com ([2607:f8b0:4001:c0b::242]) by makus.postgresql.org with esmtps (TLS1.2:ECDHE_RSA_AES_256_CBC_SHA1:256) (Exim 4.89) (envelope-from ) id 1eZWfk-0001HW-1c for pgsql-hackers@postgresql.org; Thu, 11 Jan 2018 06:49:13 +0000 Received: by mail-it0-x242.google.com with SMTP id m11so18844333iti.1 for ; Wed, 10 Jan 2018 22:49:07 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=gmail.com; s=20161025; h=date:from:to:subject:message-id:mime-version:content-disposition; bh=UqqQ6iLBzMlRKyzmT+KzEXvNNO2nfm/dxCnWSs6Jqhc=; b=NIPNICChoTwdH83erjLpQ+5uGtD0N3vYrylG8xhHXfmhJul5bCAQikJbkpjVrGE//t qCUFiLTPGVEMwApHI4ahBshoSrZWYL5zrNx234DvqgJZwA8STvQBVeJn9DKLpXLJnsnE oeWKwEec/qQQKghuyrmKYaFuNboXun9TGI6wSjUCiRoVZ+8dE2Q3sLEjRH1eB/eblzvC vId8kS1W6XdOvs8IRDcaPAj3ijhd/yEv1gSUy1THrmHofz0uU8zyFk/zd4N0JYwNo7Hg V1nmiucCvYi8bOdONLhqURd3rqfZX5jLwO/fMJ/dsCyZjAIDAVFXJr8X/onzBASqOVl7 XWZQ== 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:subject:message-id:mime-version :content-disposition; bh=UqqQ6iLBzMlRKyzmT+KzEXvNNO2nfm/dxCnWSs6Jqhc=; b=bWitMA/uSeyWCbN9Dpnm15tujRMQR1O1EWdJghoEwfjsOadd+ti4eOiwPvwDfQMNT1 3zvYFf3XfS+pGwl71bd8DwoTqoG9TYVHFhAHnQ2x81WPQjjQgDlbVyGPbSENArsaKWW8 ANxKQ63MdCMduZlQ9NYAZidO8TbgVlepHP15Q5qOX9XYaGJhuWL0IiCkoyI1xFt+/voB wh4qgK8J00Z3CjM56xA73CYGmNWGnu2pACM41Ypbp1pPmOLFdYP9nMFKPSY+SGTm8gso kDIRGB2AVlSwViuHEeFnD1LzhF1v1QGe4RaIrPQvmi69V/kt9vKSsXCXL2sT7kCuWcUY li/Q== X-Gm-Message-State: AKwxytcwdHrsrTeu4wjoO28KtuD9VpwQ7FpYh3FdGP/99s2SsJJWVwke JPRdadt49kxVvShpuykJO9x/yg== X-Google-Smtp-Source: ACJfBoudV9s9Ne2X3K2xO/ceU0luk2CcQTtR8c1lFBrjkQq8wNjkDu1gITQlm4MSglgF7PO4PAuJMw== X-Received: by 10.36.86.212 with SMTP id o203mr261347itb.32.1515653346519; Wed, 10 Jan 2018 22:49:06 -0800 (PST) Received: from paquier.xyz (c137162.net61215.cablenet.ne.jp. [61.215.137.162]) by smtp.gmail.com with ESMTPSA id d186sm187144itd.22.2018.01.10.22.49.04 for (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Wed, 10 Jan 2018 22:49:05 -0800 (PST) Date: Thu, 11 Jan 2018 15:49:00 +0900 From: Michael Paquier To: Postgres hackers Subject: pg_get_functiondef forgets about most GUC_LIST_INPUT GUCs Message-ID: <20180111064900.GA51030@paquier.xyz> MIME-Version: 1.0 Content-Type: multipart/signed; micalg=pgp-sha256; protocol="application/pgp-signature"; boundary="6TrnltStXW4iwmi0" Content-Disposition: inline List-Id: List-Help: List-Subscribe: List-Post: List-Owner: List-Archive: Precedence: bulk --6TrnltStXW4iwmi0 Content-Type: text/plain; charset=us-ascii Content-Disposition: inline Hi all, While reviewing another patch related to the use of pg_strcasecmp in the backend, I have noticed this bit in ruleutils.c: /* * Some GUC variable names are 'LIST' type and hence must not * be quoted. */ if (pg_strcasecmp(configitem, "DateStyle") == 0 || pg_strcasecmp(configitem, "search_path") == 0) appendStringInfoString(&buf, pos); else simple_quote_literal(&buf, pos); However this fails to consider all GUCs marked as GUC_LIST_INPUT, like the recent wal_consistency_checking. guc.c already holds a find_option() which can be used to retrieve the flags of a parameter. What about using that and filtering by GUC_LIST_INPUT? This requires exposing the function, and I am not sure what people think about that. Thoughts? -- Michael --6TrnltStXW4iwmi0 Content-Type: application/pgp-signature; name="signature.asc" -----BEGIN PGP SIGNATURE----- iQIzBAEBCAAdFiEEG72nH6vTowiyblFKnvQgOdbyQH0FAlpXCNwACgkQnvQgOdby QH3geQ/9HtfpwpVibg+L6WKch9lVwDWS5w32BigBkHRvtxmvlOSdBx5i8QVewjSe fDMqx04XEtVsvj/oSHKqeQEquMHMIfnjGjtNpRPSVspqNsoIEPZGoUcwpEr1D/QW GSodkxRm+RC6056LSW1/E01Os7+JQPr7Sh0j1xkvGmWnkGAewqaxrHuxNYw12rX0 LFfSCFZQk79YDI5symcSmJAKiZf/i3ZB2bISCOInn2EKYdSeTeJj/6ieLgWHA5+G OFfxDWyRjIMc7Iweb2FcoD9GkGFB1pnjF3/VRSvhbawCJOyoV6IpLg2gagA6p4v8 JLqRHwqn8PzqVZ1vkVHDwz5D19OCVk4hmErvVfEwg6X3fL3TJ7Fl9K3fm6QdmrUa mr5b2SH7GghjUHgKY9tsq3C+BKBX1xQYYC1riRhb6l/r/9rScF04Iykrohn50XSp Vr8Y9v/FX5r4pOBxuZMc0bugi9f19lFAWl9YpbgV3ysuTT/n8HPQL7ICwK97hi4X At3EJuY2Sp+3fRH4C1bibJVkIV3q5C54pjU4Q5iPK0t9/OUzKjsCaBYPDxHJ/DrH 9vV7QdWwD8/njisir19NzYwBaEI1KKW1QomWfeQuvdo4JtZMM1dKni8yDWIHbhMG ZUYGCC0PQMLHZjEDRYWWVHl7euwS1yFqhk4iynpPUvxlThd4PAk= =TFFp -----END PGP SIGNATURE----- --6TrnltStXW4iwmi0--